Thanks for the screenshot! So, a regular "Rule" like you have in Rule Machine works by evaluating the "Define Rule" section when any of the conditions ("Select Conditions") changes. Since your condition is the motion sensor being active, it will evaluate your rule every time that changes. "Actions for True" will run every time motion starts (i.e., if the evaluation of the rule changes to true, meaning the motion sensor changes to active), and "Actions for False" will run every time motion stops.
Right now, you only have "Actions for True," so nothing will happen when motion stops. Additionally, the "Actions for True" section might not do what you expect. I'm not sure what your IF/THEN is trying to accomplish, but it looks like you might be trying to detect if the light is currently on. In that case, you want to look at the switch
attribute and not the level
attribute (long story short is that these are separate and most dimmable devices remember their level
attribute if turned off by an off()
command; setLevel(0)
will effectively turn most/all dimmable devices off, but turning something off does not necesarrily, if ever, set the level to 0
). So your rule will currently turn the bulb off when motion is detected (surely that's not what you want?) but only if it was previously turned off by way of dimming to 0 but probably not if it was turned off by a direct off()
command (also not likely what you want). Otherwise, it will turn the bulb on to 100% (might be close to what you want?).
If you just want the light to turn on and off based on motion with or without a delay, I'd suggest using Motion Lighting instead of Rule Machine. Like Rule Machine, it's a built-in app, but unlike Rule Machine, configuration with that app is quite easy since it was designed for, among a few similar cases, this exact purpose. Otherwise, if you could clarify what exactly you want the rule to do, someone could help figure it out. If you want the bulb to turn on to 100% when motion is detected, you can just leave the "set level to 100%" (and only that) in "Actions for True." If you want the bulb to turn on to 100% when motion is detected only if the bulb isn't already on, one way to do that would be to put "IF Bulb1 switch is off THEN set level to 100%" there instead. Then, in "Actions for False," you probably want "Turn Bulb1 off," or that with a "Delay X minutes" before it if you want that (with "Cancel on truth change" selected so this section will stop executing if motion is detected again during this wait).
I can be more specific about these suggestions if you want, otherwise hopefully this helps point you in the right direction! Again, reducing the time between active/inactive events on the sensor both isn't possible (very few, if any, Zigbee sensors let you configure this) but also wouldn't fix the problem since that lies in the way the rule logic was set up.