LukasGrebe / ha-addons

Addons for Home Assistant
GNU General Public License v3.0
37 stars 42 forks source link

Refreshing values from network adapter (WiFi) #47

Closed Elijen closed 1 year ago

Elijen commented 1 year ago

I am running a WiFi ebus adapter connected to my Vaillant heat pump and ebusd addon on my HA. Everything works fine except the values I am interested in are being refreshed very slowly. Some values seem to take even hours to refresh (although this could be a bug in "Last updated" attribute?).

That said what is the best way to make sure I have the current up-to-date value displayed on my dashboard? I don't need all the values refreshed so often so decreasing polling interval does not seem to be a good option. I have tried creating an automation that is run every minute and is calling "MQTT: publish" service with empty payload and topic like "ebusd/b7v/Hc1FlowTemp/get" but this does not seem to have any effect on the values displayed on dashboard.

LukasGrebe commented 1 year ago

Check your logs which config files are loaded and then look up the message definition in https://github.com/john30/ebusd-configuration

Some ebusd messages can not be read. This depends on the work by the ebusd community in reverse-engineering propriatary ebusd messages and writing corresponding configuration files. The ebusd config files allow for a passive message that ebusd will listen to and update field values of but won't ever send out a "readout value request" message to the bus. This ebusd behavior is defined by the first letters of a Message definition - the TYPE field. For passive messages, the TYPE field would be any character(s) without an r or w. In this case the values are simply sent periodically by the ebus hardware and you'll have to wait for them. For me, this is the case for my hot water storage temperature. It's sent every 5min by the valiant hardware.

When a message is defined as a read or poll message, you should be able to get updates of the value at custom intervals. Check that this is case by again looking at the ebusd config line. The TYPE field of the message definition, would start with r or end with w. Note: also check the setting of the read only -r, --readonly option. If readonly is set to true, I think this disables these "readout value request" messages that would need to be sent to the bus to have the hardware answer with the current value.

If you have an r type messages, and you have readonly set to False, your mqtt syntax should be correct as per MQTT Client documentation and we'll have to do some more digging as to why the value won't update.

Finally note that the ebusd configuration has it's own polling syntax: See TYPE r1 through r9 in the Message definition. The poll cycle mentioned there defaults to 5 seconds but can be changed with the ´--pollinterval=SEC´ flag as defined in the run section of the ebusd wiki. So r1 would default to every 5 seconds, r4 to every 20 seconds.

LukasGrebe commented 1 year ago

closing as stale