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

If you use Node-RED you can work around this, for example when using a state node for a sensor you can select “Output only on state change”.

Thanks for the tip. In fact, I am using node red. So instead of just listening to the topic and do something, I am using the “trigger” node. Then I can do more or less what you proposed.
GV

Can anyone help me with this error. I have just updated from 1.5.X to 1.6 and cant work out how to fix this. I have tried pressing the button listed in the error and also reinstalling zigbee2mqtt

  zigbee2mqtt:info 9/19/2019, 8:12:47 PM Error while starting zigbee-shepherd, attempting to fix... (takes 60 seconds) (Error: Cluster with key '65280' does not exist)
  zigbee2mqtt:info 9/19/2019, 8:13:47 PM Starting zigbee-shepherd
  zigbee2mqtt:error 9/19/2019, 8:13:48 PM Error while starting zigbee-shepherd! (Error: dev exists, unregister it first.)
  zigbee2mqtt:error 9/19/2019, 8:13:48 PM Press the reset button on the stick (the one closest to the USB) and start again
  zigbee2mqtt:error 9/19/2019, 8:13:48 PM Failed to start
	{"message":"dev exists, unregister it first.","stack":"Error: dev exists, unregister it first.\n    at /zigbee2mqtt-1.6.0/node_modules/zigbee-herdsman/dist/lib/shepherd.js:449:19\n    at Promise.apply (/zigbee2mqtt-1.6.0/node_modules/zigbee-herdsman/node_modules/q/q.js:1185:26)\n    at Promise.promise.promiseDispatch (/zigbee2mqtt-1.6.0/node_modules/zigbee-herdsman/node_modules/q/q.js:808:41)\n    at /zigbee2mqtt-1.6.0/node_modules/zigbee-herdsman/node_modules/q/q.js:1411:14\n    at runSingle (/zigbee2mqtt-1.6.0/node_modules/zigbee-herdsman/node_modules/q/q.js:137:13)\n    at flush (/zigbee2mqtt-1.6.0/node_modules/zigbee-herdsman/node_modules/q/q.js:125:13)\n    at process._tickCallback (internal/process/next_tick.js:61:11)"}
  zigbee2mqtt:error 9/19/2019, 8:13:48 PM Exiting...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm
 ERR! [email protected] start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /root/.npm/_logs/2019-09-19T10_13_48_740Z-debug.log
2019-09-19T20:13:49: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
2019-09-19T20:13:49: PM2 log: App [npm:0] starting in -fork mode-
2019-09-19T20:13:49: PM2 log: App [npm:0] online

Did you try this ?

If so, remove thé stick and plug it back in.

Yes tried that, no bingo

I remember I got the same error after the upgrade. I pressed the button, did not help.
either
I removed the stick and plugged it back in
Rebooted the pi

One of the two helped.

Ok I’ll try again. I did do both but it hadn’t worked

I’m also experiencing something similar

