Rule to enforce switch-on brightness level Fibaro RGBW

  • Platform information:
    • Hardware: raspberry pi
    • OS: openhabian
    • openHAB version: 3.2.0
  • Issue of the topic: Rule triggered unintentionally

I am struggling with creating a rule that appears to be a simple task.
I am using a Fibaro RGBW zwave controller in my hallway light, which is (amongst others) triggered by motion sensors (using BASIC Command 255).
What I’m trying here is to write a rule that is triggered every time the light goes on in order to then set a define brightness (depending on Day/Night).
But there’s some timing issue with my rule. When I turn OFF the light from a higher value (such as 80%), then the light goes out slowly and for some reasing during this period the rule is being triggered again, so the light is effectively on always…

rule "TagNacht dependent dimming of rgbw1"
when
        Item rgbw1_dimmer changed from 0
then
        logDebug("hallway.rules", "TagNacht dependent dimming of rgbw1")
        if (rgbw1_dimmer.state == 0) return;  // I appear to never enter here
        if (TagNacht.state == ON && rgbw1_dimmer.state != 80) rgbw1_dimmer.sendCommand(80)
        if (TagNacht.state == OFF && rgbw1_dimmer.state != 15) rgbw1_dimmer.sendCommand(15)
	myTimer3 = createTimer (now.plusMinutes(60), [|
           rgbw1_dimmer.sendCommand(OFF)
           myTimer3 = null
        ])
end

Many thanks for your hints on how to fix this :slight_smile:
Regards, Stefan

That’s a feature of your device.

Because your device reports it status periodically.
You openHAB Item gets set to 0 “prematurely” because you have got autoupdate enabled (by default). But then the real dimmer comes along and says “I’m not 0 (yet)”.
See “jitter” here -

If you look at your events.log, you will see the sequence.

Disabling autoupdate on your Item is a quick fix for commands from openHAB side - you didn’t say but I’m guessing the rule works fine if you control from outside of openHAB.

Otherwise, you’ll have to do something more elaborate, probably involving a brief timed lockout.

Super helpful. Thanks!