Zigbee2mqtt: getting rid of your proprietary Zigbee bridges (Xiaomi, Hue, TRADFRI)

Range issue?
Have you got them near the key whilst pairing or doing it from a distance?

They’re in the same room while pairing, and I had no issues pairing devices that were in a different room.

It’s strange that devices which paired successfully stopped working, even when I bring them right next to the sniffer.

Some progress: I changed to my laptop’s WiFi connection so I could bring it right next to the sensor, and managed to pair the WXKG01LM button.

However I’m still getting

2018-10-2 20:39:49 - warn: Message without device!
2018-10-2 20:39:53 - info: Device incoming...
2018-10-2 20:39:53 - info: MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"device incoming"}'
2018-10-2 20:40:22 - error: Cannot get the Node Descriptor of the Device: 0x00158d0002162ac7 (Error: Timed out after 10000 ms)

for the RTCGQ01LM motion sensor. I tried replacing the battery but no dice.

What version are you using 0.1.6?
Enable debug mode and see what info the sensors are transmitting.

Yep 0.1.6

I’m running zigbee2mqtt through docker-compose, how do I add this to my run command?

“To enable debug logging in the zigbee2mqtt Docker container add -e DEBUG=* to your docker run command.”

  zigbee2mqtt:
    container_name: zigbee2mqtt
    restart: unless-stopped
    image: koenkk/zigbee2mqtt
    devices:
      - /dev/ttyACM0
    volumes:
      - /home/user/zigbee2mqtt:/app/data

No idea, I run the HASSIO plugin.
I use the MQTT interface from the HA front end. Super easy.

Add it as environment in docker-compose.

    zigbee2mqtt:
        environment:
            - 'DEBUG=*'
1 Like

Did you try all pairing methods from zigbee2mqtt github?

Add it as environment in docker-compose.

    zigbee2mqtt:
        environment:
            - 'DEBUG=*'

Thanks, that worked :slight_smile:

Did you try all pairing methods from zigbee2mqtt github?

@MrED yep, I tried all combinations of holding and releasing, holding and clicking every second etc.

Here’s what the log shows when trying to pair with debugging on:

2018-10-3 06:43:14 - debug: Recieved zigbee message of type ‘devLeaving’ with data ‘“0x00158d0002162ac7”’
2018-10-3 06:43:14 - warn: Message without device!
2018-10-3 06:43:14 - debug: Recieved zigbee message of type ‘devInterview’ with data ‘“0x00158d0002162ac7”’
2018-10-3 06:43:14 - debug: Recieved zigbee message of type ‘devInterview’ with data ‘“0x00158d0002162ac7”’
2018-10-3 06:43:15 - debug: Recieved zigbee message of type ‘devInterview’ with data ‘“0x00158d0002162ac7”’
2018-10-3 06:43:16 - debug: Recieved zigbee message of type ‘devInterview’ with data ‘“0x00158d0002162ac7”’
2018-10-3 06:43:17 - debug: Recieved zigbee message of type ‘devInterview’ with data ‘“0x00158d0002162ac7”’
2018-10-3 06:43:18 - debug: Recieved zigbee message of type ‘devInterview’ with data ‘“0x00158d0002162ac7”’
2018-10-3 06:43:18 - debug: Recieved zigbee message of type ‘devInterview’ with data ‘“0x00158d0002162ac7”’
2018-10-3 06:43:19 - debug: Recieved zigbee message of type ‘devInterview’ with data ‘“0x00158d0002162ac7”’
2018-10-3 06:43:19 - debug: Recieved zigbee message of type ‘devIncoming’ with data ‘“0x00158d0002162ac7”’ of device ‘undefined’ (0x00158d0002162ac7)
2018-10-3 06:43:19 - info: Device incoming…
2018-10-3 06:43:19 - info: MQTT publish, topic: ‘zigbee2mqtt/bridge/log’, payload: ‘{“type”:“pairing”,“message”:“device incoming”}’
2018-10-3 06:43:19 - debug: Recieved zigbee message of type ‘devStatus’ with data ‘“online”’ of device ‘undefined’ (0x00158d0002162ac7)
2018-10-3 06:43:41 - error: Cannot get the Node Descriptor of the Device: 0x00158d0002162ac7 (Error: Timed out after 10000 ms)
2018-10-3 06:44:44 - info: MQTT publish, topic: ‘zigbee2mqtt/bridge/log’, payload: ‘{“type”:“pairing”,“message”:“device incoming”}’
2018-10-3 06:44:44 - debug: Recieved zigbee message of type ‘devStatus’ with data ‘“online”’ of device ‘undefined’ (0x00158d0002162ac7)
2018-10-3 06:45:04 - error: Cannot get the Node Descriptor of the Device: 0x00158d0002162ac7 (Error: Timed out after 10000 ms)

