A number of users seem curious as to the purpose and functionality of the sleep capability within the webCoRE presence DTH. As @ady624 likes to say I pushed to include the feature. So that said, it’s my deal to explain some use cases and purpose behind adding the capability.
Let’s start with 2 questions.
- Do you use user(s) presence as a trigger (going or coming), and/or user presence as a condition (ie. user1 Home, motion detected, turn on light only if user2 is away)
- In your automations, do you use modes to differentiate between some form of day vs night, (awake vs asleep) automations?
If you answered yes to either question, but especially to both of these questions, user wake status tracking is another step in better customizing and evolving your automations to be more intelligent and tailored to each user.
There are so many use cases. Here are just a few ideas
- Whether you want a light (like a “stairs nightlight”) to come on, or at what level it comes on depending if a specific user is sleeping. Let’s say user 3’s room is near those stairs, they sleep with the door open, and if they are home and sleeping. So when that user is home/sleeping only turn the lights to 10% for 3 minutes at night, whereas that user is away or present and awake, the more convenient 50% brightness till motion not detected for 10 minutes is your go to choice.
- You and the wife go to bed at different times, on occasion or often, no matter. Let’s say she goes to bed at 21:00, you at 22;15. She runs “goodnight wife” bedroom shuts down, but you’re still up. Maybe it shuts off Lights in areas you wouldn’t use, but leaves on your office lights and the kitchen. Rather than the last user going to bed and running goodnight, you do it individually. Now the common area stuff shuts off only when the last user goes to bed, but the kids areas and her spaces shut off when she goes to bed.
- Take that a step further. you have a room air conditioner. You like the room cold AF. Your wife doesn’t care either way. So you only have it turn on when you go to sleep, not her.
- She drinks coffee. You don’t. You get up at 06:00. Her at 07:00. Why not have the coffee totally fresh for her at 07:00 rather than an hour old on the hot plate from when you ran good morning, rather than good morning husband.
- What about when young adult kids stay up later than you?
- In any case, have whoever the last goodnight routine (between present users) shut everything off.
- Let’s say a user has to be up daily by 06:00 for school on weekdays. If at 06:45, either the user is not “awake” or their light manually turned on, have their lights start flashing, have their room sonos start blaring and flash color light red until they run good morning (userX)
As you can see, there are an endless combinations of scenarios where an individual’s sleep status is a useful variable/trigger.
In the past, I accomplished this with a virtual switch for each user that their goodnight and good morning routines turned on and off. This works splendidly. But I’m kind of OCD and wanted presence and sleep status as all part of the user’s condition, rather than 2 separate handlers.
So I pestered @ady624 to add the capibility if we developed it. He was very gracious and agreed. @bangali wrote the functions into the DTH, and I customized the layout and tile style/icons.
My OCD basically was the force behind the idea, because why should you have to to 2 separate places to see the relevant user specific conditions and triggers. Rather than simply a user presence sensor, this DTH is intended to be a user status/condition monitor.
Why waste 2 spots in your favorites list, or 2 tiles on your actiontiles dashboard? See what I’m saying here?
As to whether you use the capability or not, you now have a one stop shop device that tracks the user, not just if they are home or not.
If you chose not to use it, the sleeping/awake tile will never change, nor do anything for you. It will also not interfere with the Device simply being a presence sensor. So there’s no downside here.
Now let’s say you use it.
There are 3 statuses on the main tile.
- Home
- Home (sleeping)
- Away
The main tile is simply a display tile. It is no different than setting a piston state based on the conditions of various variables. It is a single tile user readout of the various possible combination of states. In the device’s expanded page, line 2 displays the separate presence and sleeping statuses.
Functional elements:
- The sleep capability can be manually toggled by touching the tile rather than solely by piston triggering. (thanks Ady!)
- The capabilities are separate. Either can be used as a condition or trigger
- If a user is still asleep (forgot to run wake up routine) and leaves the house, the DH will automatically toggle the sleep status to awake. You don’t need a piston setup to do this.
Need ideas, or assistance with setting up automations based on the condition, post below or send me a PM. Happy to offer any advice on use cases and setup that I can. And I hope you all can make use of this to evolve your rules further.