I have the shelly door2 sensor. Each time HA restart, the sensor defaults to closed. How to setup the last known state after a reboot? This mqtt page suggest about a retain
state, but I don’t know how to go about it. This is currently my sensor.
binary_sensor:
- platform: mqtt
state_topic: "shellies/D8767l31A8C6A/sensor/state"
name: "Genkan Door"
payload_on: 'open'
payload_off: 'close'
device_class: lock
qos: 0