[Resolved] Day mode implementation question
-
Day mode. We're all pretty much in agreement of the standard being "sunrise to sunset" = Day mode.
I trigger HVAC, lighting, blinds, etc off of modes as do we all.
My problem here is that, especially this time of year, wake-up time comes BEFORE sunrise by almost an hour. Given no one likes to get up in a cold house first thing I have Day mode HVAC settings start at wake-up time.
I'm tracking another issue but also wanting to clean up rulesets.
I'm opening this up to the group, showing my work, and asking for your thoughts/guidance on how to configure this Day mode.
Full transparency, the
Defeat Midnight
is new - it used to be set to justbefore sunrise
and that means it's "eligible" at midnight. -
Hmm I am not sure if I am following here, but why are you trying to mitigate the rule from going true at midnight? That shouldn't be an issue since the sunrise condition won't go true until the sun has risen which won't be at midnight ever?
Also the rule state "Wake Up Times" that is referenced twice where is that?
-
Hmm I am not sure if I am following here, but why are you trying to mitigate the rule from going true at midnight? That shouldn't be an issue since the sunrise condition won't go true until the sun has risen which won't be at midnight ever?
Also the rule state "Wake Up Times" that is referenced twice where is that?
Wake-Up times is literally just that: "after 0630 ET on weekdays/workdays" and "after 0730 ET on weekends", completely unrelated to sunrise/sunset.
Regarding midnight: my preliminary findings around a different issue point to ruleset
Day
transitioning fromRESET
toSET!
at midnight. I don't have all the required data pulled together yet to post about the issue I'm troubleshooting - thisDay
mode thing has been a burr under my proverbial saddle for some time. -
Hm okay lets see if I can help, I think I am understanding what you want. You could move the whole "Wake Up Times" rulset to the constraints section in your "Day" rule set and remove the "Wake Up Times is
TRUE
" condition from your triggers. This would only allow the day mode to be triggered if the constraints are also met.Then you can completely delete the "One of these" groups" and replace it with the condition of between sunrise and sunset. You won't have to worry about the rule going true during midnight since you added the time/day constraint which will only allow the rule to go true if it past 6:35am on a weekday or 7:30am on a weekend. I attached a screenshot of what the rule should look like to better help.
This layout will work like this:
Triggers:
- Your house should NOT be in Vacation, Guest or Night mode
- AND the time should be within Sunrise and Sunset
- AND one of the phones should be present (I know you only showed one device but I am assuming you will add others, hence the 'or' subgroup)
Constraints:
- All this can only go true if it is it past 6:35am on a weekday or 7:30am on a weekend
-
@gwp1 I don't understand all the complexity around the Day rule looking at sunrise and wake up times. I think what you are describing is that you want Day to start at the earlier of sunrise or your wake-up time, and that's a simple OR condition: Wake Up Times is true OR time is after sunrise. And the period before from midnight to either has nothing to do with that and isn't a consideration.
-
@gwp1 I don't understand all the complexity around the Day rule looking at sunrise and wake up times. I think what you are describing is that you want Day to start at the earlier of sunrise or your wake-up time, and that's a simple OR condition: Wake Up Times is true OR time is after sunrise. And the period before from midnight to either has nothing to do with that and isn't a consideration.
@toggledbits Oy. I don't know how I missed that. I am embarassed.
In my defense, I do have a history of designing rules much harder than they need to be. I tell myself "think edge" but still try to circle everything instead.
Guessing for
Evening
the recommendation would beafter sunset
vsbetween sunset/sunrise
?@Pabla the
OR
is there for future state... waiting on an update to iCloud3 in HASS that will allow triggering from the presence of my Apple Watch as well as iPhone for those times when it's a quick trip out and I let the Ultra do the work vs carrying the phone, too (think workout, bike ride, etc.) -
@gwp1 I don't understand all the complexity around the Day rule looking at sunrise and wake up times. I think what you are describing is that you want Day to start at the earlier of sunrise or your wake-up time, and that's a simple OR condition: Wake Up Times is true OR time is after sunrise. And the period before from midnight to either has nothing to do with that and isn't a consideration.
-
@gwp1 I don't understand all the complexity around the Day rule looking at sunrise and wake up times. I think what you are describing is that you want Day to start at the earlier of sunrise or your wake-up time, and that's a simple OR condition: Wake Up Times is true OR time is after sunrise. And the period before from midnight to either has nothing to do with that and isn't a consideration.
@toggledbits had to mess about with some mode additions/removals and changed sunrise/sunset to
between
to make this work as at sunset bothDay
andEvening
modes were valid at sunset.Would this be better served as is or by adding this under
Constraints
? -
Depends entirely on what the actions are, and when you want them to run. I'm assuming it just sets mode to Day. If the mode changed during the day, would you want it changed back to Day? Trigger.
-
Depends entirely on what the actions are, and when you want them to run. I'm assuming it just sets mode to Day. If the mode changed during the day, would you want it changed back to Day? Trigger.
@toggledbits Yep, absolutely - if I leave during the day mode shifts to
Away
- returning home the expectation would be a return toDay
if still before sunset. Same withEvening
if after sunset. -
Depends entirely on what the actions are, and when you want them to run. I'm assuming it just sets mode to Day. If the mode changed during the day, would you want it changed back to Day? Trigger.
I continue to wrestle with modes. Changing
Wake-up
andSunrise
toafter
inDay
resulted in a battle betweenDay
andEvening
in the later hours as both were "valid" after sunset given theOR
inDay
I've modified
Wake-up
to start at the two wake times, 0630 ET and 0730 ET, and endbefore
12noon ET. This closes it off from arguing at sunset.Day
currently reads as such now:- I must be home (can this be addressed better by "mode != Away"?)
- It must be after wake-up times OR after
sunsetsunrise, whichever comes first - must be ignored if in
Vacation
(I'm away for extended period) orGuest
(someone specific is checking on the house whilst I'm on vaca)
Evening
- should kick in
after
Sunset - I must be home (again, can this be driven by
mode
!=Away
better?)
must be ignored if inVacation
(I'm away for extended period) orGuest
(someone specific is checking on the house whilst I'm on vaca)
Night
is set manually, ie not on a schedule. Two ways it can be set, the more basic is via voice command to Amazon Echo device that flips a virtual switch which triggers mode.The second is more complex but still manual:
- phone must be in master bedroom
- phone must be charging for > 00:00:10 (so lockdown can be aborted if needed)
- can only be triggered if the above triggers happen whilst in
Evening
orWork
(awakened in the middle of the night for a work thing and returning to sleep). If I happen to charge the phone during the day the house shouldn't lock down inNight
mode.
I put this out there because I have a tendency (ok, more than a tendency) to overthink and over-complicate my rules as @toggledbits will confirm. This results in unnecessary demand on MSR as well as rules fighting with rules or duplicating outcomes.
-
I continue to wrestle with modes. Changing
Wake-up
andSunrise
toafter
inDay
resulted in a battle betweenDay
andEvening
in the later hours as both were "valid" after sunset given theOR
inDay
I've modified
Wake-up
to start at the two wake times, 0630 ET and 0730 ET, and endbefore
12noon ET. This closes it off from arguing at sunset.Day
currently reads as such now:- I must be home (can this be addressed better by "mode != Away"?)
- It must be after wake-up times OR after
sunsetsunrise, whichever comes first - must be ignored if in
Vacation
(I'm away for extended period) orGuest
(someone specific is checking on the house whilst I'm on vaca)
Evening
- should kick in
after
Sunset - I must be home (again, can this be driven by
mode
!=Away
better?)
must be ignored if inVacation
(I'm away for extended period) orGuest
(someone specific is checking on the house whilst I'm on vaca)
Night
is set manually, ie not on a schedule. Two ways it can be set, the more basic is via voice command to Amazon Echo device that flips a virtual switch which triggers mode.The second is more complex but still manual:
- phone must be in master bedroom
- phone must be charging for > 00:00:10 (so lockdown can be aborted if needed)
- can only be triggered if the above triggers happen whilst in
Evening
orWork
(awakened in the middle of the night for a work thing and returning to sleep). If I happen to charge the phone during the day the house shouldn't lock down inNight
mode.
I put this out there because I have a tendency (ok, more than a tendency) to overthink and over-complicate my rules as @toggledbits will confirm. This results in unnecessary demand on MSR as well as rules fighting with rules or duplicating outcomes.
-
@gwp1 said in Day mode implementation question:
It must be after wake-up times OR after sunset, whichever comes first
I suspect you mean 'Sunrise'?
C
-
In your "Day" ruleset for sunrise/sunset condition set the sunset condition to be a few minutes before sunset. This way both sunset conditions in "Day" and "Evening" won't go true at the same time. Alternatively you could also add a condition in the "Day" rule that the "Evening" rule must be
false
. This will make sure "Day" can't be true at the same time as "Evening". -
In your "Day" ruleset for sunrise/sunset condition set the sunset condition to be a few minutes before sunset. This way both sunset conditions in "Day" and "Evening" won't go true at the same time. Alternatively you could also add a condition in the "Day" rule that the "Evening" rule must be
false
. This will make sure "Day" can't be true at the same time as "Evening". -
@pabla Add a specific condition for
Evening
=false
or add it to this existing condition inDay
: -
@gwp1 On second thought I would just add the offset to the sunset time in the "Day" rule. Its less of a band-aid solution.
-
Yeaup that should do the trick, what basically was happening as you said was the sunset conditions in both Day and Evening were
true
at the same time therefore causing the both rules to betrue
as well.Now that you added the 1 mins before sunset, they won't overlap.
-
Yeaup that should do the trick, what basically was happening as you said was the sunset conditions in both Day and Evening were
true
at the same time therefore causing the both rules to betrue
as well.Now that you added the 1 mins before sunset, they won't overlap.
-
I don't known why you're all setting a mode like this, but I'm still using home/away/night to drive my rules, plus a lot of flags (dark, sleeping, holiday, party, mute, green mode, solar, rainy, windy, bad weather) to combine all them together and drive my reactions. I'm curious to understand why you prefer this approach.