I feel like I have been going through every article I can find online, and not winning. So was hoping someone has experienced this. After a power cycle of my Raspberry Pi (hassio) my magnetic sensors defaults to close(Sonoff RF Bridge, with Tasmota), and not the last know state. The bigger issue is that I have a switch on my garage doors and after every power cycle the garage doors will open. This is configured in Tasmota as a relay with 2sec On/Off.
I have tried so many articles and am somewhat lost, below is an example of the configuration of 1 sensor and the garage switch.
Just made the change, but noticed something interesting. I think the issue is with Tasmota, as every time I restart Tasmota (The device) the relay toggles and my garage door opens or close, starting to wonder if it could be due to the fact that I selected a relay and not some sort of button.
I Mananged to fix the NodeMCU(Tasmota) side of the problem, changed from pin D0 to D2 (GPIO4) and now it does not toggle on restart of the device, now it still toggles on a power cycle of HomeAssistant. Seems like it sends and empty payload which then trigger the relay.