a529987659852 / openwb2mqtt

Home Assistant Integration for openWB (Version 2)
12 stars 4 forks source link

Discussion: How to trigger changes in openwb2 via MQTT #2

Closed a529987659852 closed 9 months ago

a529987659852 commented 10 months ago

Dear all,

I haven't yet figured out how to trigger changes from Home Assistant to the Wallbox, version 2. For example, I'd like to change from PV --> Sofortladen charge mode. I figured out that the chargepoint seems to be connected to a charge profile and the latter must be changed. However, I'm, not sure whether this is correct.

If you already have some insights, please share here so that I don't have to work from scratch.

Thank you very much Andreas

Renko72 commented 10 months ago

Bin gerade die nächsten Tage unterwegs und kann nicht auf meiner Open wb schauen.

Aber vielleicht hilft der alte Post wo jemand in Opernhab den Modus umschaltet https://openwb.de/forum/viewtopic.php?t=6633

boredomwontgetus commented 10 months ago

At the moment i am just setting these charge modes over MQTT Topic: openWB/set/vehicle/template/charge_template/0/chargemode/selected Values: stop, pv_charging, instant_charging

Yes, you are correct. Chargemode is bound to a charge profile/template. This is also reflected in the MQTT topic. In my case (see above) i am just using one charge profile 0.

Also, i am not sure why but for some reason i have to publish the modes surrounded in quotes for this to work. So i publish

openWB/set/vehicle/template/charge_template/0/chargemode/selected "pv_charging"

instead of

openWB/set/vehicle/template/charge_template/0/chargemode/selected pv_charging
ChristophCaina commented 10 months ago

hm... ok, I will setup a VM / LXC with OpenWB 2.x to do some tests before I will upgrade my wallbox with the software. I hope, that I can provide helpful information without having a fully functional setup ...

ChristophCaina commented 10 months ago

Send Vehicle SoC over MQTT to the OpenWB {id} is the counter of configured cars - in my example 0 since I have only one car configured right now.

Die Daten werden immer dann aktualisiert, wenn das Topic veröffentlicht wird. Die Abfrageintervalle werden nicht berücksichtigt, da das Intervall vom sendenden Client festgelegt wird.

openWB/set/vehicle/{id}/get/soc Fahrzeug-SoC mit Nachkommastellen (Float) oder Ganzzahl Beispiel: 89.5

openWB/set/vehicle/{id}/get/range Reichweite des Fahrzeugs in km mit Nachkommastellen (Float) oder Ganzzahl Diese Info ist optional. Beispiel: 356.5

I would prefer to have an option in the integration to configure the entity which provides the SoC of the car and then sending this to the OpenWB. Right now, I am doing this with a dedicated MQTT config, but having it 'built in' would be perfect ;)

ChristophCaina commented 10 months ago

hm... while the OpenWB 2.x Software does support MQTT, it seems, that it has also implemented communication via Modbus. At least, EVCC seems to use Modbus for its communication with Software 2.0 grafik

here's also a pdf documentation about the Modbus registers of the 2.0 software: https://openwb.de/main/wp-content/uploads/2023/10/ModbusTCP-openWB-series2-Pro-1.pdf

If you read certain topics in the forum, it seems, that the whole structure of the OpenWB Software has changed. The Charge-Mode will not be set for the charge-point, but for the Charging-Profile - which can be used on different Wallboxes and for different individual cars.

Da hast Du eine nicht ganz-so-gut gelöste Stelle in der 2er-Software gefunden. Der Lademodus, den Du am Ladepunkt auswählst, wird ins Ladeprofil geschrieben. Und nicht, wie man vermuten würde, in den Ladepunkt. Der hat nämlich, wie Du bemerkt hast, gar keinen Lademodus. Ganz absurd wird es, wenn Du zwei Ladepunkte mit dem selben Ladeprofil hast. Stellst Du den einen Ladepunkt um, stellt sich der andere mit.


mögliche Werte aus topic lesen: openWB/vehicle/template/charge_template/2

und dann hiermit schreiben: openWB/set/vehicle/template/charge_template/2/chargemode/selected

Furthermore, here's a list of all topics the "colors" theme is using to get information from the OpenWB 2.0 software... https://github.com/cshagen/core/blob/master/packages/modules/web_themes/colors/source/src/assets/js/sendMessages.ts

a529987659852 commented 10 months ago

Hi Christoph and Thomas, thanks for pointing me into the right direction. I've chosen the following approach:

Andreas

scrichab commented 10 months ago

Hi,

hofftentlich ist mein English gut genug ;-)

installed alpha version - after installation i have 9 Entities

Bildschirmfoto 2024-01-01 um 19 14 40

none of the created topics will match any topic of openwb2

Bildschirmfoto 2024-01-01 um 19 15 18

anything i missunderstood?

Renko72 commented 10 months ago

@scrichab for me its not clear what you mean that none of the created topics match to any topic of openwb

I installed the actual alpha version and i configured it and with the integration in homeassistant i set then to the id of my open WB Status to 1 which is my actual ID see Screenshot of open WB

image

then i get the actual supported values image on my system i have no battery and PV configured

Did you not get the values ?? Then it seems that in your configuration is something wrong

scrichab commented 10 months ago

ok my charpoint is id4

Bildschirmfoto 2024-01-01 um 22 22 38

when i look at mqtt explorer i have data like

Bildschirmfoto 2024-01-01 um 22 16 25

integration setup with id4 i get nothing

Bildschirmfoto 2024-01-01 um 22 26 45

when i setup 2 topics manually i get the information

Bildschirmfoto 2024-01-01 um 22 28 23

i don´t know what i´m doing wrong

a529987659852 commented 10 months ago

Then, most likely, your MQTT root topic is incorrect. Please refer to the following issue for some examples: https://github.com/a529987659852/openwb2mqtt/issues/3 And please continue the discussion there since this issue was created to find an approach how to trigger changes.

Thanks Andreas

scrichab commented 10 months ago

hopefully this is the right place ;-) after successfully make configuration - thank you for your help in the moment i´m missing the following "switches" to trigger Charger

Bascht74 commented 10 months ago

Change of the charge mode works for me.

scrichab commented 10 months ago

@Bascht74 yes - change of chargemode works for me too i asked for the two topic in my answer

Bascht74 commented 10 months ago

OK. My statement had no connections to yours... Just a "ping" that this is working now.

EckeFL commented 9 months ago

Hmpf.... change chargemode dosn´t work on an openWB pro

Layer8 bug. MQTT Config in more than one code block is too complicated for me