RM rule A turns on a light when the Lux/Illuminance reports under 4, waits for the Lux/Illuminance to report over 4 for at least 2 minutes, then turns the light off.
RM rule B turns this light on at y time every day and it stays on (turned off much later when RM rule C is triggered)
The problem occurs when:
Illuminance decreases so RM rule A triggers the light on
The light is still on when RM rule B triggers, so it is not turned on by rule B
Illuminance increases so the second half of RM rule A triggers the light off.
Somehow I need to revise RM rule A so that if RM rule B runs after RM rule A has turned the light on, the rule will suspend...and not turn the light off...
This is RM rule A - suggestions on how to revise appreciated. Device names & exact times masked
THANKS!
That sounds like exactly the solution.
Was not familiar with either Cancel or the ability to reference Rule A inside Rule B, so I searched the forum, found an example of Cancel and implemented.
It should definitely help. The other thing that would help is using a Required Expression with Rule A that the light must be off for Rule A to run. Having that expression means that Rule A will only run once until it completes the actions or gets cancelled by Rule B. When Rule B cancels Rule A, Rule A will not run again until the light is turned off by Rule C (and in between the times in the conditional trigger of Rule A).
Rule B turns the light on at Sunset - t. The point of Rule B is to turn a light on daily when it gets dark out.
Rule A only runs if the time is prior to Sunset -t, and can't run again unless it is after Sunrise + t. The point of Rule A is to turn the light on during the day if it is extremely overcast and dark outside to make it very dark inside. It rarely triggers.
The problem is when Rule A is in the middle of running ie it's first part turns on the light due to low illuminance when the time was prior to Sunset -t. Then the time hit Sunset -t, so Rule B tried to run, but the light was already on. Rule A is still in Wait until it is bright and turn off mode, and sometimes just prior to full sunset it gets really bright, and Rule A turns off the light. I think cancelling Rule A every time Rule B runs is going to solve this. Somehow, I had not realized there was a cancel command! I'll have to pay closer attention to the options as I'm writing rules to increase my understanding of the possibilities! Problem is, I'm running out of things to automate...
This goes a little bit to Bruce’s point about showing everything. The other way to do this has nothing to do with Rule B as everything can be done in Rule A by itself. Move the conditional trigger to a Required Expression in Rule A. Then select Cancel Pending Actions if Required Expression is false. This would cancel the Wait in Rule A and leave Rule B alone.
Interesting. If the current fix of adding cancelling Rule A wait as a first action in Rule B does not work I'll try it.
Will probably need to wait quite some time to know whether the fix works; Rule A rarely runs - maybe 15-20 times per year, and even more rarely does it's wait overlap with Rule B