Problem with Philips Hue Dimmer Switch

  • Platform information:
    • Hardware: Raspberry Pi 4B (ARM64) / 4G RAM
    • OS: CentOS 8 (64-bits)
    • OpenHAB 3.3.0
    • Java Version: OpenJDK 64-Bit Server VM 18.9 (build 11.0.15+10-LTS)

I started having an issue with my switch. It seems like the frequency of the problem increased during a short span of time from none to all the time.
Problem: Pressing any of the buttons doesn’t trigger any of the rules that had been working since I configured the switch more than 6 months ago.

The switch was initially added to the Hue app but not configured there. The Thing was added through the Main UI but the Items through file configuration and the rules with DSL.
I’m not sure if the problem started after I upgraded OH to 3.3 from 3.2.

When I press a button and look at the Hue app, the button pressed is recognized, so the switch works. However, the rules don’t get triggered on OH.
I set the log to DEBUG mode:

openhab> log:set DEBUG org.openhab.binding.hue

But nothing is displayed when I press any of the buttons.

Actions taken:

  1. I soft reset the switch by pressing the 4 buttons until the led blinked red. No change.
  2. I deleted the accessory from the Hue app and the Things, and added it back. I reconfigured the Items and Rules with the new sensor ID. No change.

Here is the configuration.
Items:

DateTime    CMN_Switch_Dimmer_1_LastUpdated     "Main Dimmer Switch Last updated"                                       {channel="hue:0820:0017884eXXXX:81:last_updated"}
Number      CMN_Switch_Dimmer_1_BatteryLevel    "Main Dimmer Switch Battery level" (group_Batteries) ["Status"]         {channel="hue:0820:0017884eXXXX:81:battery_level"}
Switch      CMN_Switch_Dimmer_1_BatteryLow      "Main Dimmer Switch Low battery"                     ["LowBattery"]     {channel="hue:0820:0017884eXXXX:81:battery_low"}
Number      CMN_Switch_Dimmer_1_DimmerSwitch    "Main Dimmer Switch state"                                              {channel="hue:0820:0017884eXXXX:81:dimmer_switch"}

Rule example:

rule "Main Dimmer Button 1 Short Pressed"
when
    Channel "hue:0820:0017884eXXXX:81:dimmer_switch_event" triggered 1002.0
then
    logDebug(logName, "Starting execution of Dimmer Button 1 short pressed.")
    if (group_LR_Lamp_Switch.state == OFF) {
        group_LR_Lamp_Switch.sendCommand(ON)
    } else if (group_LR_Lamp_Switch.state == ON) {
        group_LR_Lamp_Switch.sendCommand(OFF)
    }
   logDebug(logName, "Ending execution of Dimmer Button 1 short pressed.")
end

Any idea?

If you do not see any debug message please restart openhab service after changing the log level

My bad, I meant to say that I don’t see anything in the logs generated by the action of pressing the buttons on the switch.
The log displayed when the new Thing was added to the Inbox and even the added Thing became online, but nothing when pressing the buttons.
Other Hue-related events are displayed in the log.

Same issue here, everything was working fine up until 2~3 weeks ago. Now I have to press the button up to 4 times before the press is taken into account.

I restarted OpenHab, my bridges and my router, it was working again for ~1 week, then it started bot responding again.

Triggering the events from any other source (UI, philips hue motion sensors, etc) is working just fine. Lights are responsive. The only thing that doesn’t seems to work well are the wall switches.

That’s right. I only have one dimmer switch, but I have 3 sensors and 4 lights that work normally.
I wonder if there is any issue with the binding.

It seems like it come from the trigger channel (dimmer_switch_event), the state channel (dimmer_switch) seems to work fine.

Replacing “Channel XXXX triggered” by “Item XXXX received update” and using newState instead of receivedEvent in my scripts seems to work for now, I tested it during my lunch break, will see if the problem appear again despite this.

Great idea, @Argurth, it worked like a charm! I hadn’t realized there was an item with the state.

Unfortunately, I have to report that the switch started having problems again :frowning:

The Thing is still reported as Online. The Hue app is reporting the button pressed. However, the rules stopped working:

//Hue Dimmer Switch Rules
rule "Main Dimmer Button Pressed"
when
    Item CMN_Switch_Dimmer_1_DimmerSwitch received command
