I’m trying to set a variable based on the time of day.
I have a Condition that turns off the backlight LEDs on the mirrors in my master bathroom, if they were automatically turned on by a motion sensor in the wall switch. It works great, but right now, it’s set for 30:00 minutes. Normally, unless I’m taking a really long shower, that’s more than enough time to trigger the motion sensor again, motion to stop, and turn it off after I leave the bathroom (30 minutes later).
cMBathMirrorAutoOn AND ( tMBathMotion ; tMBathNotMotion ) AND ( tMBathNotMotion ; NOW > 30:00)
However, I’d like to change the 30 minutes to a variable that can be set by other conditions or schedules. For instance, it doesn’t make sense to keep the light on for 30 minutes if I get up in the middle of the night to use the toilet and go back to bed. 5 minutes might be a better variable.
I’ve never worked with State Variables before, which I believe would be the way to go. What’s the easiest way to go about doing this?
Thanks for any advice you can provide.