Retain RF433 sensors states after Hass Restart?

Hello community!!
Is there any way to retain the states of RF433 sensors after a Hass restart like publish2 option in Tasmota Rules?

Hello @geoxen and welcome!

You mean that you would like OMG to publish the RF values to MQTT with retain state?

Yes! After the Home Assistant restart.
As i see in User_config.h there is a parameter #define will_Retain true
But whenever i make changes to my Home Assistant config and restart the RF Sensors states are changing.

Example: I have some GS-WDS07 Sensors with Open/Closed RF Signal. When i restart the Home Assistant, all these sensors change to “Closed” state even if it’s really “Open”.

I tried the same with Tasmota and created a rule with the Publish2 Option which publishes topics with retain flag and worked great. Even after restart.

Is it possible with OMG?

Thank you for your time and your project btw!! :smiley: :smiley:

+1 I’ve noticed this as well :slight_smile:

Hello,

This macro is only used for the will message, online/offline.

The issue if we use the retain state of 433toMQTT the broker will only retain the last received value. And as most of people have several sensors I don’t think it will be relevant. Maybe it should be liked with the use of valueAsaSubject option ?

Do you mean the last received value from a single sensor?

The last received value will correspond to the last emitting 433mhz sensor from all your 433mhz sensors.

On tasmota firmware all sensor states are being retained after restart if i create the rule with Publish2 option, not just the last received one!

I’m building a custom Gateway atm with Mega+Ethernet Shield+RF433+BL+IR and this feature is a must have for me!!

Is it possible to add this feature on OMG? :grinning:

I understand the need, but how are you handling this, if you have one topic per gateway ?