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

I had new button that would not pair, when i pull off the battery the multi meter displayed 2.7, after I changed i could pair it. The old battery went away, i could’ve been a good test to move around that old battery to test other paired buttons

Just for reference, using multiple hue bulbs and HA scene:

scene:
  - name: Relax Lights
    entities:
      light.hues01_light:
        state: on
        brightness: 10
        transition: 3
        xy_color: [0.46, 0.41]
      light.hues02_light:
        state: on
        brightness: 10
        transition: 3
        xy_color: [0.46, 0.41]
      light.hues03_light:
        state: on
        brightness: 10
        transition: 3
        xy_color: [0.46, 0.41]
      light.hues04_light:
        state: on
        brightness: 10
        transition: 3
        xy_color: [0.46, 0.41]        
      light.huesofa_light:
        state: on
        brightness: 10
        transition: 3
        xy_color: [0.46, 0.41]

Thanks for your info, so 2.7 Volt will probably be lower limit. It would be interesting what the sensor would display just before non functioning, as the electronics inside the sensors probably have a good voltage measurement (as voltage is passed on in three decimals).

Which power plug can you recommend to me? My Xiaomi devices don’t seem to connect to my Osram Smart+ plug or Osram FLEX RGB. Is this a known problem? I don’t necessarily want to use a xiaomi power plug because it is not compatible with the sockets in my country.

IKEA plugs are working great!

Thank you. I also found this USB Plug which looks very promising.

Hi

Do I need a separate RPI to install this?

Can I use a PRI with Hassio installed?

No, you don’t need an rpi at all.

Yes

Read the docs

I tried several brands of plugs as routers with my Xiaomi sensors without success. I have not tried Ikea. I finally just added Xiaomi plugs along with adapters for USA, I don’t like the bulkiness that the adapter adds, but they work. Will try the Ikea plugs. @Skeletorjus is there a specific IKEA plug that you could specify (model #) which works with Xiaomi sensors?

There is only one availabe (for now), it’s called the IKEA Trådfri control outlet.
Additionally you can use Trådfri bulb(s) as router(s) for your zigbee network.

1 Like

All, I run mine through docker.

docker run \
   --net=host \
   -it \
   -v /srv/data/apps/docker/zigbee2mqtt/data:/app/data \
   -v /etc/localtime:/etc/localtime:ro \
   -v /etc/timezone:/etc/timezone:ro \
   -P \
   --device=/dev/ttyUSB0 \
   koenkk/zigbee2mqtt

Is it normal to have to hold the button on the CC2531 to pair?

Whilst I did get some devices to pair, I am having all sorts of issues with the multiple zigbee smart plugs. Shortly after pairing the plugs, they report ON and OFF, as I expect but a few minutes later I do not get any updates from it, and eventually the plug just flashes red and clicking the button it doesnt get the MQTT message.
Anyone else having this issue?
I have now tried multiple CC2531 sticks, flashed with different programmers as well.

Shortly after pairing the plugs, they report ON and OFF, as I expect but a few minutes later I do not get any updates from it, and eventually the plug just flashes red and clicking the button it doesnt get the MQTT message.

I think this happened to me when I tried to pair the plug located at some distance from the coordinator. I brought the plug to the room where the coordinator is located, initiated the pairing the standard way (hold button on the plug for 5 seconds until the red light lights up for 1 second) and then switched the plug manually on and off ~10 times in a row, with 1-2 seconds in each state.

CC2531 takes more efforts to pair devices to.

One of my 2 Xiaomi plugs doesn’t report voltage though (while it reports power cosumption correctly, go figure).

I never used the button on the dongle to pair. It is too fragile, especially when plugged into the server (and hard to access in my case). Initially I set permit_join: true then, after I paired most of my devices, I set it to false and used a service to enable pairing, please see https://koenkk.github.io/zigbee2mqtt/integration/home_assistant.html

Hi, I just installed and configured the CC2531 with my Hassio v. 0.85.0
I configured it following instruction in https://github.com/danielwelch/hassio-zigbee2mqtt
I installed add-ons zigbee2mqtt and zigbee2mqtt-edge
but I receive since the first time this error:

Error while starting zigbee-shepherd, attemping to fix... (takes 60 seconds)
2019-1-12 09:44:37 - info: Starting zigbee-shepherd
2019-1-12 09:44:40 - error: Error while starting zigbee-shepherd!
2019-1-12 09:44:40 - error: Press the reset button on the stick (the one closest to the USB) and start again
2019-1-12 09:44:40 - error: Failed to start Error: request timeout
    at CcZnp.<anonymous> (/zigbee2mqtt-1.0.1/node_modules/cc-znp/lib/ccznp.js:255:22)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)
    at CcZnp.emit (events.js:211:7)
    at Timeout.<anonymous> (/zigbee2mqtt-1.0.1/node_modules/cc-znp/lib/ccznp.js:234:18)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)

I resetted it pressing the reset button on the USB stick and rebooted Home Assistant many times… unsuccesfully