And that cycle over and over. So it looks like the device is trying to pair and gets close, but not quite there :tired_face:

Haven’t seen it mentioned anywhere and thought it might be helpful to some.

If you are using the hassio add-on and a new device you have is added to the shepherd-convertors but zigbee2mqtt hasn’t been updated to include it yet and therefore neither has the add-on, just turn off the main add-on, install the edge version, which will pick up the new device, and start it up, no need to configure anything as both add-ons reference the same data folder so your set up will be exactly as before.

When the main add-on is updated, just turn off the edge version and turn the other back on again.

Hi everyone just in case anyone else without much docker knowledge is interested in testing support for new devices from Hass.io I have tried to put some steps togeather here:

https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices-on-Hass.io

Recieved zigbee message of type ‘devIncoming’ with data ‘“0x00158d0002162ac7”’ of device ‘undefined’ (0x00158d0002162ac7)

This means the device itself is not announcing itself properly.
So in order of likely hood;
-Sure you got it in pairing mode? If its Xiaomi Aqara you just hold the pairing button for 5 sec and release. Should flash blue 3 times. Non Aqara from memory you need to press every 2s after holding for 5 initially.
-What are you trying to sync? Looks to be Xiaomi device based on the ID#. Have you connected it the hub?
-Any other WiFi routers /zigbee co-ordinators about? Could be interference on a similar spectrum.

MAD, been waiting for this. Thanks!

-Sure you got it in pairing mode? If its Xiaomi Aqara you just hold the pairing button for 5 sec and release. Should flash blue 3 times. Non Aqara from memory you need to press every 2s after holding for 5 initially.

It’s “RTCGQ01LM - Xiaomi MiJia human body movement sensor”. I’m quite certain of the difference between it and the Aqara sensor because I have one of those too. The Aqara model has a small reset button on the right while the MiJia has a pinhole. I’ll try every 2s instead of every second (or spamming the button in frustration after the hundredth failed pairing attempt).

Have you connected it the hub?

It was previously connected to the Xiaomi Gateway, but I unpaired it and have since unplugged the gateway.

Any other WiFi routers /zigbee co-ordinators about? Could be interference on a similar spectrum.

Ahh, interesting point. The laptop I’m running everything on is right next to my WiFi router. I’ll try moving it away and trying again.

Thanks for all your help!

SUCCESS.

I managed to pair the motion sensor. Not sure exactly what did the trick, but I tried a combination of:

  1. Pairing it with the Xiaomi Gateway, unpairing it then unplugging the gateway
  2. Moving the laptop away from the WiFi router
  3. Holding the reset button for 5s then pressing every 2s

The magic lines that finally show it’s working are:

2018-10-3 10:34:33 - info: Device incoming...
2018-10-3 10:34:33 - info: MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"device incoming"}'
2018-10-3 10:34:33 - info: MQTT publish, topic: 'homeassistant/binary_sensor/0x00158d0002162ac7/occupancy/config', payload: '{"payload_on":true,"payload_off":false,"value_template":"{{ value_json.occupancy }}","device_class":"motion","json_attributes":["battery","voltage"],"state_topic":"zigbee2mqtt/motion_kitchen","availability_topic":"zigbee2mqtt/bridge/state","name":"motion_kitchen"}'
2018-10-3 10:34:33 - debug: Recieved zigbee message of type 'devStatus' with data '"online"' of device 'lumi.sensor_motion' (0x00158d0002162ac7)

Thanks again!

Guys, do you know how I do retrieve that battery data from Xiaomi Aqara (Water Sensor)?

The data is available because when I check on my RPi it shows the battery %:

