Migrating from ST and trying to wrap my head around rule machine. I have two rule sets that I have questions on...
Using RM I have two rules for my front door lights. One turns them on randomly 15 mins after Sunset and the other turns them off randomly 30 mins after 9pm. Is there a way to do this as one rule? or is the better method to do it as two rules.
The second rule set has one rule for a closet that turns on/off on contact sensor. The other rule turns it off if the door is left open for x minutes. Again is there a way to do this as one rule or better of as two?
I think I figured out the closet rule... can't post an image, but I have the following setup:
Conditions: Master Closet Door open
Define Rule: Master Closet Door open
Select Actions for True
On: Master Closet
Pending Off: Master Closet: 10 minutes
Select Actions for False
Off: Master Closet
My Front Door Rule, still stuck on if this is the best way to do it:
Turn on Rule:
Selected Trigger Events: When time is Sunset
Selected Actions:
Delay by 15 minutes [Random]
Dim: Front Door: 40
Color Temperature: Front Door: 2700
Turn off Rule:
Select Trigger Events: When time is 9:00 PM
Selected Actions:
Delay by 30 minutes [Random]
Off: Front Door
It is good practice to leave the pending cancel in because you don't want it turn turn the light off you close, and open a couple times. Then you might get the light turning off while the door is open. I assume you want to turn the light on while the door is open but only for a max of 10 minutes, correct? You don't want it on forever if you leave the front door open, correct?
There are two different rules, I probably should have made two posts.
The first is for the closet where it should turn on when opened and turn off when closed and then turn off if left open for 10 mins. I do think I am missing something here where if I turn the light on and the door is already open I only want the light to stay on for 10 mins.
The second rule is for the front door light, that one seems to be working great now!
Here is a rule for a cupboard under the stairs.
If the door is not fully closed it will turn off after 20 minutes or straight away if the door is fully closed.
I think I am missing something. If the door is open and the light is off and I turn it on and the door stays open the light stays on and does not turn off.
Because you didn't say that. You never said you wanted the light being as a condition of turning it off. You said, if the door is open, turn the light on and turn it off after 10 mins or if the door is closed. If you also want the light to turn off after 10 mins when turned on and the door open, then you need to break this down into 2 rules. The first would be a "Trigger". Door open, light on. The second would be a rule and the conditions would be Light on and Door open and the actions for true would be a 10 min delay with cancel on truth change and turning the light off. The action for false would be turning the light off as well with no cancel.