Thanks - I have the plug sitting within 2 foot of the stick. so strange. I dont get it.
I HAVE to use the button on the CC2531 - this is both CC2531s flashed via different programmers.
Tried for the last 30 mins without using the button on 2531 and it never pairs at all.
only common thing now is my docker/server.
I have no idea what to do now

Between this code is when it stops responding and sending to MQTT. Also when it stops responding I get a flick of the red led when the switch is on. Other plugs do the same thins so i am sure its not the plug being faulty (I have 3 of them).

2019-01-12T10:59:19.065Z serialport:main _read reading
2019-01-12T10:59:19.065Z serialport:bindings read
2019-01-12T10:59:19.065Z serialport:unixRead Starting read
Sat, 12 Jan 2019 10:59:19 GMT cc-znp:AREQ ← AF:incomingMsg, { groupid: 0, clusterid: 6, srcaddr: 38948, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 68, securityuse: 0, timestamp: 6254083, transseqnumber: 0, len: 14, data: <Buffer 18 ad 0a 00 00 10 00 00 f0 23 00 24 98 03> }
Sat, 12 Jan 2019 10:59:19 GMT zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object]
Sat, 12 Jan 2019 10:59:19 GMT zigbee-shepherd:msgHdlr IND ← AF:incomingMsg, transId: 0
2019-01-12T10:59:19.071Z serialport:unixRead waiting for readable because of code: EAGAIN
2019-01-12T10:59:19.071Z serialport:poller Polling for “readable”
Sat, 12 Jan 2019 10:59:19 GMT zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object]
zigbee2mqtt:debug 2019-1-12 19:29:19 Received zigbee message of type ‘attReport’ with data ‘{“cid”:“genOnOff”,“data”:{“61440”:60302336,“onOff”:0}}’ of device ‘lumi.plug’ (0x00158d00015e80f7)
zigbee2mqtt:info 2019-1-12 19:29:19 MQTT publish: topic ‘zigbee2mqtt/0x00158d00015e80f7’, payload ‘{“state”:“OFF”,“power”:0,“voltage”:null,“consumption”:50.66,“temperature”:34,“linkquality”:68}’
zigbee2mqtt:debug 2019-1-12 19:29:19 Received zigbee message of type ‘devChange’ with data ‘{“cid”:“genOnOff”,“data”:{“onOff”:0}}’ of device ‘lumi.plug’ (0x00158d00015e80f7)

