Hue Binding - Dimmer - no button_id

Hi,
just added a Hue Dimmer Switch to my installation, using OpenHAB v4.0.3.
I’m getting the channel trigger events for button-last-event in my rule, but the button_id is missing.
Means receivedEvent.toString() reports 0, 1, 3 etc.
According to doc it should be:

value = (button_id * 1000) + event_id;

rule is looking like this:

rule "Hue Dimmer 1 - button last event"
when
  Channel "hue:device:.....:button-last-event" triggered
then
  logInfo("Info", "Hue Dimmer 1: button last event: " + receivedEvent.toString())
end

Debug shows the same.

Interesting: With an additional Hue button switch everything works as expected (e.g. getting 1002 etc.)

Any ideas?

I had to change

receivedEvent()

to

receivedEvent

a while ago.

Thanks, but this is not the issue (I’m using receivedEvent).

The content of receivedEvent should be like this:

value = (button_id * 1000) + event_id;

The problem is, that the binding seems to skip the button_id information of the Hue dimmer switch, only the event_id is present.

Enabling debugging of the binding shows this for the Hue dimmer switch:

2023-11-06 19:30:44.560 [DEBUG] [e.internal.handler.Clip2ThingHandler] - uuidDimmer -> updateState() 'button-last-event' update with '2' (fullUpdate:false, isDefined:true)
2

and this for the Hue button switch, which is working fine:

2023-11-06 19:30:53.138 [DEBUG] [e.internal.handler.Clip2ThingHandler] - uuidButton -> updateState() 'button-last-event' update with '1002' (fullUpdate:false, isDefined:true)

So only the Hue dimmer switch device seems to have issues.
The Hue button switch device works fine.

This is what my Hue dimmer switch shows on 4.1M3 with Hue binding api version 2:

rule "Hue dimmer switch 1 event handling"
when
   Channel "hue:device:huewz:18514abc-....:button-last-event" triggered 
then
    logInfo("EXTRA", "Dimmer switch event {}", receivedEvent)
	switch(receivedEvent) {
       case "1000": {
            logInfo("EXTRA", "BTN ON INITIAL_PRESSED")
        }
		case "1001": {
            logInfo("EXTRA", "BTN ON HOLD")
        }
		case "1002": {
            logInfo("EXTRA", "BTN ON SHORT RELEASED")
        }
		case "1003": {
            logInfo("EXTRA", "BTN ON LONG RELEASED")
        }
		case "2000": {
            logInfo("EXTRA", "BTN Up LONG RELEASED")
        }
 		case "2001": {
            logInfo("EXTRA", "BTN Up LONG RELEASED")
        }
 		case "2002": {
            logInfo("EXTRA", "BTN Up LONG RELEASED")
        }
 		case "2003": {
            logInfo("EXTRA", "BTN Up LONG RELEASED")
        }
		case "3000": {
            logInfo("EXTRA", "BTN Down LONG RELEASED")
        }
		case "3001": {
            logInfo("EXTRA", "BTN Down LONG RELEASED")
        }
		case "3002": {
            logInfo("EXTRA", "BTN Down LONG RELEASED")
        }
		case "3003": {
            logInfo("EXTRA", "BTN Down LONG RELEASED")
        }
		case "4000": {
            logInfo("EXTRA", "BTN OFF LONG RELEASED")
        }
		case "4001": {
            logInfo("EXTRA", "BTN OFF LONG RELEASED")
        }
		case "4002": {
            logInfo("EXTRA", "BTN OFF LONG RELEASED")
        }
		case "4003": {
            logInfo("EXTRA", "BTN OFF LONG RELEASED")
        }
    }
end


2023-11-06 19:58:01.792 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN ON INITIAL_PRESSED
2023-11-06 19:58:02.819 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 1002
2023-11-06 19:58:02.819 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN ON SHORT RELEASED
2023-11-06 19:58:02.820 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 2000
2023-11-06 19:58:02.820 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN Up LONG RELEASED
2023-11-06 19:58:03.827 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 2002
2023-11-06 19:58:03.827 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN Up LONG RELEASED
2023-11-06 19:58:03.828 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 3000
2023-11-06 19:58:03.828 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN Down LONG RELEASED
2023-11-06 19:58:03.828 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 3002
2023-11-06 19:58:03.828 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN Down LONG RELEASED
2023-11-06 19:58:04.835 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 4000
2023-11-06 19:58:04.835 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN OFF LONG RELEASED
2023-11-06 19:58:04.835 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 4002
2023-11-06 19:58:04.836 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN OFF LONG RELEASED
2023-11-06 19:58:05.845 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 1000
2023-11-06 19:58:05.845 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN ON INITIAL_PRESSED
2023-11-06 19:58:05.846 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 1002
2023-11-06 19:58:05.846 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN ON SHORT RELEASED
2023-11-06 19:58:05.846 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 1000
2023-11-06 19:58:05.846 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN ON INITIAL_PRESSED
2023-11-06 19:58:06.848 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 1001
2023-11-06 19:58:06.848 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN ON HOLD
2023-11-06 19:58:07.853 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 1001
2023-11-06 19:58:07.853 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN ON HOLD
2023-11-06 19:58:08.858 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 1003
2023-11-06 19:58:08.859 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN ON LONG RELEASED
2023-11-06 19:58:09.867 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 4000
2023-11-06 19:58:09.867 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN OFF LONG RELEASED
2023-11-06 19:58:10.871 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 4001
2023-11-06 19:58:10.871 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN OFF LONG RELEASED
2023-11-06 19:58:11.877 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 4001
2023-11-06 19:58:11.877 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN OFF LONG RELEASED
2023-11-06 19:58:11.877 [INFO ] [org.openhab.core.model.script.EXTRA ] - Dimmer switch event 4001
2023-11-06 19:58:11.877 [INFO ] [org.openhab.core.model.script.EXTRA ] - BTN OFF LONG RELEASED

Interesting: After a restart of OpenHAB it’s working as expected! button_id now present and value >= 1000, for Hue dimmer switch, too.

Strange.

Anyway, thanks for providing your infos - at least it made me think again and restart everything :wink: