I have a Sonoff DW2 433mhz door sensor mounted on a door, it correctly reports if the door opens or closes but seemingly goes into some sort of sleep mode and its state defaults to unavailable after a short period.
The problem is that I want to use this door sensor to check if the door has been left open i.e. if state is on then I know the door is open and I can have an automation check for this state but because its going into unavailable mode it is not reporting that the door is open.
Any ideas on how to somehow retain last state or prevent it from going into unavailable state?
Thanks in advance.