Ikea Tradfri button not updating with Zigbee binding

Not a lot of info to go on here. Below are the steps to install the Mosquitto server, and connect openHAB to the server via the MQTT binding:

Thank you for the instructions - I was expecting something Mosquitto-specific or for the scan button to work. The broker now shows online but I’m still unable to reach the zigbee2mqtt front end to add devices. Going to [IP address]:8081 gives an “Unable to connect” message.

For mqtt I can recommend to use an external mqtt browser / explorer to connect to the server and view well messages that are posted. This will later help to configure the things I’ve everything is running.

For z2m without any specific error message is hard to help, but you have seen in the docs that you 1) need to activate the frontend in the config file and 2) if you want to use port 8081 need to change the default configuration?

Run service zigbee2mqtt stop to close down z2m.

Then go to the zigbee2mqtt installation directory and run npm start
This should start z2m and give you feedback in case something goes wrong.

I understand the need for an error message but, as far as I can tell, this is the only thing that was being presented. I saw the need to enable the front end in the online documentation but the openhabian install implies, with a message at the end of installation, that the front end is running and available on port 8081.

This was very helpful! See output below:

 npm start

> zigbee2mqtt@1.27.2 start /opt/zigbee2mqtt
> node index.js

Zigbee2MQTT:info  2022-09-14 08:03:10: Logging to console and directory: '/var/log/zigbee2mqtt/2022-09-14.08-03-10al' filename: log.txt
Zigbee2MQTT:info  2022-09-14 08:03:10: Starting Zigbee2MQTT version 1.27.2 (commit #7dc48fb6)
Zigbee2MQTT:info  2022-09-14 08:03:10: Starting zigbee-herdsman (0.14.53)
Zigbee2MQTT:error 2022-09-14 08:03:32: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2022-09-14 08:03:32: Failed to start zigbee
Zigbee2MQTT:error 2022-09-14 08:03:32: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2022-09-14 08:03:32: Exiting...
Zigbee2MQTT:error 2022-09-14 08:03:33: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
    at ZStackAdapter.start (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:103:27)
    at Controller.start (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/controller.ts:132:29)
    at Zigbee.start (/opt/zigbee2mqtt/lib/zigbee.ts:58:27)
    at Controller.start (/opt/zigbee2mqtt/lib/controller.ts:101:27)
    at start (/opt/zigbee2mqtt/index.js:109:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! zigbee2mqtt@1.27.2 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zigbee2mqtt@1.27.2 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/openhabian/.npm/_logs/2022-09-14T13_03_33_513Z-debug.log

Thinking I had maybe selected the wrong adapter based on the error message above, I used the openhabian-config menu to remove and reinstall zigbee2mqtt and ensure the right adapter was selected. Unfortunately, the behavior above persists. I also removed the zigbee binding, in case there was a conflict in access to the adapter but, again, I’m receiving the same error message. The log referred to in the error messages above is a copy of the output shown here so there’s nothing new to gather from that.

Out of desperation, and to remove doubt of the wrong adapter selected, I uninstalled; removed my z-wave adapter (to prevent any mix ups and have only one option at the selection window); rebooted; reinstalled; and started the service manually. The output of that is below and is essentially the same as before.

 npm start

> zigbee2mqtt@1.27.2 start /opt/zigbee2mqtt
> node index.js

Building Zigbee2MQTT... (initial build), finished
Zigbee2MQTT:info  2022-09-14 08:40:51: Logging to console and directory: '/var/log/zigbee2mqtt/2022-09-14.08-40-51al' filename: log.txt
Zigbee2MQTT:info  2022-09-14 08:40:52: Starting Zigbee2MQTT version 1.27.2 (commit #7dc48fb6)
Zigbee2MQTT:info  2022-09-14 08:40:52: Starting zigbee-herdsman (0.14.53)
Zigbee2MQTT:error 2022-09-14 08:41:14: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2022-09-14 08:41:14: Failed to start zigbee
Zigbee2MQTT:error 2022-09-14 08:41:14: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2022-09-14 08:41:14: Exiting...
Zigbee2MQTT:error 2022-09-14 08:41:14: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
    at ZStackAdapter.start (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:103:27)
    at Controller.start (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/controller.ts:132:29)
    at Zigbee.start (/opt/zigbee2mqtt/lib/zigbee.ts:58:27)
    at Controller.start (/opt/zigbee2mqtt/lib/controller.ts:101:27)
    at start (/opt/zigbee2mqtt/index.js:109:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! zigbee2mqtt@1.27.2 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zigbee2mqtt@1.27.2 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/openhabian/.npm/_logs/2022-09-14T13_41_15_038Z-debug.log

The adapter I’m using came from the list of supported adapters (POPP ZB-STICK) and was working with the zigbee binding previously.

EDIT:
I wanted to make sure the adapter was also supported by zigbee2mqtt and found the following here (Supported Adapters | Zigbee2MQTT):

If Zigbee2MQTT fails to start, try adding the following to your configuration.yaml

serial:
  adapter: ezsp

Added the adapter line to the configuration file at /opt/zigbee2mqtt/data/configuration.yaml and restarted with npm to great success. Front end now shows at the advertised address and port. Now to add those buttons…

OK, good to hear it is working now - just thought you might have something else still running that blocks the adapter.
Try a reboot and see if z2m now shows up without manually starting it.

Regarding the button:
I guess you mean that small dimmer button that is sold together with a bulb (guess all those buttons at IKEA a similar). I have such a button up and running, will have a look this evening and post my setup.

Service is still working after a reboot; I think that’s got THAT piece sorted.

You’re right, this is one of the IKEA dimmer buttons. I was able to get one added through the front end but it keeps failing the “interview” phase and pops up an error message saying it was not paired. To make sure this isn’t a loss of signal thing, I placed the button a few inches away from the adapter. Is this like z-wave where it may be some time before the device transmits its data to the server or is it more immediate? Is there a way to force the interview in a similar way to a z-wave “wake up” command?

Delete it again from z2m.
Then factory reset the button (Unscrew the cover, press it 4 times in quick succession to factory reset).
After this try pairing it again.

It looks like I’ll be needing a USB extension cable as suggested in the zigbee2mqtt documentation. I did everything I could to reduce interference - turn off wifi on the RPi, remove z-wave dongle, turn off wifi in the house; still no success with interrogation and pairing. Cable should be here sometime tomorrow.

USB extension cable was delivered and installed and the buttons are still showing the same behavior. I know the basic functionality is there because I was able to connect, interview, and update 2 Tradfri light bulbs, so at least there’s that. It’s just the stupid buttons…
I did experience some interesting behavior while it was toying with different things to get them to pair. If I held down the pairing button while z2m was allowing new devices, the light bulb would pulse in an erratic manner. It only did it once but when I later pressed the button, the bulb turned off. I’m not sure what was going on but the obvious takeaway is that the button was talking directly to the bulb.
Looking at the z2m page for them (IKEA E1812 control via MQTT | Zigbee2MQTT) there’s a note about devices below FW rev 2.3.75 and how I’m supposed to send it a command. Not being super familiar with z2m - is this something I’m supposed to issue from the Dev Console of the device? When it says “sending to”, does that go in the “Cluster” window?

Sorry, that is a different button than mine, I have none of these so can’t help you with that one.
In general it might be beneficial if you post the behaviour shown in the z2m log during pairing as well as when you are pushing the button after the pairing - maybe there is some useful information in there so someone might be able to help better.

I’m starting to suspect my adapter is somehow at fault. It’s listed in the supported devices of z2m as “experimental” but doesn’t elaborate what that means and the forums haven’t helped me. As requested, here is the full log excerpt at the dubug level from an exclusion and inclusion, interview, and failure cycle.

info 2022-09-19 09:40:23Succesfully changed options
info 2022-09-19 09:40:23MQTT publish: topic 'zigbee2mqtt/bridge/response/options', payload '{"data":{"restart_required":false},"status":"ok","transaction":"fxiei-1"}'
debug 2022-09-19 09:40:29Received MQTT message on 'zigbee2mqtt/bridge/request/device/remove' with data '{"block":false,"force":true,"id":"0x0c4314fffe23020c","transaction":"fxiei-2"}'
info 2022-09-19 09:40:29Removing device '0x0c4314fffe23020c' (block: false, force: true)
info 2022-09-19 09:40:29MQTT publish: topic 'zigbee2mqtt/0x0c4314fffe23020c', payload ''
info 2022-09-19 09:40:29Successfully removed device '0x0c4314fffe23020c' (block: false, force: true)
info 2022-09-19 09:40:29MQTT publish: topic 'zigbee2mqtt/bridge/response/device/remove', payload '{"data":{"block":false,"force":true,"id":"0x0c4314fffe23020c"},"status":"ok","transaction":"fxiei-2"}'
debug 2022-09-19 09:40:34Received MQTT message on 'zigbee2mqtt/bridge/request/device/remove' with data '{"block":false,"force":true,"id":"0x0c4314fffe709b54","transaction":"fxiei-3"}'
info 2022-09-19 09:40:34Removing device '0x0c4314fffe709b54' (block: false, force: true)
info 2022-09-19 09:40:34MQTT publish: topic 'zigbee2mqtt/0x0c4314fffe709b54', payload ''
info 2022-09-19 09:40:34Successfully removed device '0x0c4314fffe709b54' (block: false, force: true)
info 2022-09-19 09:40:34MQTT publish: topic 'zigbee2mqtt/bridge/response/device/remove', payload '{"data":{"block":false,"force":true,"id":"0x0c4314fffe709b54"},"status":"ok","transaction":"fxiei-3"}'
info 2022-09-19 09:41:15Device '0x0c4314fffe23020c' joined
info 2022-09-19 09:41:15MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x0c4314fffe23020c","ieee_address":"0x0c4314fffe23020c"},"type":"device_joined"}'
info 2022-09-19 09:41:15Starting interview of '0x0c4314fffe23020c'
info 2022-09-19 09:41:15MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x0c4314fffe23020c","ieee_address":"0x0c4314fffe23020c","status":"started"},"type":"device_interview"}'
error 2022-09-19 09:42:15Failed to interview '0x0c4314fffe23020c', device has not successfully been paired
info 2022-09-19 09:42:15MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x0c4314fffe23020c","ieee_address":"0x0c4314fffe23020c","status":"failed"},"type":"device_interview"}'
info 2022-09-19 09:42:31Starting interview of '0x0c4314fffe23020c'
info 2022-09-19 09:42:31MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x0c4314fffe23020c","ieee_address":"0x0c4314fffe23020c","status":"started"},"type":"device_interview"}'
error 2022-09-19 09:43:31Failed to interview '0x0c4314fffe23020c', device has not successfully been paired
info 2022-09-19 09:43:31MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x0c4314fffe23020c","ieee_address":"0x0c4314fffe23020c","status":"failed"},"type":"device_interview"}'
debug 2022-09-19 09:45:13Saving state to file /opt/zigbee2mqtt/data/state.json

Okay, new adapter received today and the buttons are connecting correctly in z2m! Now I’m trying to create the Things and Items necessary to make them work in OH3 and I’m struggling to understand the example provided here. Looking at the IKEA items at the bottom of the page, it seems fairly straightforward but I don’t understand where the SZMS and SZ in Thing topic SZMS "SZMS" @ "SZ" come from. Where can I find this in my z2m instance to make sure I’m using the right labels?

These are just names for openHAB if i remember correctly. No hard connection to zigbee2mqtt. The connection to zigbee2mqtt is done via the items and channels.

But i usually set the friendly name to the device name, in this case SZMS. (SZ defines the room, MS the device type)

Oh, so those are just acronyms? Do they have any sort of affect on the Semantic Model or can I just call them whatever makes sense?

No effect as far as i know. Just name as you like.

Okay, I’ve finally had some success!! For the complete solution, this is what I did:

  1. Purchase adapter that is recommended for use with zigbee2mqtt
  2. Install Mosquitto
    a. Run openhabian-config
    b. Select Optional Components
    c. Select Mosquitto and follow the prompts; choose a username and password if desired
  3. Install zigbee2mqtt
    a. Run openhabian-config
    b. Select Optional Components
    c. Select Zigbee2MQTT and follow the prompts; include the username and password from 1.c. if included. Be sure to select the correct adapter for your zigbee transceiver.
  4. Install the MQTT binding in the OH3 UI
  5. Create a MQTT Broker thing in the OH3 UI and use localhost for the hostname/IP
  6. Add devices to the Zigbee2MQTT system using the UI at [IP address]:8081
    a. Give the devices friendly names in the UI
  7. Create a Generic MQTT thing in the OH3 UI; ensure you select the MQTT broker created in step 4
  8. Add channels for the desired channels exposed by the device
    i.e.: MQTT State Topic: zigbee2mqtt/[Friendly Name]/action
  9. Add items for the channels created in step 7

Now I just need to think of how to best-handle triggering on a button press since the ‘action’ state doesn’t change from “on” between multiple button presses. Unless there’s a better scheme, the only thing I can think to trigger off is a change in the ‘action’ or ‘battery’ or ‘linkquality’ channels since at least one of those should change with each button press…

Use string type channel and use on change trigger, but then on your code, update the item to blank.

Very clever! Thanks for the suggestion!