[Resolved] Day mode implementation question
-
@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.
-
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.
@therealdb My house modes are simple: Night/Home/Away/Vacation. All them are configured very simply, based on if the alarm is turned on (either stay or away) and who's home. That way there is no accidental/unexpected mode changes
-
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.
@therealdb said in Day mode implementation question:
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.
This is exactly what I'm driving at. I use
Mode
followed by a number of what I call "shared rules" (Wake-up times, cloudy day, temp < 40º, presence, etc.) that can be/are referenced in many other rulesets. Where I'm hitting my wall is the actual triggering of the modes (Day, Away, Evening, Night).My curiosity is around how you're actually triggering the modes themselves. The rest... I've got that nailed down.
-
@therealdb My house modes are simple: Night/Home/Away/Vacation. All them are configured very simply, based on if the alarm is turned on (either stay or away) and who's home. That way there is no accidental/unexpected mode changes
-
@therealdb said in Day mode implementation question:
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.
This is exactly what I'm driving at. I use
Mode
followed by a number of what I call "shared rules" (Wake-up times, cloudy day, temp < 40º, presence, etc.) that can be/are referenced in many other rulesets. Where I'm hitting my wall is the actual triggering of the modes (Day, Away, Evening, Night).My curiosity is around how you're actually triggering the modes themselves. The rest... I've got that nailed down.