First Morning Activity

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) -

One: settting the date time helper.

Two: testing a condition - is the date time helper today? Should I test in the automation or use a state helper?

Thoughts or recommendations?

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.

Hi Eric,

Not sure if this will exactly help, but it might…

Yeah - that would be an option, and I’ve done that other places.
No presence sensor in that area now, and the logic seems to work.

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.

Makes sense.

I thought my way was more robust if I was getting up early for flight or something.

But it’s pretty much the same with a date condition vs boolean helper.

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.

e

You could make a “workaround” automation that you trigger with a light switch or something.

Yeah - see my original picture. I can’t set the date time helper. Then I don’t know the best way to test if it’s today or yesterday.

I’m trying to keep as much in the UI as possible.

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…

Yeah - I liked thought about using the phone, but the master bath trigger works for myself or SO.

image

Ok - I think the phone charging is more reliable.

How about this:

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! :slightly_smiling_face:

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.

e