then
        logDebug(logName, "Dimmer Switch Button pressed.")
        logDebug(logName, "Dimmer Switch Button pressed: " + CMN_Switch_Dimmer_1_DimmerSwitch.state.toString)
    if (CMN_Switch_Dimmer_1_DimmerSwitch.state.toString == "1002.0") {
        logDebug(logName, "Starting execution of Dimmer Button 1 short pressed.")
        if (group_LR_Lamp_Switch.state == OFF) {
            group_LR_Lamp_Switch.sendCommand(ON)
        } else if (group_LR_Lamp_Switch.state == ON) {
            group_LR_Lamp_Switch.sendCommand(OFF)
        }
        logDebug(logName, "Ending execution of Dimmer Button 1 short pressed.")
    } else if (CMN_Switch_Dimmer_1_DimmerSwitch.state.toString == "1000.0") {
        logDebug(logName, "Starting execution of Dimmer Button 1 initial pressed.")
        logDebug(logName, "Ending execution of Dimmer Button 1 initial pressed.")
    } else if (CMN_Switch_Dimmer_1_DimmerSwitch.state.toString == "1001.0") {
        logDebug(logName, "Starting execution of Dimmer Button 1 hold.")
        logDebug(logName, "Ending execution of Dimmer Button 1 hold.")
    } else if (CMN_Switch_Dimmer_1_DimmerSwitch.state.toString == "1003.0") {
        logDebug(logName, "Starting execution of Dimmer Button 1 long pressed.")
        if (LR2_Light_Switch.state == OFF) {
            LR2_Light_Switch.sendCommand(ON)
        } else {
            LR2_Light_Switch.sendCommand(OFF)
        }
        logDebug(logName, "Ending execution of Dimmer Button 1 long pressed.")
    } else if (CMN_Switch_Dimmer_1_DimmerSwitch.state.toString == "2002.0") {
        logDebug(logName, "Starting execution of Dimmer Button 2 short pressed.")
        if (KT_Light_Switch.state == OFF) {
        KT_Light_Switch.sendCommand(ON)
        } else if (KT_Light_Switch.state == ON) {
        KT_Light_Switch.sendCommand(OFF)
        }
        logDebug(logName, "execution of Dimmer Button 2 short pressed.")
    } else if (CMN_Switch_Dimmer_1_DimmerSwitch.state.toString == "2003.0") {
        logDebug(logName, "Starting execution of Dimmer Button 2 long pressed.")
        logDebug(logName, "Ending execution of Dimmer Button 2 long pressed.")
    } else if (CMN_Switch_Dimmer_1_DimmerSwitch.state.toString == "3002.0") {
        logDebug(logName, "Starting execution of Dimmer Button 3 short pressed.")
        logDebug(logName, "execution of Dimmer Button 3 short pressed.")
    } else if (CMN_Switch_Dimmer_1_DimmerSwitch.state.toString == "3003.0") {
        logDebug(logName, "Starting execution of Dimmer Button 3 long pressed.")
        logDebug(logName, "Ending execution of Dimmer Button 3 long pressed.")
    } else if (CMN_Switch_Dimmer_1_DimmerSwitch.state.toString == "4002.0") {
        logDebug(logName, "Starting execution of Dimmer Button 4 short pressed.")
        if (Override_Home_Away.state == OFF) {
            if (Override_Sleep_Mode.state == OFF) {
                Override_Sleep_Mode.sendCommand(ON)
            } else {
                Override_Sleep_Mode.sendCommand(OFF)
            }
        }
        logDebug(logName, "Ending execution of Dimmer Button 4 short pressed.")
    } else if (CMN_Switch_Dimmer_1_DimmerSwitch.state.toString == "4003.0") {
        logDebug(logName, "Starting execution of Dimmer Button 4 long pressed.")
        if (Override_Home_Away.state == OFF) {
            Override_Home_Away.sendCommand(ON)
        } else {
            Override_Home_Away.sendCommand(OFF)
        }
        logDebug(logName, "execution of Dimmer Button 4 long pressed.")
    }
end

No actions related to the switch are reported on the Karaf Console when setting the rule or binding to DEBUG mode.

Should we report this as a bug? It seems like the switch works fine outside OH.

Has that ever worked? Bindings do not usually issue commands to Items (although it would be a sensible action in the case of button presses)

You just made me realize that @Argurth mentioned “update”. I will change my rule, although it worked with “command” for a while. Besides, my Hue light rules have worked with “received command” flawlessly for years.