I’m trying to turn on some lights in the morning, provided it’'s the first action.
So I have created a DateTime helper to keep track of the DateTime of the last activity in the master bath (assuming that the time of the last off of the lights and motion would represent the last activity of the day).
Then I plan on using the lights or motion on to check if the LastMasterBathOff datetime helper is yesterday, and if set a scene for the greatroom.
I am open to better ways, but this seems to make sense to me. I realize that if I go to bed after midnight it would not work. That’s rare compared to instances where I would get up extra early.
Having to two issues (trying do keep things in the UI) -
Well look maybe its me but this all seems very complicated and confusing.
What do you want?
Probably turn on light when is dark in the room and turn it off when no one is there.
Just use presence sensor for that.
I have a “first in the morning” automation, it’s very simple but works great. If the time is betweeen 06am to 10am, it fires one time. I have had it for 4 years and it still hasn’t triggered “by mistake”. It uses door sensors and a motion sensor as the triggers.
Initially, I thought I’d just make an automation and test the condition of the last changed property of some switches. But I could not find those properties for my zwave switches (at least in the UI). So then I started down the road of storeing that time as a helper.
But I can’t get the value to store, as in the picture, and then I don’t know the best way to test if it’s today or yesterday.
If you by any chance are an iPhone user, you can create a Shortcut and then use the Webhook trigger integration when for instance the alarm clock is stopped. This trigger can be used for any automation you like…
I think that to use the battery state might be somewhat unreliable due to the fact that there are too many variables to take under consideration, such as battery level when connected to the charger but also trickle charging when the battery is full as shown in the history. Meaning that every time the state switches from Charging to Not charging for longer than two minutes and all the other conditions are met the rule will run, that could in theory have your lighting scene to be started at 02:01. If this is fine, then you’re good to go!
It seems pretty stable (ie gets to full and does not go back to charging). And it only gets triggered by not charging, which is off the charger. See above timeline.
So far this is working well in the two days I’ve been using it.