[SOLVED] restricting lights from a certain hour
-
@toggledbits Wouldn't be the first time I've over-complicated the thinking...
This is where I am now given 99% of the time NIGHT is invoked before midnight. My m-i-l always says "nothing good happens after 9pm"
-
Let us know how things go tomorrow morning and thereafter.
-
@librasun There was no joy in Muddville... and then I got to staring at the rule and realized, in setting it to
before 6:30
andbefore 7:30
we'd lost thenot between
aspect. -
The future is looking bright!
-
@gwp1 Welp, awoke this morning to... light. Really scratching my head here. Unless I'm misunderstanding how the
not between
works I'm stumped.I'll send @toggledbits a log snip for the ten minute window around this event.
-
I think I'd "widen" those time slots by another 30 minutes (i.e. 5-7am / 5-8am), and give it another day of testing. Something tells me it's too precise for now, still. Nothing else jumps out at me, but as you've already pinpointed, Logs are your friend as is watching the Rule's live status in RuleSets.
-
I disagree. Unless the controller is down at the moment, one minute would be sufficient widening to prevent a race condition. There's something more here than meets the eye.
@gwp1 if you're going to send logs, don't snip, send me the whole thing, and also send all rules involved (if you click on the rule name in the Rule Sets list, it shows you the rule ID under the conditions -- there's a JSON file in your reactor/storage/rules with that ID as its base name).
-
toggledbitswrote on Jun 10, 2021, 3:50 PM last edited by toggledbits Jun 10, 2021, 11:53 AM
Actually, before we go any further, look at this more carefully:
Let's say for the sake of argument that it's 4am. Your "not between" conditions are going to be true (4am is not between 5:30 and 7:30), so the condition is true, and that means your "exclusion" isn't.
For me, based on what I understand your intent to be, and working within the existing structure, you really want these to be after operators with the earliest time you're willing to accept the lights coming on.
-
gwp1replied to toggledbits on Jun 10, 2021, 5:02 PM last edited by gwp1 Jun 10, 2021, 1:05 PM
@toggledbits Hmmm... that's an interesting approach. Mode + After alarm time = lights allowed. Let me try that.
-
@gwp1 Sadness abounds. Lights this morning. I've emailed @toggledbits the logs he requested in full.
Of note: when I was originally creating this rule I noticed something with the
Weekday
andWeekend
"button/links"... when saved, the days chosen by using those were blank again. Only way I could save them visibly was by manually checking them. I should have filed a bug - work intervened and then it slipped my mind. Perhaps unrelated - perhaps not, if the choices aren't really saved. -
toggledbitswrote on Jun 11, 2021, 1:52 PM last edited by toggledbits Jun 11, 2021, 9:53 AM
The log shows that this rule set at 20:28 and ran the "Rainstorm Lights ON" reaction from its set reaction. It remained set until 22:55, when it reset and ran the "Rainstorm lights OFF" reaction from its reset reaction.
The rule remained reset for the remainder of the log. It did not set at 05:30 or any other time, it did not start its set reaction or the "Rainstorm Lights ON" reaction it references.
However, the "Rainstorm Lights ON" reaction was run by another reaction at 05:30. So you've got a mention of this somewhere. I can't easily tell which (I'd need a higher level of debug), but it is probably one of active objects (or something they start):
- Rule Notify: Mode Day ON<SET>
- Rule Notify: Mode Night ON<RESET>
- Rule Notify: Screened room door<RESET>
- Cooling All Modes but Night: ON<SET>
- Reaction Sunset light group on
-
gwp1replied to toggledbits on Jun 11, 2021, 3:09 PM last edited by gwp1 Jun 11, 2021, 11:09 AM
@toggledbits
"this rule set at 20:28 and ran the "Rainstorm Lights ON" reaction from its set reaction. It remained set until 22:55, when it reset and ran the "Rainstorm lights OFF" reaction from its reset reaction."Yes, makes sense as this rule gets included in the @sunset rule for those two lights it controls. That would be sunset (20:28 until sleep time 22:55).
Reaction Sunset light group on
contains the rest of the lights that come on at sunset, of which this is a subset.I'll look at what's happening at 05:30 (IIFC it's just a mode change ruleset).
Rule Notify: Mode Day ON<SET>
This is the 05:30 mode change
Rule Notify: Mode Night ON<RESET>
I would gather this is Night Mode ON deactivating
Rule Notify: Screened room door<RESET>
This is the screened room door sensor alert being turned off after Night mode is deactivated
Cooling All Modes but Night: ON<SET>
This is HVAC switching from Night Mode to everything else with the mode change. -
@gwp1 "However, the "Rainstorm Lights ON" reaction was run by another reaction at 05:30."
Wouldn't it be triggered because of the mode change? Mode (either day or evening) is a trigger for
Rainstorm lights ON
- but having the time restriction should stop it from turning on those lights, no? -
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.
-
gwp1replied to toggledbits on Jun 11, 2021, 9:59 PM last edited by gwp1 Jun 11, 2021, 6:02 PM
@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.
-
gwp1replied to LibraSun on Jun 12, 2021, 12:11 AM last edited by gwp1 Jun 11, 2021, 8:18 PM
@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.
19/42