I need help with a script.
I have a garage door that opens and close with a toggle. Joel kindly did a script for me to allow the relay to return to normal state when ever it closes. I did a timer even that opens the door at 0700 hrs and closes at 2200 hrs, my problem was that if anyone overrides the BMS and opens or closes the door before the event timer then the door does the opposite for example if anyone opens the door before 0700 hrs then at 0700 hrs the door closes, I have now put a sensor on the door to see if it is open or closed, I need a script to do the following:-
if the sensor reading is false then the door is closed, therefore if event timer 2200 hours is reached then the event timer is not activated, and if the sensor reading is true then the door is open, therefore if event timer 0700 hrs is reached then the event timer is not activated and the door remains open.
this one way of doing it. I can do it in another way in that during the period between 2200 hrs and 0700 hrs every time the sensor reading is true then the door is closed. but that would create a whole new set of problems, and it would take the manual override offline.
so please help me with this.