Setting up a Ikea Tradfri Remote Control via Zigbee2Mqtt

I just started using Zigbee2Mqtt. Works like a charm until I come to the things and items configuration.

Any advise how to properly set up e.g. a Tradfri remote Control? My concrete problem is that with a usual “Switch” Thing just two states/buttons can be properly configured: ON and OFF. However this remote has 5 buttons. A toggle button, arrow buttons and brightness buttons.

Right now I am starting configuring all of these buttons as a separate switch (will then only use the “ON” state):

mqtt.things:

    Thing topic tradfriRemote2 "Tradfri Remote 2" {
                Type switch : toggle            [stateTopic="zigbee2mqtt/remote-tradfri-2", transformationPattern="JSONPATH:$.action", on="toggle" ]
                Type switch : arrow-left-click  [stateTopic="zigbee2mqtt/remote-tradfri-2", transformationPattern="JSONPATH:$.action", on="arrow_left_click" ]
        }

ZigBee2Mqtt will send all of these buttons as a different value in the field “action”.

Now in the openhab logs I see the following things.

When pressing e.g. the toggle button, I see one(!) error message in the log:

2020-01-04 21:14:04.217 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command 'toggle' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.toggle

The same when pressing the other configured button.

When pressing an unconfigured button, I see two(!) error messages:

    2020-01-04 21:14:59.173 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command 'brightness_up_click' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.brightness_up_click
    2020-01-04 21:14:59.178 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command 'brightness_up_click' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.brightness_up_click

This leads me to the assumption that this will presumably work if I configure a switch for each of the buttons on the Tradfri Remote. However although it would do it’s work, on every button click I would get an error for all of the other configured switches on every button press in the logs. That’s not too beautiful.

More or less similar problems exist with a Hue Dimmer Switch I attached.

Does anyone have a tip how I could configure that Tradfri Remote Control properly without having plenty of error messages in the logs?

Set up as string channels and items and process the inputs in rules

1 Like

I tried this but using this way it looks like OpenHAB is only updated upon a “Change”. So if I press the same button twice, I cannot capture it in a rule.

That’s only how it appears in the logs.
Try a received update trigger for the rule. It should work.

@peez80 Hi, did you resolve?
How yours actual solution?
Can you share it, please?