Dim light when no movement

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!

There are multiple ways to achieve this. What I would do is a RM rule:

I assume that when illuminance is >100lm, nothing should occur.

Required Expression: Illuminance <=100lm
Trigger: Motion
Actions:
Dim to 100%
Wait for event: No Motion —> Duration: 2 minutes
Dim to 25%

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?

Ah yes, a second rule is required to have the light turn on and off based on illuminance.

Trigger: Illuminance <=100lm
Actions:
Dim Light to 25%
Wait for event: Illuminance >100lm
Off: Light

That's got it! Thanks @Sebastien.

1 Like

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?

Exactly.

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?

That could indeed work! Give it a try to see.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.