[SOLVED] restricting lights from a certain hour
-
No, it looks like something else, not the rule we've been looking at, is running that reaction. The rule never went true/set after 22:55
@toggledbits
Rule ID: rule-198
should runRainstorm Lights ON
reactions plusSunset Light group ON
reaction together to equal turning on all necessary lighting at sunset. -
Something ran "Rainstorm Lights ON" at 05:30. It was likely one of the rules or the reaction I listed above, as those were active at the time. The rule "Rainstorm: on, off with UV" was not active at this time, so it did not run it.
-
Something ran "Rainstorm Lights ON" at 05:30. It was likely one of the rules or the reaction I listed above, as those were active at the time. The rule "Rainstorm: on, off with UV" was not active at this time, so it did not run it.
@toggledbits Rule Notify: Mode Day ON<SET> This is the 05:30 mode change and the mode change is a condition for the running of
Rainstorm Lights ON
- but shouldn't/wouldn't the conditions aroundnot before <xx time>
belay that order? (That was my intent, anyway.)Would moving the time conditions to
Constraints
be a better approach? -
I hope what I'm about to mention applies to your situation... running Rule B's SET (or RESET) reaction from Rule A:
- Does NOT cause Rule B to show as "Set"
- Does NOT leave a lasting trace in the Status page
- Does NOT change the "Last set" timestamp on Rule B
...is therefore sometimes a real challenge to catch in the act, much less diagnose, without lots of Log-intensive scrutiny.
These are the reasons I requested some features along those lines, to help "see" what's happening.
-
I hope what I'm about to mention applies to your situation... running Rule B's SET (or RESET) reaction from Rule A:
- Does NOT cause Rule B to show as "Set"
- Does NOT leave a lasting trace in the Status page
- Does NOT change the "Last set" timestamp on Rule B
...is therefore sometimes a real challenge to catch in the act, much less diagnose, without lots of Log-intensive scrutiny.
These are the reasons I requested some features along those lines, to help "see" what's happening.
@librasun
I'm going to temporarily divorce the @sunset rule from the Rainstorm rule just to see what happens come morning.Moved the day/time/weekday conditions toConstraints
first. At least then I can rule that out.Might be harder to track tomorrow depending on how bright it is at 07:30.
I'm wondering if I'm falling into the pit of trying to "make a truth truthier" when it comes to the triggers.
-
@librasun
I'm going to temporarily divorce the @sunset rule from the Rainstorm rule just to see what happens come morning.Moved the day/time/weekday conditions toConstraints
first. At least then I can rule that out.Might be harder to track tomorrow depending on how bright it is at 07:30.
I'm wondering if I'm falling into the pit of trying to "make a truth truthier" when it comes to the triggers.
@gwp1 No change, lights still came on at 05:30. I did roll over and grab my phone, load up the MSR UI and manually trigger the ruleset only to have it turn the lights back off. Before retriggering, I looked at the status of the ruleset and it met everything it was supposed to - the lights were just still on (having come on when they really shouldn't have.)
Trying to rethink how to write this to get to the goal.
-
@gwp1 before you change anything, do this: archive your entire "storage" subdirectory (ZIP) and send it to me.
-
@gwp1 before you change anything, do this: archive your entire "storage" subdirectory (ZIP) and send it to me.
@toggledbits Done.
-
The rule "Sunset Lights: On" is the one that triggered at 05:30 and ran the "Rainstorm Lights ON" reaction. It did that because "Day" is an acceptable mode in its first condition (but "Night" is not listed and so this condition was false before), and at the moment apparently 05:30 is before sunrise, so the second condition was also met.
-
The rule "Sunset Lights: On" is the one that triggered at 05:30 and ran the "Rainstorm Lights ON" reaction. It did that because "Day" is an acceptable mode in its first condition (but "Night" is not listed and so this condition was false before), and at the moment apparently 05:30 is before sunrise, so the second condition was also met.
@toggledbits Talking this thru...
Ruleset "Sunset Lights: On" should have run at sunset 20:29 (local sunset time on Friday 06/11/2021). It should include two Reactions, "Sunset Light Group On" and "Rainstorm Lights On" (done this way to prevent race condition/overlap if the same lamps were included in both reactions as well as prevent a gap at sunset when I'd have to turn off "Rainstorm Lights: On" lamps one minute before sunset kicks in.) I don't know why "Sunset Lights: On" would have run at 05:30 as it shouldn't be driven by mode but only by
sunset/sunrise
.Day would be an acceptable mode for ruleset "Rainstorm Lights: On" because, well, that's basically the point - we need these lights during the day as a storm has made it very dark during non-traditional times. I would expect "Rainstorm Lights: On" to run at 05:30 when mode switches to Day - but that's the reason for the
after <time>
conditions/constraints - to prevent it from taking action until after those time stops.EDIT: Ok, looking harder at that last half a sentence you wrote: "05:30 is before sunrise so the second condition was also met" - that would explain why "Sunset Lights: On" ran which would explain why Reaction "Rainstorm Lights On" ran. Since that reaction doesn't have the constraints, it seems that's overriding the ruleset "Rainstorm Lights: On" ?
-
@toggledbits Talking this thru...
Ruleset "Sunset Lights: On" should have run at sunset 20:29 (local sunset time on Friday 06/11/2021). It should include two Reactions, "Sunset Light Group On" and "Rainstorm Lights On" (done this way to prevent race condition/overlap if the same lamps were included in both reactions as well as prevent a gap at sunset when I'd have to turn off "Rainstorm Lights: On" lamps one minute before sunset kicks in.) I don't know why "Sunset Lights: On" would have run at 05:30 as it shouldn't be driven by mode but only by
sunset/sunrise
.Day would be an acceptable mode for ruleset "Rainstorm Lights: On" because, well, that's basically the point - we need these lights during the day as a storm has made it very dark during non-traditional times. I would expect "Rainstorm Lights: On" to run at 05:30 when mode switches to Day - but that's the reason for the
after <time>
conditions/constraints - to prevent it from taking action until after those time stops.EDIT: Ok, looking harder at that last half a sentence you wrote: "05:30 is before sunrise so the second condition was also met" - that would explain why "Sunset Lights: On" ran which would explain why Reaction "Rainstorm Lights On" ran. Since that reaction doesn't have the constraints, it seems that's overriding the ruleset "Rainstorm Lights: On" ?
@gwp1 Thinking further...
Removing the Reaction "Rainstorm Lights On" from this ruleset of "Sunset Lights: On" because it's redundant - let ruleset "Rainstorm Lights: On" handle the heavy lifting all on it's own.
You can reference the ruleset from earlier images, this is the
Set Reaction
Reset Reaction
to that ruleset.
-
@toggledbits Talking this thru...
Ruleset "Sunset Lights: On" should have run at sunset 20:29 (local sunset time on Friday 06/11/2021). It should include two Reactions, "Sunset Light Group On" and "Rainstorm Lights On" (done this way to prevent race condition/overlap if the same lamps were included in both reactions as well as prevent a gap at sunset when I'd have to turn off "Rainstorm Lights: On" lamps one minute before sunset kicks in.) I don't know why "Sunset Lights: On" would have run at 05:30 as it shouldn't be driven by mode but only by
sunset/sunrise
.Day would be an acceptable mode for ruleset "Rainstorm Lights: On" because, well, that's basically the point - we need these lights during the day as a storm has made it very dark during non-traditional times. I would expect "Rainstorm Lights: On" to run at 05:30 when mode switches to Day - but that's the reason for the
after <time>
conditions/constraints - to prevent it from taking action until after those time stops.EDIT: Ok, looking harder at that last half a sentence you wrote: "05:30 is before sunrise so the second condition was also met" - that would explain why "Sunset Lights: On" ran which would explain why Reaction "Rainstorm Lights On" ran. Since that reaction doesn't have the constraints, it seems that's overriding the ruleset "Rainstorm Lights: On" ?
@gwp1 said in restricting lights from a certain hour:
Since that reaction doesn't have the constraints, it seems that's overriding the ruleset "Rainstorm Lights: On" ?
You're mixing rules with global reactions. Global reactions are not bound by any rule. If you tell a global reaction to run, it runs. The fact that some rule may run it and at some specific time the rule would not run it is not a factor. The global reaction doesn't even know that rule exists. It's a one-way connection (rule -> global reaction); there is no connection the other way.
-
@gwp1 said in restricting lights from a certain hour:
Since that reaction doesn't have the constraints, it seems that's overriding the ruleset "Rainstorm Lights: On" ?
You're mixing rules with global reactions. Global reactions are not bound by any rule. If you tell a global reaction to run, it runs. The fact that some rule may run it and at some specific time the rule would not run it is not a factor. The global reaction doesn't even know that rule exists. It's a one-way connection (rule -> global reaction); there is no connection the other way.
@toggledbits This actually supports what I'm thinking happens here, then.
The ruleset has
Constraints
but, because the Reaction doesn't know of it, it's riding right over those constraints.This makes me feel even more confident that removing the call to the Reaction will resolve this issue. The ruleset "Rainstorm Lights: On" has the conditions and constraints necessary to correctly call for reaction "Rainstorm Lights On" - there's no need for ruleset "Sunset Lights: On" to ALSO call the Reaction - it's covered already.
-
@toggledbits This actually supports what I'm thinking happens here, then.
The ruleset has
Constraints
but, because the Reaction doesn't know of it, it's riding right over those constraints.This makes me feel even more confident that removing the call to the Reaction will resolve this issue. The ruleset "Rainstorm Lights: On" has the conditions and constraints necessary to correctly call for reaction "Rainstorm Lights On" - there's no need for ruleset "Sunset Lights: On" to ALSO call the Reaction - it's covered already.
@gwp1 Ok, bear with me: unsure if this ran correctly as now I saw the "Sunset Lights: On" trigger all lights because it was not yet sunrise but it was after 05:30 which is when DAY mode returns. As Sunset Lights: On runs during Day or Evening modes, it is correct (as currently configured) to act this way.
Doing some housecleaning on rulesets as I fear I may have a few that are duplicating efforts and a couple that need some Constraints.
-
The task of curating one's Rules is never quite done, I find. I visit them every day to tend to them like delicate violets.
-
Comments are vital! I include them both as
Comment
entries within the Rule body, as well as#comments
at the end of a line within an Expression. Example:AddOne := a = 0, #start at zero b = a + 1 #add one
@librasun @toggledbits I am delighted to say there were no lights between 05:30 and 06:30 (as planned) this morning.
Review:
-
Removed duplicate
Set Reaction
from ruleset "Sunset Lights: On" - this was already called elsewhere and was overriding the "Rainstorm Lights: On" ruleset. -
Removed
Day
as a considered mode from "Sunset Lights: On" as they're going on at sunset and Day mode ends then. It makesDay
a mode that should never trigger - but it was at 05:30 incorrectly as that's when Day mode restores. -
Returned the
weekend
andweekday
exclusions to theConditions
fromConstraints
set asafter
the appropriate alarm clock times.
My thanks to both of you - I really appreciate your feedback and guidance here!
-
-
T toggledbits locked this topic on