Closed bentolor closed 1 year ago
I have the same issue.
will fix it
checked the code. As you can see in the code-snippets below the retained flag is on for homeassistant. These snippets are from version 0.7.36
(last release)
autodiscovery publish: https://github.com/lumapu/ahoy/blob/ba218edbdb1b0a168e0c721bc2259fcc97c57f8a/src/publisher/pubMqtt.h#L417
publish-function-prototype: https://github.com/lumapu/ahoy/blob/ba218edbdb1b0a168e0c721bc2259fcc97c57f8a/src/publisher/pubMqtt.h#L178
@lumapu Thanks for investigating and the reference. I just retested the situation with 0.7.36
by deleting the entries and recreating them. Not they correctly appear to be RETAIN values.
So my best guess is, that this was some effect of pre-0.7.36
in combination with update.
I'm not sure on @darkcheater situation, but from my side this ticket can be closed.
I just redid the HA discovery and now I have more values and the names are better. Forgot to redo the discovery after changing the config. And I think my problem comes from somewhere else because my controller seems to crash after some time. I think this can be closed. Thanks!
Platform
ESP32
Assembly
I did the assebly by myself
nRF24L01+ Module
nRF24L01+ plus
Antenna
external antenna
Power Stabilization
nothing
Connection picture
Version
0.7.36
Github Hash
ba218ed
Build & Flash Method
AhoyDTU Webinstaller
Setup
Added an MQTT target (mosqitto) Initially created/triggered HASS discovery using v0.6.9
Debug Serial Log output
No response
Error description
Thanks for this awesome piece of software!
mqttui
: Obviously all data updates atinverter/…
still get published, but the autodiscovery entries (homeassistant/sensor/topicname/ch0_…
) have gone missing.mqttui
[Discovery Config (homeassistant) > Send]
everything seems to be working again.I can remember some (to me obscure) option to "delete homeassistant on shutdown" entries which where present in the 0.6.9 ui, but no longer. As of today, I suspect, unchecking them send RETAIN mqtt messages for the autoconfig entries, while checking thi soption just sent "normal" mqtt messages.
My interpretation of the situation: looking at the (re-)created autodiscovery entries created by 0.7.36 I see that none of the values are marked as RETAIN, while they are for all other MQTT HASS autodiscovery entries (i.e. ESPHome, Valetudo, Xiaomi DaFang Hacks).
Obviously, after some time the non-RETAIN homeassistant autodiscovery mqtt messages ahoyDTU created got lost this morning, causing home assistant mqtt integration to assume the entity to be no longer available.
I see two options to avoid the erratic breakage of the HASS integration:
Republish them automatically. But honestly I don't know how often this needs to be done, as you have no guarantee at all that they are visible when home assistant needs them.I just looked at the home assistant documentation, and It's quite obvious that the RETAIN flag is missing for correct operation:
Am I right that the behaviour changed here recently?