I have the following rule:
When Open Close 1 opens ...
Turn on Front Entry Wall Switch 1
Wait until elapsed time of 10 minutes has passed, then ...
Turn off Front Entry Wall Switch 1
Rule and pending actions can run ...
Only between Sunset and Sunrise
What it's supposed to do:
When a door is opened, it turns on the front light, but only between the hours of sunset and sunrise. Leave the light on for 10 minutes, then turn it off.
It works flawlessly EXCEPT if the door is opened just after sunrise, AND before the 10 minutes have elapsed.
Let's say sunrise is at 7:30. If I open the door between 7:30 and 7:40, the light never turns back off.
If I open the door any other time, it works fine, but not between the 10 minute window between sunrise and sunrise + 10 minutes.
Any thoughts, or is this a Basic Rule bug?
This is a normal discovery you've made about Restrictions -- they don't handle the case like yours where the Restriction kicks in (or ends) while a rule is waiting to turn off some lights. This isn't a bug, but rather a shortcoming of Restrictions in general. If you import this Basic Rule into Rule Machine, the Restriction will be transformed into a Required Expression, and the rule will still turn off the lights as you expect.
1 Like
Thank you. How do I import the rule into the rule machine? I installed Rule Machine, but don't see an option to import a Basic Rules rule.
How about using two rules?
One for motion to turn it on, and one for lack of motion for 10 minutes to turn it off?
With the same sunset to sunrise restriction for both.
(I have a sense of deja vu.)
Is Basic Rules the same as Simple Automation?
I've always been a simple guy.
I wonder why Basic Rules didn't show up as an option for me?
Is it because I have none.
Or, am I using an old RM?
Thanks. Although I'm not sure that works either? Let's say Sunrise is 7:30 and the rule fires at 7:39, the light would never turn off.
I could remove the sunrise / sunset restriction for turning off, but then it would fire all day long.
How could you import something you don't have?
4 Likes
RM is quite knowledgeable. 
No, with a Required Expression, as long as you don't select the "Cancel pending actions" option for the Required Expression, the other actions in the rule will still run. So it will turn on at 7: 30, Required Expression would become false at 7:39, but at 7:40 the wait will finish and the light will turn off.
No love anymore for the two rule concept?
Or wouldn't it work in this case?
Gotcha. Thanks. How I do import a rule into the rules machine from basic rules? (Not seeing an option).
I might have had that question answered.
You might need a basic rule to start with.
I have a bunch of basic rules already (that’s what my initial question was about).
Have you installed the "Rule Machine" app?
When you click open Rule Machine, do you see something similar to what Bruce posted above?
You should (since you have some Basic Rules already), but if not, I'm not sure why... I don't use anything but RM, so I don't ever see any of those options.
Two rules could be a possible solution for this; one for on (with restrictions) and one for off (without restrictions). But, this would actually be sort of tricky to do with Basic Rules (I'll leave it to you to figure out why).
Except for the fact that he's having trouble finding how to import the Basic Rule, importing it to RM would be the simplest path from where he was to what he wants to have happen.
I'm not touching that app with a 10' pole.
I will remain true to my simple roots. 