OH3 IKEA Tradfri remote control with zigbee2mqtt

Hi,

I’m trying to set up an Ikea Tradfri Remote Control in OpenHab 3.
The remote control is connected via zigbee2mqtt. The corresponding entries appear in the zigbee2mqtt log files.

Feb 22 22:08:27 openhab npm[5401]: Zigbee2MQTT:info  2021-02-22 22:08:27: MQTT publish: topic 'zigbee2mqtt/schalterWohnEins/battery', payload '60'
Feb 22 22:08:27 openhab npm[5401]: Zigbee2MQTT:info  2021-02-22 22:08:27: MQTT publish: topic 'zigbee2mqtt/schalterWohnEins/action', payload 'toggle'
Feb 22 22:08:27 openhab npm[5401]: Zigbee2MQTT:info  2021-02-22 22:08:27: MQTT publish: topic 'zigbee2mqtt/schalterWohnEins/linkquality', payload '111'

An MQTT brocker is set up in OpenHab, with which a Tradfri socket is already controlled.
Unfortunately, I cannot set up the remote control.

How can I set up the remote control in OpenHab?

EDIT: Device Ikea E1524/1810

Can you link to the device from this page?

In the meantime, here’s an IKEA dimmer switch configuration, which uses almost identical parameters:

Sorry I forgot the link.

Could you elaborate on what your challenge is?
The usual progress would be to create your MQTT broker in OpenHAB and then create each MQTT device as extra thing with its respective channels.
I got multiple remotes (the normal one with only on/off/hold action, not the big one you linked, whereas concept is the same) working.

I have already set up an MQTT brocker. In addition, a generic MQTT thing for a socket.
My problem is how do I set up the remote control. How do I have to configure the thing and the channels? In the first step I want to switch the socket with the remote control.

I would recommend installing MQTT Explorer, and with that running press all the buttons on your remote and see what happens: this will tell you the correct topics, and what features your remote has. Once you have that, you can fill in the relevant fields in the Thing configuration.

1 Like

The triggering of the buttons is transmitted via zigbee2mqtt/switchLight/action. The name of the button is in the message. At that point, however, I’m stuck.
How can I get a wireless socket on/off when I press a button?
All of the examples I’ve found so far relate to OpenHab 2.
I currently have the following configurations:

UID: mqtt:topic:MqttBrocker:SwitchLight1
label: SwitchLight 1
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:MqttBrocker
location: room1
channels:
  - id: button
    channelTypeUID: mqtt:string
    label: button
    description: ""
    configuration:
      stateTopic: zigbee2mqtt/switchLight/action

UID: mqtt:topic:MqttBrocker:socket1
label: socket1
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:MqttBrocker
location: room1
channels:
  - id: socket
    channelTypeUID: mqtt:switch
    label: socket
    description: ""
    configuration:
      commandTopic: zigbee2mqtt/socket1/set/state
      off: OFF
      on: ON

Hopefully you mean the name of the action?

You now need a rule which is triggered when the Item that is linked to the mqtt:topic:MqttBrocker:SwitchLight1:button Channel changes state, after which the rule can switch your light on and off.

How are you setting up your rules - files or UI? If it’s files then all the OH2 examples will still work.

The problem with this specific remote controller (dubbed “Puck”) is that the button that is supposed to act like a switch only sends one action, toggle. The controller itself doesn’t have a concept of “on/off”.

So far I couldn’t find a way to make it act directly like a switch item but there is one quick (and ugly) workaround: the button, when held for ~2 sec, also sends the action toggle_hold. You can then map toggle as on and toggle_hold as off.

I would, however, prefer a channel type that would act like a toggle switch.