I'm trying to get my head around how to create a rule that turns on my outdoor light and sets the dimmer to 25% when an external light sensor reports <= 100lm and turns off when the sensor reports > 100lm. Basic "on when it's dark, off when it's light" which I can get working with no problem.
The bit I'm having trouble with is that I want to set the light dimmer to 100% during this time if motion is detected on my outdoor PIR, keep it at 100% for 2 minutes then dim it back down to 25% after.
Can someone help me work out the best way to achieve this?
Thanks @Sebastien. That seems to be doing the job once motion is detected but the rule seems to need motion to run. I guess I need another trigger in place so the light comes on at 25% when the level sensor is <=100lm without any motion detected?
Just trying to learn Rule Machine, so wondering if there is a benefit to have the above being two separate rules? Would it work to have one rule?
trigger = Illuminance <-100lm,
conditional action of if motion = active, dim light to 100%, wait for event: No motion duration of 2 minutes, dim to 25%
else dim light to 25%
End-If
Looks good as is, though if you want the light to go back to 100% next time there is motion, you may want another rule:
Required Expression: Illuminance <-100lm
Trigger: Motion = active
Actions:
Dim light to 100%
Wait for event: No motion duration of 2 minutes
Dim light to 25%
OK, I think I get it - is this because rule will only execute on a trigger and not a condition?
So you would still need two rules, one to turn it on/off at illuminance change, and another to dim it up / down at motion change?
OK. Thank you.
I notice in rule machine you can enter two trigger events, in the format of A OR B.
In the above example, could this be done in one rule by entering both illuminance change and motion change as trigger events?