Best way for delayed if/then state check and action?

Hello all!

I’ve added a Tuya garage door switch/sensor in the past year, and originally just put some automations together, one for day time that notifies me if the garage door has been open for more than 20 minutes, and another for night time, that automatically closes the garage door if it is open for ten minutes. They are crude in their approach, because I do multiple if/then routines to check if the door is still open (but really, still open or open again at the time of checking). Like I said… crude… and they don’t function right about 5-10% of the time.

So… I’ve looked at using Timer helpers, combined with looping scripts. I think I could figure it out, but it will take some time, because I don’t quite understand the Timer helper. Example, I think it’s a countdown for whatever I put in there??? If so, how do I measure the time left, etc. (Rhetorical questions I’ll just need to read more about.)

But the purpose for the post is to understand, and maybe take your collective pulse on if I’m over thinking this.

Is there an easier way to do this than what I’ve described?

Thanks in advance!

Post what you have created and then we can judge if there’s something easier.


BTW, automatically closing a garage door can be a risky business. Not only does it make assumptions that all sensors are correctly reporting there are no instructions in the door’s path (or at least the ones they can detect) but anyone who may be inside/outside of the garage (but not in the door’s path) receives no advance warning of the door’s impending closure.