[Info] Configuration file found in data path, but no backup file found in data path. Backing up existing configuration to /share/zigbee2mqtt/.configuration.yaml.bk
2019-09-19T22:26:28: PM2 log: Launching in no daemon mode
2019-09-19T22:26:29: PM2 log: App [npm:0] starting in -fork mode-
2019-09-19T22:26:29: PM2 log: App [npm:0] online
> [email protected] start /zigbee2mqtt-1.6.0
> node index.js
  zigbee2mqtt:info 9/19/2019, 10:26:35 PM Logging to directory: '/share/zigbee2mqtt/log/2019-09-19.22-26-33'
  zigbee2mqtt:info 9/19/2019, 10:26:35 PM Starting zigbee2mqtt version 1.6.0 (commit #unknown)
  zigbee2mqtt:info 9/19/2019, 10:26:35 PM Starting zigbee-shepherd
  zigbee2mqtt:info 9/19/2019, 10:26:37 PM Error while starting zigbee-shepherd, attempting to fix... (takes 60 seconds) (Error: Cluster with key '64516' does not exist)
  zigbee2mqtt:info 9/19/2019, 10:27:37 PM Starting zigbee-shepherd
  zigbee2mqtt:error 9/19/2019, 10:27:38 PM Error while starting zigbee-shepherd! (Error: dev exists, unregister it first.)
  zigbee2mqtt:error 9/19/2019, 10:27:38 PM Press the reset button on the stick (the one closest to the USB) and start again
  zigbee2mqtt:error 9/19/2019, 10:27:38 PM Failed to start
	{"message":"dev exists, unregister it first.","stack":"Error: dev exists, unregister it first.\n    at /zigbee2mqtt-1.6.0/node_modules/zigbee-herdsman/dist/lib/shepherd.js:449:19\n    at Promise.apply (/zigbee2mqtt-1.6.0/node_modules/zigbee-herdsman/node_modules/q/q.js:1185:26)\n    at Promise.promise.promiseDispatch (/zigbee2mqtt-1.6.0/node_modules/zigbee-herdsman/node_modules/q/q.js:808:41)\n    at /zigbee2mqtt-1.6.0/node_modules/zigbee-herdsman/node_modules/q/q.js:1411:14\n    at runSingle (/zigbee2mqtt-1.6.0/node_modules/zigbee-herdsman/node_modules/q/q.js:137:13)\n    at flush (/zigbee2mqtt-1.6.0/node_modules/zigbee-herdsman/node_modules/q/q.js:125:13)\n    at process._tickCallback (internal/process/next_tick.js:61:11)"}
  zigbee2mqtt:error 9/19/2019, 10:27:38 PM Exiting...
npm
 ERR!
 code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm 
ERR! Failed at the [email protected] 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!     /root/.npm/_logs/2019-09-19T20_27_38_942Z-debug.log
2019-09-19T22:27:39: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
2019-09-19T22:27:39: PM2 log: App [npm:0] starting in -fork mode-
2019-09-19T22:27:39: PM2 log: App [npm:0] online
> [email protected] start /zigbee2mqtt-1.6.0
> node index.js
  zigbee2mqtt:info 9/19/2019, 10:27:44 PM Logging to directory: '/share/zigbee2mqtt/log/2019-09-19.22-27-43'
  zigbee2mqtt:info 9/19/2019, 10:27:44 PM Starting zigbee2mqtt version 1.6.0 (commit #unknown)
  zigbee2mqtt:info 9/19/2019, 10:27:44 PM Starting zigbee-shepherd
  zigbee2mqtt:info 9/19/2019, 10:27:46 PM Error while starting zigbee-shepherd, attempting to fix... (takes 60 seconds) (Error: Cluster with key '64516' does not exist)

no clue what Cluster with key means. Have you managed to fix yours?

I had a snapshot of 1.5.1 that I restored to that’s working for now. When I have more time I plan on having another look. If you find the solution please share

Did you ever fix this? I’m having the same problem with a Smartthings Motion Sensor.

No - my WiFi mesh (eero) was moving around frequencies optimizing the mesh - and constantly conflicting with the zigbee network.

I had to move to WiFi bulbs as zigbee wasn’t reliable enough with the router.

Hi All, I have this set up working well on 1.5.1 on Hassio. I have 1 temp sensor and 2 hue ambience bulbs. There is only one thing i cant figure out, when I restart home assistant the lights always default to being displayed as off even if they are on. Once i turn the on or change the brightness does it get back into sync. Is this normal behaviour? Is there are way around this if it is? Cheers

Replace device_id with your actual device

- id: '1565194745362'
  alias: Status bij opstarten HA
  trigger:
  - event: start
    platform: homeassistant
  condition: []
  action:
  - data:
      payload: {'state': ''}
      topic: zigbee2mqtt/[DEVICE_ID]/get
    service: mqtt.publish

Strange I don’t need an automation for this to get the right state at the start up of ha.
However I don’t have a igbee bulb. Mostly aqara sensors, but the stay at the right value.

I think this has something to do with your mqtt broker (maybe the retain value). Also my broker (mosquitto) runs as an addon and this is one doesn’t get restartet when I restart ha. So maybe that’s why the value stays as it should. Probably @petro knows and can explain that better than me.

I have a separate mosquitto install with no retained messages on zigbee2mqtt, and after a restart of HA it takes a few moments to update the states, zigbee2mqtt sends them only every few 30 seconds or so.

Ok, but why do you need the automation from
Above than?

I don’t need it. [vijaykbhatia] asked for a solution.

I see. This will help as a workaround, but maybe it’s better to find the reason for this.

Because with the workaround you will always have to add a new automation if soy add a new Zigbee device.

Thanks @francisp and @h4nc I didn’t think it was normal, but wasn’t sure what I had done wrong. The temperature sensor retains the value after restart it is just the bulbs. The weirdest part is that even a couple of hours after restart the hue bulbs status never updates. It’s like the bulbs never send any messages to the broker unless they are pinged. I have the hassio mosquitto broker add on, it is also being used with sonoff switches with no problem, status of these are always up to date. I will try the work around but if anyone has any other suggestions on what I could have done wrong pleaee let me know. Cheers

If you do
sudo journalctl -u zigbee2mqtt.service -f
on the machine where you are running zigbee2mqtt, you should see logs passing by:

Oct 10 12:05:50 HomeAssistant npm[13678]:   zigbee2mqtt:info 10/10/2019, 12:05:50 PM MQTT publish: topic 'zigbee2mqtt/ikeaoutlet4', payload '{"state":"OFF","linkquality":26}'
Oct 10 12:06:41 HomeAssistant npm[13678]:   zigbee2mqtt:info 10/10/2019, 12:06:41 PM MQTT publish: topic 'zigbee2mqtt/CC2531', payload '{"state":true,"led_state":true,"linkquality":49}'
Oct 10 12:07:41 HomeAssistant npm[13678]:   zigbee2mqtt:info 10/10/2019, 12:07:41 PM MQTT publish: topic 'zigbee2mqtt/CC2531', payload '{"state":true,"led_state":true,"linkquality":49}'
Oct 10 12:08:41 HomeAssistant npm[13678]:   zigbee2mqtt:info 10/10/2019, 12:08:41 PM MQTT publish: topic 'zigbee2mqtt/CC2531', payload '{"state":true,"led_state":true,"linkquality":44}'
Oct 10 12:09:41 HomeAssistant npm[13678]:   zigbee2mqtt:info 10/10/2019, 12:09:41 PM MQTT publish: topic 'zigbee2mqtt/CC2531', payload '{"state":true,"led_state":true,"linkquality":44}'
Oct 10 12:10:41 HomeAssistant npm[13678]:   zigbee2mqtt:info 10/10/2019, 12:10:41 PM MQTT publish: topic 'zigbee2mqtt/CC2531', payload '{"state":true,"led_state":true,"linkquality":49}'
Oct 10 12:11:00 HomeAssistant npm[13678]:   zigbee2mqtt:info 10/10/2019, 12:11:00 PM MQTT publish: topic 'zigbee2mqtt/ikeaoutlet3', payload '{"state":"ON","linkquality":49}'
Oct 10 12:11:41 HomeAssistant npm[13678]:   zigbee2mqtt:info 10/10/2019, 12:11:41 PM MQTT publish: topic 'zigbee2mqtt/CC2531', payload '{"state":true,"led_state":true,"linkquality":42}'
Oct 10 12:12:41 HomeAssistant npm[13678]:   zigbee2mqtt:info 10/10/2019, 12:12:41 PM MQTT publish: topic 'zigbee2mqtt/CC2531', payload '{"state":true,"led_state":true,"linkquality":44}'
Oct 10 12:13:41 HomeAssistant npm[13678]:   zigbee2mqtt:info 10/10/2019, 12:13:41 PM MQTT publish: topic 'zigbee2mqtt/CC2531', payload '{"state":true,"led_state":true,"linkquality":36}'
Oct 10 12:14:41 HomeAssistant npm[13678]:   zigbee2mqtt:info 10/10/2019, 12:14:41 PM MQTT publish: topic 'zigbee2mqtt/CC2531', payload '{"state":true,"led_state":true,"linkquality":49}'
Oct 10 12:14:59 HomeAssistant npm[13678]:   zigbee2mqtt:info 10/10/2019, 12:14:59 PM MQTT publish: topic 'zigbee2mqtt/ikeaoutlet2', payload '{"state":"OFF","linkquality":36}'

I wonder if they are not there after a HA restart.