I myself have 2 modes,
I set a sleep mode and a deep sleep mode. sleep is when my family members are asleep and deep sleep is when everyone have been asleep more than 30mins.
These state drives different lighting levels and security.
How I derive the modes is studying my patterns with sensors.
Deep sleep is easy as when there is no sensor movement after 30 mins, start deep sleep. Disabling deep sleep happens when there is activity for more than 30 mins continuously after sunrise using countdown and logging movement every 5mins using time now. If there is no movement after a 10 mins interval after the first movement after sunrise, the sleep modes doesn’t get turned off as it knows i went back to bed…
To know what’s happening between the 3am and 5am is to understand your patterns and differentiate the actions u do. For me, it is me going to the kitchen for a drink, so I have a sensor near when I have my cups to detect. My wife goes to her wardrobe, so I have a door sensor, my child has a sensor at his bedside… so all this different combinations will determine the sleep modes… 2 or more people awake will kill all modes and tell me its time to wake up and prepare for the family if I over sleep.
Down side to this method is u need alot more sensors to get “better resolution” of your actions and thinking of a matrix of sensors activated that determine the actions.
I achieve this matrix by using the GROUPs and SETs app. I group the actions when ALL sensors I select are active. I use sets app to calculate probability by extending the countdown action and if all states in the set are active, execute a flow…
So far for me it works.