We’ve got an older kid who is a sleepwalker, and I’m trying to create automations which will let us know when they are up and around while not creating false positives for getting up and going to the bathroom.
I’ve got a collection of different sensors (several motion sensors with luminence) and have reasonably good algorithms for detecting individual things happening (kid is light’s out for the night, kid has left the room, etc…). I’m struggling to build logic that ties those things together to say things like “if they’ve gone to bed and they leave the room but don’t go into the bathroom, wake us up after 5 minutes”.
The specific issue is that I’m facing having to build a variety of automations with a lot of duplicate logic that I know I’m going to need to be tweaking and updating to address false positives and negatives. Things would be greatly simplified if I can build an automation for “Kid has gone to bed” and store that state somewhere where I can then reference it in conditions in other scripts.
Is there such a thing as a “virtual entity” that’s not tied to a hardware device, where I can control the state through automations / scripts? I’ve done some searching but the right way to do this hasn’t leapt out. I see template sensors, but all of the examples are for setting state based on the state of other things.