Problem with HUE Binding - No Button Events

After setting up the Hue Binding, on an new OpenHAB 4 installation the HUE Dimmer Switch Things where discovered and they can be added as a Thing.
When adding this Items as Eqipment there are only the 2 Channels for Battery load but no Channel for the State of the Button, so there is not a chance to react on a button state.
Is there anything to do to get the Button Events linked to the Equipment in the Model?

There is no channel for the state of the button. Instead, there’s a button-last-event trigger channel which you can use to trigger rules.

@maniac103, you can check my rule here:

As Michael pointed out, the events are now reported in an item. Same for the Tap Switch.

This is the channel:
button-last-event (String) Informs which button was last pressed in the device. (Trigger Channel)

This is how I get the button into an item upon trigger:

when
   Channel "hue:device:2:Hue_TP_01:button-last-event" triggered
then
    Hue_TP_01_Butt.sendCommand(receivedEvent.toString)
end

But note I have a problem with the hue bridge and the triggers that requires debouncing, see github issue here

1 Like

I don’t really see the point of binding it to an item though, even though it’s possible (which I just learned about, so thanks for that!). Looking at your rule

rule "Main Dimmer Button Pressed"
when
    Item HM_Switch_Dimmer_1_Event received command
then
    ... work with receivedCommand ...

which without an item would look like this

rule "Main Dimmer Button Pressed"
when
    Channel "hue:device:BRIDGE:DEVICE#last-button-event" triggered
then
    ... work with receivedEvent ...

This doesn’t look any different really, just with one item less that outside of this rule won’t do anything?

Nope, not for me: I very much prefer to isolate the actual hardware from the logical layer, that why my rules NEVER act on the hardware items directly, neither in nor out, and all my hardware items are mapped to groups, on which the logic happens. So in fact, the only simplification is that this rule could directly update the group item, instead of the hardware item, but that’s it.

That is why I personally also miss the non-trigger channel that holds the button value: The trigger leaves me no option, I have to use a hardware level link on the rule level.

There are profiles that allow you to link items to trigger channels. For instance trigger-event-string which can completely replace the rule that sends the event to a string item.

Thank for the hint. I have not yet had the opportunity to look into profiles in any detail since they are relatively new to me, but I’ll certainly work myself in over the coming time.

Thanks for all that suggestions - in my “old” installation I create the Equipment and select the needed Channels to get linked. Actually when I want to do so there is nothing to select not even a button-last-event entry. So I might be wrong with creating the equipment there … but where do I get the button-last-event