2019-01-12T10:59:27.791Z serialport:poller received “readable”
2019-01-12T10:59:27.791Z serialport:bindings read
2019-01-12T10:59:27.791Z serialport:unixRead Starting read
2019-01-12T10:59:27.792Z serialport:unixRead Finished read 8 bytes
2019-01-12T10:59:27.792Z serialport:main binding.read finished
zigbee2mqtt:warn 2019-1-12 19:29:27 Message without device!
Sat, 12 Jan 2019 10:59:27 GMT cc-znp { sof: 254,
len: 3,
type: ‘AREQ’,
subsys: ‘AF’,
cmd: ‘dataConfirm’,
payload: { status: 183, endpoint: 1, transid: 24 },
fcs: 105,
csum: 105 }
2019-01-12T10:59:27.808Z serialport:main _read reading
2019-01-12T10:59:27.808Z serialport:bindings read
2019-01-12T10:59:27.808Z serialport:unixRead Starting read
Sat, 12 Jan 2019 10:59:27 GMT cc-znp:AREQ ← AF:dataConfirm, { status: 183, endpoint: 1, transid: 24 }
Sat, 12 Jan 2019 10:59:27 GMT zigbee-shepherd:af dispatchIncomingMsg(): type: dataConfirm, msg: [object Object]
Sat, 12 Jan 2019 10:59:27 GMT zigbee-shepherd:msgHdlr IND ← AF:dataConfirm, transId: 24
zigbee2mqtt:debug 2019-1-12 19:29:27 Received zigbee message of type ‘devInterview’ with data ‘“0x00158d00015e80f7”’
2019-01-12T10:59:27.817Z serialport:unixRead waiting for readable because of code: EAGAIN
2019-01-12T10:59:27.818Z serialport:poller Polling for “readable”
Sat, 12 Jan 2019 10:59:27 GMT zigbee-shepherd Device: 0x00158d00015e80f7 join the network.
zigbee2mqtt:debug 2019-1-12 19:29:27 Received zigbee message of type ‘devIncoming’ with data ‘“0x00158d00015e80f7”’ of device ‘lumi.plug’ (0x00158d00015e80f7)
zigbee2mqtt:info 2019-1-12 19:29:27 Device incoming…
zigbee2mqtt:info 2019-1-12 19:29:27 MQTT publish: topic ‘zigbee2mqtt/bridge/log’, payload ‘{“type”:“pairing”,“message”:“device incoming”}’
zigbee2mqtt:debug 2019-1-12 19:29:27 Received zigbee message of type ‘devStatus’ with data ‘“online”’ of device ‘lumi.plug’ (0x00158d00015e80f7)
zigbee2mqtt:debug 2019-1-12 19:30:10 Check online 0x00158d00015e80f7 0x00158d00015e80f7
Sat, 12 Jan 2019 11:00:10 GMT zigbee-shepherd:request REQ → ZDO:nodeDescReq
Sat, 12 Jan 2019 11:00:10 GMT cc-znp:SREQ → ZDO:nodeDescReq, { dstaddr: 38948, nwkaddrofinterest: 38948 }
2019-01-12T11:00:10.033Z serialport:main _write 9 bytes of data
2019-01-12T11:00:10.034Z serialport:bindings write 9 bytes
2019-01-12T11:00:10.034Z serialport:unixWrite Starting write 9 bytes offset 0 bytesToWrite 9
2019-01-12T11:00:10.041Z serialport:unixWrite write returned null 9
2019-01-12T11:00:10.041Z serialport:unixWrite wrote 9 bytes
2019-01-12T11:00:10.041Z serialport:unixWrite Finished writing 9 bytes
2019-01-12T11:00:10.042Z serialport:main binding.write write finished
2019-01-12T11:00:10.047Z serialport:poller received “readable”
2019-01-12T11:00:10.047Z serialport:bindings read
2019-01-12T11:00:10.047Z serialport:unixRead Starting read
2019-01-12T11:00:10.047Z serialport:unixRead Finished read 6 bytes
2019-01-12T11:00:10.048Z serialport:main binding.read finished
Sat, 12 Jan 2019 11:00:10 GMT cc-znp { sof: 254,
len: 1,
type: ‘SRSP’,
subsys: ‘ZDO’,
cmd: ‘nodeDescReq’,
payload: { status: 0 },
fcs: 102,
csum: 102 }
2019-01-12T11:00:10.049Z serialport:main _read reading
2019-01-12T11:00:10.049Z serialport:bindings read
2019-01-12T11:00:10.050Z serialport:unixRead Starting read
Sat, 12 Jan 2019 11:00:10 GMT cc-znp:SRSP ← ZDO:nodeDescReq, { status: 0 }
2019-01-12T11:00:10.050Z serialport:unixRead waiting for readable because of code: EAGAIN
2019-01-12T11:00:10.050Z serialport:poller Polling for “readable”
Sat, 12 Jan 2019 11:00:15 GMT zigbee-shepherd:request REQ → ZDO:nodeDescReq
Sat, 12 Jan 2019 11:00:15 GMT cc-znp:SREQ → ZDO:nodeDescReq, { dstaddr: 38948, nwkaddrofinterest: 38948 }
2019-01-12T11:00:15.039Z serialport:main _write 9 bytes of data
2019-01-12T11:00:15.039Z serialport:bindings write 9 bytes
2019-01-12T11:00:15.040Z serialport:unixWrite Starting write 9 bytes offset 0 bytesToWrite 9
2019-01-12T11:00:15.040Z serialport:unixWrite write returned null 9
2019-01-12T11:00:15.040Z serialport:unixWrite wrote 9 bytes
2019-01-12T11:00:15.040Z serialport:unixWrite Finished writing 9 bytes
2019-01-12T11:00:15.040Z serialport:main binding.write write finished
2019-01-12T11:00:15.046Z serialport:poller received “readable”
2019-01-12T11:00:15.046Z serialport:bindings read
2019-01-12T11:00:15.046Z serialport:unixRead Starting read
2019-01-12T11:00:15.047Z serialport:unixRead Finished read 6 bytes
2019-01-12T11:00:15.047Z serialport:main binding.read finished
Sat, 12 Jan 2019 11:00:15 GMT cc-znp { sof: 254,
len: 1,
type: ‘SRSP’,
subsys: ‘ZDO’,

I notice that the one listed on the zigbee2mqtt supported devices page is model e1603. I’m not sure for what country it is made, but the photo shows a different plug arrangement than the one I use in the US.

I see the one I linked below, but it doesn’t clarify that its Zigbee. I’m probably a little too apprehensive, but its just that I’ve tried a wide array of plugs unsuccessfully which is why I wanted to stop wasting money unless I was more certain it would work as a router.

https://www.ikea.com/us/en/catalog/products/30356169/

Trådfri is IKEA’s zigbee line, so that’s the one.

1 Like

I am migrating from HASSIO to Docker on a NUC. I have setup Mosquitto and Zigbee2Mqtt and moved all my configs across. I can see Zigbee2Mqtt is is connected to Mosquitto and posting updates for sensors but HomeAssistant is not discovering any devices.

This is my mqtt config in HA:

mqtt:
  broker: 192.168.1.34
  port: 1883
  client_id: home-assistant-1
  username: user
  password: password
  discovery: true
  discovery_prefix: homeassistant
  birth_message:
    topic: 'hass/status'
    payload: 'online'
  will_message:
    topic: 'hass/status'
    payload: 'offline'

Any recommendations?

Use mosquitto_sub to see what Z2M is sending.

Hi Nick,

Zigbee2Mqtt and Mosquitto are talking fine, the issue appears to be that HomeAssistant isnt sending or recieving anything except its birth and last will messages.