I am trying to port my old rules on my C4 to using the new rule machine. This example is causing the light to operated, BUT after a few seconds the light goes off. Log says Delay Over: Off: OFC Light. The time this happens varies from a few seconds to after a minute or so as the motion trips from being in the room.
What is wrong with this rule please?
I believe the delay is.not for the off but for the entire operation
When I added the action light off, I made it delayed in the action. Is this action put in the wrong place. Should it go after the END-IF? Is that the problem?
You never said what you want the rule to actually do. That would get you the best help.
As is, you're scheduling that delayed "off" action for 15 minutes after the action is reached, so basically any time motion become active in that mode. Nothing willing cancel this delay, whether it's motion becoming inactive (not accounted for in your rule at all, though often what people want) nor motion becoming active again (often something people want to reset the timer in such a case, but delays do not get canceled on their own).
I believe the Off action location is okay but I think the problem is that the off is cancelable but it's not being canceled so your probably stacking up offs and they appear to be happening at random times.
I would make Mode in [Day, Evening, Night] a Required Expression.
I would delete the IF-THEN and END-IF actions. Since OFC Occupancy motion active is the trigger you don't need to check for that condition and the Req Exp will handle the D, E, N modes.
I would add a Cancel Delayed Actions before the Dimmers per mode.
First, the if condition is not required in your example. The rule is triggered by motion in the zone, so it will always be true. Dimmers per mode will only be valid for the selected modes, so there is no need to check this in an if condition.
Second, instead of the “Off: … —> delayed…”, add the following commands:
Wait for event: Zone 085 - OFC Occupancy motion inactive duration—> X minutes
Off: OFC Light
With this change, the light will turn off X minutes after no motion is detected. It is good to add duration with motion sensors since they may detect no motion when someone is in the room, but just not moving…
@Sebastien . I changed the rule as you suggested. Now everytime motion is tripped, the light turns on, then off quickly.
Log shows,
app:33592023-07-18 10:00:18.327 AMinfoAction: Off: OFC Light
app:33592023-07-18 10:00:18.280 AMinfoWait over: Zone 085 - OFC Occupancy motion inactive
app:33592023-07-18 10:00:18.274 AMinfoWait Event: Zone 085 - OFC Occupancy motion inactive
app:33592023-07-18 10:00:11.030 AMinfoAction: Wait for event: Zone 085 - OFC Occupancy motion inactive --> timeout: 0:15:00
app:33592023-07-18 10:00:11.000 AMinfoAction: Dimmers per mode: OFC Light Day: 20 Evening: 50 Night: 25
app:33592023-07-18 10:00:10.977 AMinfoEvent: Zone 085 - OFC Occupancy motion active
I just changed the wait action to,
![]()
So far light stays on. Still testing that it times out correct.
i use the older motion lighting. for similar rule..
it automatically does the "stays that way" ie as long as motion sensor is still active it doesnt start the delay.
Alrighty then! Using that "stays that way" correction has appeared to work. No on/off drama during the 15 minute timeout.
Then the rule triggered again when I came back, and it turned on the light again as expected.
Going to have to revamp all my motion light rules now.
Thanks for the help.
Glad it works!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.


