I'm not sure if this is a potential bug or a flaw in my logic (or understanding of the 'Off pending cancellation' logic). Here's my rule (no restrictions, so not showing that section):
The goal here is if I turn the Master Shower Mode switch on (it's a virtual switch), the bathroom lights and fan come on, and, the virtual switch itself is used in other automations to disable turning the lights/fan off when there's no motion in the bathroom.
The true case works perfectly, and the lights/fan stay on. The off case works as well - lights go off, fan stays on for 5 minutes, then shuts off. However, I put it in as 'Pending Off' because if the Master Shower Mode switch is turned on again, I would assume that changing the rule state to true counts as 'cancellation', and the fan should remain on for as long as the Master Shower Mode switch remains on.
However, that doesn't happen - when I turn that virtual switch back on right after turning it off, the original 5 minute timer to shutoff the fan keeps going, and the fan does indeed shut off after 5 minutes.
It probably should work, but I'm not seeing the whole picture. What turns the virtual switch on, Motion sensors in another rule? If you cancel the 5 minute off timer, the moment it becomes false again, it will start a countdown again and if nothing interrupts it by changing the rule to true and keeping it that way, the fan will turn off in 5 minutes. Bathrooms can be tricky to keep detecting motion.
You mention motion. Here's an example of what I use for my hallway light. As long as there's motion, it'll stay on, but as soon as the motion stops and the light is still on, then the timer counts down.
Thanks - the virtual switch is turned on via an Alexa Skill only. This is an 'override situation' whereby I want the rules for motion lighting suspended while the shower is in use (we tell Alexa to turn on Master Shower Mode before getting in).
I may have simply misunderstood that setting the state to TRUE again (by turning on the switch) was effectively a 'cancellation'. If that's not the case, I'll try to solve this some other way.
When you turn off the virtual switch a scheduled job should appear there (dont forget to refresh the web page). When you turn it back on, this job should disappear (refresh page ). If that is not happening, I would delete and recreate the rule because something wonky is going on.
Thanks for this - it definitely looks like once the rule state is set back to true with the virtual switch being turned back on before the 5 minute timer for rule state false ends, the previous scheduled job is not being cancelled. I honestly don't know whether this is works as intended behavior or not? @bravenel?
First bug found @bravenel.
I realized that for some rules I had to click continue the first time they were opened since the update. So I decided to run through all my rules to get it out of the way now. Some required the Continue click...others didnt.
Then I realized that some of my rules were being renamed to Rule2.5
Maybe not. I was just clicking Continue and then Done on the next page. If there's a way to break something...I will find it apparently. I'll take my time the rest of the way through.
When you click Continue, it does a page refresh. It's during that page refresh that the name gets updated (try pausing a rule and you'll see why the name got messed with). So if you hit Done too fast, it may not have updated the name, and you end up with Rule-2.5.