question

ju avatar image
ju asked

EV Charger integration: OpenEVSE

Hi,

this might be interesting to some of you. I wrote a simple service which polls data from the OpenEVSE (EV Charger, mqtt/json) and puts the data on dbus.


https://github.com/JuWorkshop/dbus-evsecharger


capture-decran-de-2022-05-18-10-22-08.png
https://github.com/JuWorkshop/dbus-evsecharger

Venus OS
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

14 Answers
ju avatar image
ju answered ·


https://github.com/JuWorkshop/dbus-evsecharger

1-devicelist.png


1-devicelist.png (42.9 KiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jurekz avatar image
jurekz answered ·

Super!!! Am waiting for OpenEvse charger so I will try that service.

Thank you!

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

fcattaneo avatar image
fcattaneo answered ·

Very cool!!

I'm just 2 open evse working in my network and also a complete Victron PV system ( with Cerbo GX, batteris etc etc...

I'm inexperienced in Cerbo GX software ; how i can install this software ( i need root access?.. ssh access ?).


Ciao,

Fabrizio.


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

ju avatar image
ju answered ·

Yes, need root access and ssh active.
Cerbo : https://youtu.be/L9BHSJEpTD8?t=158

Putty ssh, install dbus-evsecharger:

wget https://github.com/JuWorkshop/dbus-evsecharger/archive/refs/heads/main.zip
unzip main.zip "dbus-evsecharger-main/*" -d /data
mv /data/dbus-evsecharger-main /data/dbus-evsecharger
chmod a+x /data/dbus-evsecharger/install.sh
/data/dbus-evsecharger/install.sh
rm main.zip
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

fcattaneo avatar image fcattaneo commented ·
Ju, what do you suggest to do before upgrade the Cerbo GX firmware ( when your application are installed ) ?


Thanks,

Fabrizio



1 Like 1 ·
fcattaneo avatar image
fcattaneo answered ·

Thanks of you i was able to install the script and work great!!

The only wrong info is the EVSE in shown in critical load side, but in real it is connected to ACin1 side.

Fantastic script !!

1661870231561.png


1661870231561.png (362.5 KiB)
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

pau1phi11ips avatar image pau1phi11ips commented ·

You can change the position by adding this around line 58 of dbus-evsecharger.py

self._dbusservice.add_path('/Position', 0) # normaly only needed for pvinverter
0 Likes 0 ·
fcattaneo avatar image
fcattaneo answered ·

Tanks for your support.

If i append this line at the end of object definition ( as shown ) , my PV inverter ( in ACin ) stop to work and also the Open EVSE do not work.


self._dbusservice.add_path('/ProductId', 0xFFFF) #

self._dbusservice.add_path('/ProductName', productname)

self._dbusservice.add_path('/CustomName', productname)

self._dbusservice.add_path('/FirmwareVersion', int(data['divert_update']))

self._dbusservice.add_path('/HardwareVersion', 2)

self._dbusservice.add_path('/Serial', data['comm_success'])

self._dbusservice.add_path('/Connected', 1)

self._dbusservice.add_path('/UpdateIndex', 0)

self._dbusservice.add_path('/DeviceInstance', deviceinstance)

self._dbusservice.add_path('/Position', 0) # normaly only needed for pvinverter





1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

pau1phi11ips avatar image pau1phi11ips commented ·

Hmm, maybe this just works for Inverters then. I assumed it would work here too. There's are what the values ordinarily equate to.

  • 0 = input
  • 1 = output 1
  • 2 = output 2
0 Likes 0 ·
ceriw avatar image
ceriw answered ·

I've installed this on my system and can see the data - thanks. The only thing that I can change via the settings is the "Enable Charging". when I try to change the "Charging Current" it doesn't let me change it. Also, the "Position" is shown as "Unknown". If I Change this to "AC Output" and then levee the menu, when I come back it shows "Unknown" again.

Have I messed up the installation somehow?

Thanks

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

ea4gkq avatar image
ea4gkq answered ·

I fork it and made some changes in order to work with new openevse firmware


https://github.com/ayasystems/dbus-evsecharger/


Please check it, it works with ESP32 and firmware 4.1.x

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

ceriw avatar image ceriw commented ·
That works - thanks
0 Likes 0 ·
wapalco avatar image
wapalco answered ·

On Fcattaneo's screen shot for the EVSE it says "waiting for sun". Is it possible to setup rules for when to use the EVSE based on SoC or a minimum current from the PV array??

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

adahmen avatar image
adahmen answered ·

@ea4gkq

I do not have an OpenEVSE charger but an OpenWB wallbox.

It's easy to read the needed data using mqtt (only a few lines of code) - but I'm not an Python expert to merge these lines into your code.

This is the code to read from OpenWB:

import paho.mqtt.client as mqtt

def on_connect(client, userdata, flags, rc):
        if rc == 0:
            print("Connected to MQTT Broker!")
        else:
            print("Failed to connect, return code %d\n", rc)

def on_message(client, userdata, msg):
        if "openWB/lp/1/VPhase1" in (msg.topic):
             temp = float(msg.payload)
             print("L1 Power: ", temp)
        if "openWB/lp/1/VPhase2" in (msg.topic):
             temp = float(msg.payload)
             print("L2 Power: ", temp)
        if "openWB/lp/1/VPhase3" in (msg.topic):
             temp = float(msg.payload)
             print("L3 Power: ", temp)
        if "openWB/lp/1/kWhCounter" in (msg.topic):
             temp = float(msg.payload)
             print("Energy consumed by charger: ", temp)
        if "openWB/global/WAllChargePoints oder openWB/lp/1/W" in (msg.topic):
             temp = float(msg.payload)
             print("Total Power: ", temp)
        if "openWB/config/get/sofort/lp/1/current" in (msg.topic):
             temp = float(msg.payload)
             print("Charge Current: ", temp)
        if "openWB/lp/1/boolPlugStat" in (msg.topic):
             temp = float(msg.payload)
             print("Plugin Status: ", temp)
        if "openWB/lp/1/boolChargeStat" in (msg.topic):
             temp = float(msg.payload)
             print("Ladestatus: ", temp)

client = mqtt.Client()
client.on_message = on_message
client.on_connect = on_connect
client.connect("192.168.178.20", 1883)
client.subscribe("openWB/#")
client.loop_forever()


It would be great to get some help to adopt this script to work with an OpenWB.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

ea4gkq avatar image
ea4gkq answered ·

@adahmen Where I can find openwb source code?

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

adahmen avatar image adahmen commented ·

@ea4gkq - What exactly do you mean?

The whole solution is available here: https://www.openwb.de

The code is available here: https://github.com/snaptec/openWB

0 Likes 0 ·
fcattaneo avatar image
fcattaneo answered ·

@ju@workshop Ju, what do you suggest to do before upgrade the Cerbo GX firmware ( when your application are installed ) ?


Thanks,

Fabrizio

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

ditmarco avatar image
ditmarco answered ·

Hello

And congrats, for the work, well done.


It's possible to no on VRM the statistics of charger sessions, to add?


Or depends from Victron..


Tks nice job

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

nzmikec avatar image
nzmikec answered ·

Hi All,
Im trying to use this code (actually the https://github.com/ayasystems/dbus-evsecharger version as I have wifi v5.02) and having some problems with it not working. Wondering how I can find the log files to troubleshoot.
Many thanks!

Mike.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources