Makes sense. The variable to keep the lights working manually is a good idea. I’m thinking, though - could be wrong, the parent app isn’t being run if we are referring to the same thing. Essentially I have a large ‘Goodnight’ piston that runs, does a bunch of magic to the locks, lights, TV, etc., pauses the bedroom motion piston to keep lights from coming on every time we move and then sets the variable to 1. No other reference to the variable (besides the lights coming on) is made until morning when turning on a bathroom light signals awake and turn the variable back to 0.
Not using a location mode is simply because of my own short-sightedness when I originally set everything up. I have several other automation events via a node-red implementation, shell scripts via web calls, etc. that rely on a fixed set of modes that doesn’t include night. They are pretty integrated into environmental, presence etc… I’m lazy and don’t want to redo them all is the simple answer…
Time of day is difficult simply because the goodnight routine might happen at 11pm, 3pm or 4am depending on the house schedule.
Now that I’m done with the excuses I’ll try the virtual switch, didn’t even cross my mind, and look at pulling out a piston and running it against a location mode temporarily to see if that makes a difference. If so I’ll just have to not be lazy… it’s also possible it’s the Zooz sensor but it ‘seems’ to be pretty repeatable.