a529987659852 / openwbmqtt

Custom component for home assistant supporting openWB wallbox
35 stars 16 forks source link

Sensor Value Drops #42

Open MarcoNica opened 1 year ago

MarcoNica commented 1 year ago

I use the openwb in combination with a SolarEdge inverter. Ever since I integrated the entities for purchased electricity, grid feed-in and total photovoltaic yield into the HomeAssistant energy dashboard, I have noticed that they sometimes return a zero value and shortly afterwards return to the correct value. This messes up the energy dashboard, as it always adds the jump from 0 to the old value to its sum. image

Total Photovoltaic Yield value jumps to a lower value for a period of time, but not to 0. Of course, this also messes up the energy dashboard. image

ChristophCaina commented 1 year ago

Hi, I had similar issues for a long time... Usually, these "drops" can happen when the MQTT Broker persists messages and due to a restart of either the wallbox or HomeAssistant, it will send the older persistent / saved values.

To prevent that, I've removed the MQTT bridge and connected HomeAssistant directly to the MQTT Broker of the Wallbox. Also, to not rely on the PV Data comming from the Wallbox, I've added a Modbus Proxy into my network, which is getting all data from the Inverter and sending it to the wallbox and homeassistant solaredge Modbus integration.

Solar Edge Modbus Integration: https://github.com/binsentsu/home-assistant-solaredge-modbus

Modbus Proxy (HA Addon): https://github.com/Akulatraxas/ha-modbusproxy

Modbus Proxy (Standalone application): https://github.com/tiagocoutinho/modbus-proxy

MarcoNica commented 1 year ago

@ChristophCaina thanks for your quick reply. My current setup is configured like descriped in the readme of this openWB integration an rely on Mosquitto broker.

Could you tell me the steps i need to do? How to connect HomeAssistant directly to the MQTT Broker of the wallbox?

ChristophCaina commented 1 year ago

it's pretty straight forward. With the Standard configuration you are using an MQTT Server running in HomeAssistant. This MQTT Server will then be configured to connect to the MQTT Broker running on the OpenWB.

Your OpenWB Integration will then be configured to connect to the Broker running in HomeAssistant.

I've just configured the OpenWB Integration to connect to the IP from the OpenWB wallbox directly, without having any other MQTT Broker.

alxw1 commented 1 year ago

Good Morning @ChristophCaina, i am following your discussion because i am trying to set up q bridge between openwb and homeassistant following all those guides all over the internet and tbh it is very frustrating since no data from openwb shows up in homeassistant (and also not as a knot in homeassistant opening the mqtt in Mqtt-Explorer)

therefore would you be so Kind to provide a little guide how you direct connected the openwb in homeassistant mqtt?

MarcoNica commented 1 year ago

@ChristophCaina If i get you right i firts can clear my setup from anything related to the openwb integration. So remove Mosquitto and the openwb integration completly from my current setup.

How to configure the MQTT Server in HomeAssistant? And how to configure the OpenWB to connect to the IP of the Wallbox? And in your openwb you then configure EVU and PV to connect to Homeassistant? When yes how? As @alxw1 mentioned it would be wonderfull if you can make a little tutorial.

alxw1 commented 1 year ago

@MarcoNica und @ChristophCaina ich habe hier https://community.home-assistant.io/t/problem-bei-openwb-anbindung-an-home-assistant-per-mqtt/517320 zusammengeschrieben, welche Schritte ich bei der Installation durchgeführt habe. Leider funktioniert bei mir so "gar nichts"

ChristophCaina commented 1 year ago

Hi, here's a short guide with a clean HomeAssistant installation:

  1. Install OpenWB Custom Component grafik

  2. Setup the component (MQTT Topics, amount of charge-points) grafik

  3. Setup device Area grafik

  4. Now, the integration will load all sensors, but they can't get any information, since no MQTT Connection is set up. --> Note, that I haven't installed an MQTT Broker Addon! grafik

  5. MQTT Integration should appear in your integrations list, because it is required by the OpenWB Component grafik

  6. Configure MQTT Component: grafik grafik

If you have set up a Username and Password for MQTT in your OpenWB, you need to add this to the configuration.

--> After finishing it, reload the OpenWB integration to be sure. It should now get the values.

ChristophCaina commented 1 year ago

Of course, the above ist only working If you don't use anything else that requires a mqtt Broker (zigbee2mqtt for example)

MarcoNica commented 1 year ago

@ChristophCaina Ok, thanks for that tutorial. But i need the normal mqtt Broker as you mentioned above.

So my plan now is to get my needed solaredge data directly from modbus and not from the openwb. Can you please tell me what to setup in the openwb?

alxw1 commented 1 year ago

If you have set up a Username and Password for MQTT in your OpenWB, you need to add this to the configuration.

Thanks a lot @ChristophCaina. Just to be Safe… did you Set up a new mqtt in your openwb? Because i only have the cloud one and that one needs a User + PW. but opening the openwb in mqtt-explorer no user and pw are needed.

This is how it is der up: 856EC385-49C8-442C-92F7-952F4BE4ECDC

MarcoNica commented 1 year ago

@alxw1 I think you can completly disable this. So set "MQTT-Brücke" to "Aus". The MQTT Broker(not Bridge) keeps active and as you mentioned is reachable in the local network without any username and password.

alxw1 commented 1 year ago

It drives me nuts…

If i put in the OpenWBs IP-Adress (Screenshot) and leave User and PW blank. The HA cant Connect.

On mqtt Explorer I can Connect and receive values.

![Uploading 7CA4B305-255C-4EAB-B4F3-33A6ABA698D9.jpeg…]() 7DF40D3C-51C5-4017-B4CB-C46D953A0E60

alxw1 commented 1 year ago

Thats What i did:

here you can See my openwb is Sending 1B220D82-4A3C-4088-BE34-7ED851A51707

And the openwbs ip Adresse DA2D1175-7638-4A6F-8C2E-F43EB142FFA2

putting the *.50 in here 7FA04BEC-9D4F-4FB9-8170-81F357837CA9

Ends up like this:

0F426536-1FFB-4AE7-AFD4-CB7AC764FC31

pcmaka commented 1 year ago

I have the same issue and changed

cleansession true

to

cleansession false

in my bridge config and this seems to have result the issues for me.

Per mosquitto documentation, this prevents retained messages to be send again on reconnect.