Reed switch, garage door, mqtt an binary sensor

Hi there !
Some changes in mqtt sensor auto-detection made my homeassistant losing the state of a binary sensor (reed switch on sonoff-basic, GPIO 14) after hass restarts. When restarting hass, the sensors status is always OFF ( garage door open), even if the real sonoff-sensor is ON (garage door closed). Test on sonoff- Tasmota CLI;

19:07:00 MQT: stat/sonoff-garage-1/STATUS10 = {“StatusSNS”:{“Time”:“2020-04-15T19:07:00”,“Switch1”:“ON”}}

Perfect. I tried 2 solutions. Mqtt - platform and template-platform. Both work well, but both don’t recognize the real sensor state after reboot.

Do I have any chance to fetch the state for homeassistant. Is there a command to achieve this? (mqtt ?)
Unfortunately the mqtt teleperiod delivers the right sensor state every 5 minutes.

19:11:48 MQT: tele/sonoff-garage-1/SENSOR = {“Time”:“2020-04-15T19:11:48”,“Switch1”:“ON”}

But as I mentioned at the beginning, hass doesn’t take notice anymore.

Maybe I can save the last state somewhere. Tried a lot (rules, mqtt commands …)

Thanks
Horst

What does cmnd/sonoff-garage-1/State return?

2:00:08 MQT: tele/sonoff-garage-1/STATE = {“Time”:“2020-04-15T22:00:08”,“Uptime”:“0T21:38:41”,“UptimeSec”:77921,“Heap”:25,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“MqttCount”:3,“POWER”:“OFF”,“Wifi”:{“AP”:1,“SSId”:“something”,“BSSId”:“something”,“Channel”:1,“RSSI”:66,“Signal”:-67,“LinkCount”:2,“Downtime”:“0T00:00:15”}}
22:00:08 MQT: tele/sonoff-garage-1/HASS_STATE = {“Version”:“8.2.0(tasmota)”,“BuildDateTime”:“2020.03.20 14:54:51”,“Core”:“STAGE”,“SDK”:“2.2.2-dev(38a443e)”,“Module”:“Sonoff Basic”,“RestartReason”:“Software/System restart”,“Uptime”:“0T21:38:41”,“WiFi LinkCount”:2,“WiFi Downtime”:“0T00:00:15”,“MqttCount”:3,“BootCount”:343,“SaveCount”:645,“IPAddress”:“192.168.178.241”,“RSSI”:“66”,“LoadAvg”:19}
22:00:08 MQT: stat/sonoff-garage-1/RESULT = {“Version”:“8.2.0(tasmota)”,“BuildDateTime”:“2020.03.20 14:54:51”,“Core”:“STAGE”,“SDK”:“2.2.2-dev(38a443e)”,“Module”:“Sonoff Basic”,“RestartReason”:“Software/System restart”,“Uptime”:“0T21:38:41”,“WiFi LinkCount”:2,“WiFi Downtime”:“0T00:00:15”,“MqttCount”:3,“BootCount”:343,“SaveCount”:645,“IPAddress”:“192.168.178.241”,“RSSI”:“66”,“LoadAvg”:19}

no sensor or Switch1