Closed yorulez closed 1 month ago
Which messages and why?
Hi together, I've added some custom code to my project and implemented an automatic backlight dimming based on the environment light level. The value pairs I've defined for that, can be set from the plate. A function to publish retained messages would allow me to store those values easily on the MQTT broker. Something like _dispatch_state_subtopicretained e.g. Not sure if that is what @yorulez meant, but definitely would be useful for me!
I don't think a separate dispatch_state_subtopic_retained
function is necessary. I've added a retain flag to mqtt_send_state
instead. Retain is a mqtt only option, so I don't think it makes sense to add it to dispatch_state_subtopic
as well.
@yorulez Could you please explain which messages you want to retain and why?
@Elix-g Does the new mqtt_send_state
retain flag work for your use-case?
@fvanroie Thanks, very appreciate your swift reaction! The new mqtt_send_state
helps a lot for my use-case.
Closed due to lack of rely from @yorulez
Could you please explain which messages you want to retain and why?
I have just configured a device with powerrelay, it nicely shows up in HA but after ha restart or config reload the switch is in unknown state until its state changes. This would be fixed if there is the retain flag for output state topic. Or is there other way this could be achieved?
Good day. Please add the ability to set a retain flag on the mqtt message.