pi@raspberrypi:~ $ sudo systemctl status zigbee2mqtt
● zigbee2mqtt.service - zigbee2mqtt
   Loaded: loaded (/etc/systemd/system/zigbee2mqtt.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2018-09-29 16:48:37 CEST; 4 days ago
 Main PID: 3800 (npm)
   CGroup: /system.slice/zigbee2mqtt.service
           ├─3800 npm
           ├─3814 sh -c node index.js
           └─3815 node index.js

Oct 03 20:44:48 raspberrypi npm[3800]:   zigbee2mqtt:warn 2018-10-3 20:44:48 Soft resetted zigbee
Oct 03 20:44:48 raspberrypi npm[3800]:   zigbee2mqtt:info 2018-10-3 20:44:48 zigbee-shepherd ready
Oct 03 21:25:02 raspberrypi npm[3800]:   zigbee2mqtt:info 2018-10-3 21:25:02 MQTT publish, topic: 'zigbee2mqtt/bathroom_water_leak', payload: '{"water_leak":true,"linkquality":42,"battery":"100.00","voltage":3235}'
Oct 03 21:25:02 raspberrypi npm[3800]:   zigbee2mqtt:info 2018-10-3 21:25:02 MQTT publish, topic: 'zigbee2mqtt/bathroom_water_leak', payload: '{"water_leak":true,"linkquality":42,"battery":"100.00","voltage":3235}'
Oct 03 22:15:08 raspberrypi npm[3800]:   zigbee2mqtt:info 2018-10-3 22:15:08 MQTT publish, topic: 'zigbee2mqtt/bathroom_water_leak', payload: '{"water_leak":true,"linkquality":39,"battery":"100.00","voltage":3235}'
Oct 03 22:15:08 raspberrypi npm[3800]:   zigbee2mqtt:info 2018-10-3 22:15:08 MQTT publish, topic: 'zigbee2mqtt/bathroom_water_leak', payload: '{"water_leak":true,"linkquality":39,"battery":"100.00","voltage":3235}'
Oct 03 23:05:15 raspberrypi npm[3800]:   zigbee2mqtt:info 2018-10-3 23:05:15 MQTT publish, topic: 'zigbee2mqtt/bathroom_water_leak', payload: '{"water_leak":true,"linkquality":36,"battery":"100.00","voltage":3235}'
Oct 03 23:05:15 raspberrypi npm[3800]:   zigbee2mqtt:info 2018-10-3 23:05:15 MQTT publish, topic: 'zigbee2mqtt/bathroom_water_leak', payload: '{"water_leak":true,"linkquality":36,"battery":"100.00","voltage":3235}'
Oct 03 23:55:21 raspberrypi npm[3800]:   zigbee2mqtt:info 2018-10-3 23:55:21 MQTT publish, topic: 'zigbee2mqtt/bathroom_water_leak', payload: '{"water_leak":true,"linkquality":39,"battery":"100.00","voltage":3225}'
Oct 03 23:55:21 raspberrypi npm[3800]:   zigbee2mqtt:info 2018-10-3 23:55:21 MQTT publish, topic: 'zigbee2mqtt/bathroom_water_leak', payload: '{"water_leak":true,"linkquality":39,"battery":"100.00","voltage":3225}' 

I tried doing this but i get unknown:

- platform: mqtt
  name: “Bathroom Water Leak Battery”
  state_topic: “zigbee2mqtt/bathroom_water_leak”
  unit_of_measurement: ‘%’
  value_template: “{{ value_json.battery }}”

This is my config for battery:

  • platform: mqtt
    name: “Leak Sensor Washer Battery”
    icon: mdi:battery-charging-outline
    state_topic: “zigbee2mqtt/0x00158d00021346f4”
    unit_of_measurement: ‘%’
    value_template: “{{ value_json.battery | int }}”

Thanks a lot for the bridge! I am running it now in a testing mode and it runs great.

I would repeat the question I tried to ask more than a month ago but unfortunately got no answer.

The devices governed by zigbee2mqtt are added by mqtt auto-discovery and I can see them in ‘Entities’ list of the user interface and they work perfectly. But they do not appear in ‘entity-registry.yaml’ or its .storage/core.entity_registry equivalent. Is it an expected behavior?

The package for battery monitoring has created corresponding battery sensors and they did appear in the registry.

What is other people experience? Is it a common behavior or some kind of incorrect configuration on my part?

Still not working.

“Still not working” is not helpful, it gives us nothing to work with.

1 Like