gaetancollaud / digitalstrom-mqtt

Bridge between digitalSTROM and MQTT
GNU Affero General Public License v3.0
23 stars 4 forks source link

Update retain configuration for HomeAssistant discovery messages. #37

Closed albertomontesg closed 1 year ago

albertomontesg commented 1 year ago

This change tries to fix in cases when the Home Assistant instance gets restarted while digitalstrom-mqtt is running. The server availability and discovery config messages are recommended to always be sent with retain true so HASS can recover the config after restarts.

Also the discovery messages had the option retain set for the HASS config which meant we were telling HASS to send the command messages with retain, which is not recommended, as restartint digitalstrom-mqtt could lead to out of sync state and start actinioning devices (e.g. covers) after restarting it (this was common in my case).

Now the retain flag of the config is used for the state messages published by digitalstrom-mqtt and nothing else. The rest of configurations regarding HASS use the default recommended values.

gaetancollaud commented 1 year ago

Thanks @albertomontesg

Released in 1.6.4

albertomontesg commented 1 year ago

Thanks @albertomontesg

Released in 1.6.4

Awesome. Thanks for the fast review and release.