I want to set up an audio warning for motion outside the house, but want it to not go off for a few minutes after some “suppression” events. (That is, don’t sound within say 10 minutes of one of us getting home, 5 minutes after a door opens, or 15 minutes of changing mode etc.
I’ve seen some delay functions that say “unsubscribe” and then use RunIn, but I’ve also seen mention that you can’t have very many (4?) scheduled events. Given that we could have a lot of events all preventing the audio warning, it seems to me that a good way to handle this is:
a) everytime a “suppressing event” happens, set some state variable “AlarmTimeCheck” to now+ the delay for that event.
b) when I get motion on the outdoor sensor, only sound the alarm if Now > AlarmTimeCheck.
However, I can’t seem to set that state variable with a timedate properly.
So am wondering a) am I thinking about this correctly and b) syntax to set and then compare that state variable.