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

There is a zigbee2mqtt package that let you change loglevel from the HA frontend.

I did not have that issue yet, but maybe reinstalling the addon is a good idea.

Do you see any logging at all, for example when restarting the addon?

I’ve been experiencing some delay when logs are loaded, did you just try and wait some more to see if it shows up?

Thanks francisp. I’ve seen the configuration for changing the log level and I might end up playing with that. It’s strange though why my logging has just stopped. Was hoping to work that out.

Thanks h4nc. I upgraded to the latest version, but it did not help. BTW the co-ordinator I bought from you is awesome. It’s working really well.

No logging at all for the plug in. Unfortunately, I don’t know when it stopped logging as it just works and I haven’t added any devices for some time, so haven’t looked at it.

1 Like

Just an update. … a full restart of my server resolved the logging problem

1 Like

A post was split to a new topic: Node Red consuming lots of CPU

v1.7.0 was released today :partying_face:

I installed it this morning. Had no problems :slight_smile:

I currently have 1 coordinator (CC2530):and a couple of WEMO globes & Xiaomi which which work fine until I reboot Hassio. When I reboot Hassio I loose all the Zigbee paired devices. This happened when I went from 1.4 to 1.6 & 1.7. Currently running Home Assistant 0.101.3

These are my setting in zigbee2mqtt;

“data_path”: “/share/zigbee2mqtt”,
“devices”: “devices.yaml”,
“groups”: “groups.yaml”,
“homeassistant”: true,
“permit_join”: false,
“mqtt”: {
“base_topic”: “zigbee2mqtt”,
“server”: “mqtt://core-mosquitto”,
“user”: “myusername”,
“password”: “mypassword”
},
“serial”: {
“disable_led”: true,
“port”: “/dev/ttyACM0”
},
“advanced”: {
“pan_id”: 6754,
“channel”: 11,
“network_key”: [],
“availability_blacklist”: []
},
“ban”: [],
“whitelist”: [],
“queue”: {},
“socat”: {
“enabled”: false,
“master”: “pty,raw,echo=0,link=/dev/ttyZ2M,mode=777”,
“slave”: “tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5”,
“restartdelay”: 1,
“initialdelay”: 1,
“options”: “-d -d”,
“log”: false
}
}

And after the reboot the WEMO lamp is unknown.

zigbee2mqtt:info 2019-11-19T01:18:43: MQTT publish: topic ‘zigbee2mqtt/bridge/log’, payload ‘{“type”:“entity_not_found”,“message”:{“friendly_name”:“0x94103ef6bf442bc7”}}’
zigbee2mqtt:error 2019-11-19T01:18:43: Entity ‘0x94103ef6bf442bc7’ is unknown

Hey guys, maybe it is a config error by my side, but i tryed a lot.

i have Trouble with the mqtt server.
I can´t log in with the zigbee2mqtt addon.

log zigbee2mqtt

./run.sh: line 16: [Info] Configuration backup found in /share/zigbee2mqtt/.configuration.yaml.bk. Skipping config backup.: No such file or directory
[Info] Socat is DISABLED and not started
2019-11-22T15:43:37: PM2 log: Launching in no daemon mode
2019-11-22T15:43:37: PM2 log: App [npm:0] starting in -fork mode-
2019-11-22T15:43:37: PM2 log: App [npm:0] online

[email protected] start /zigbee2mqtt-1.7.1
node index.js
zigbee2mqtt:info 2019-11-22T14:43:43: Logging to directory: ‘/share/zigbee2mqtt/log/2019-11-22.15-43-41’
zigbee2mqtt:info 2019-11-22T14:43:43: Starting zigbee2mqtt version 1.7.1 (commit #unknown)
zigbee2mqtt:info 2019-11-22T14:43:43: Starting zigbee-herdsman…
zigbee2mqtt:info 2019-11-22T14:43:44: zigbee-herdsman started
zigbee2mqtt:info 2019-11-22T14:43:44: Coordinator firmware version: ‘{“type”:“zStack12”,“meta”:{“transportrev”:2,“product”:0,“majorrel”:2,“minorrel”:6,“maintrel”:3,“revision”:20190608}}’
zigbee2mqtt:info 2019-11-22T14:43:44: Currently 0 devices are joined:
zigbee2mqtt:info 2019-11-22T14:43:44: Zigbee: disabling joining new devices.
zigbee2mqtt:info 2019-11-22T14:43:44: Connecting to MQTT server at mqtt://192.168.178.52:1883
events.js:174
throw er; // Unhandled ‘error’ event
^
Error: Connection refused: Not authorized
at MqttClient._handleConnack (/zigbee2mqtt-1.7.1/node_modules/mqtt/lib/client.js:1076:15)
at MqttClient._handlePacket (/zigbee2mqtt-1.7.1/node_modules/mqtt/lib/client.js:365:12)
at work (/zigbee2mqtt-1.7.1/node_modules/mqtt/lib/client.js:283:12)
at Writable.writable._write (/zigbee2mqtt-1.7.1/node_modules/mqtt/lib/client.js:294:5)
at doWrite (/zigbee2mqtt-1.7.1/node_modules/readable-stream/lib/_stream_writable.js:428:64)
at writeOrBuffer (/zigbee2mqtt-1.7.1/node_modules/readable-stream/lib/_stream_writable.js:417:5)
at Writable.write (/zigbee2mqtt-1.7.1/node_modules/readable-stream/lib/_stream_writable.js:334:11)
at Socket.ondata (_stream_readable.js:709:20)
at Socket.emit (events.js:198:13)
at addChunk (_stream_readable.js:288:12)
Emitted ‘error’ event at:
at MqttClient._handleConnack (/zigbee2mqtt-1.7.1/node_modules/mqtt/lib/client.js:1078:10)
at MqttClient._handlePacket (/zigbee2mqtt-1.7.1/node_modules/mqtt/lib/client.js:365:12)
[… lines matching original stack trace …]
at addChunk (_stream_readable.js:288:12)
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.

log MQTT Mosquito
1574433963: Socket error on client , disconnecting.
1574433972: New connection from 172.30.32.1 on port 1883.
1574433972: Socket error on client , disconnecting.

Mosquitto config:

{
“logins”: ,
“anonymous”: true,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”,
“require_certificate”: false
}

addon config:
{
“data_path”: “/share/zigbee2mqtt”,
“devices”: “devices.yaml”,
“groups”: “groups.yaml”,
“homeassistant”: true,
“permit_join”: false,
“mqtt”: {
“base_topic”: “zigbee2mqtt”,
“server”: “mqtt://192.168.178.52:1883”,
“user”: “myuser”,
“password”: “mypw”
},
“serial”: {
“port”: “/dev/ttyACM0”
},
“advanced”: {
“pan_id”: 6754,
“channel”: 11,
“network_key”: [
1,
3,
5,
7,
9,
11,
13,
15,
0,
2,
4,
6,
8,
10,
12,
13
],
“availability_blacklist”:
},
“ban”: ,
“whitelist”: ,
“queue”: {},
“socat”: {
“enabled”: false,
“master”: “pty,raw,echo=0,link=/dev/ttyZ2M,mode=777”,
“slave”: “tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5”,
“restartdelay”: 1,
“initialdelay”: 1,
“options”: “-d -d”,
“log”: false
}
}

May be someone has a good idea.
thanks a lot.

You define a user and password for zigbee2mqtt, but not for mosquitto ?

1 Like

thanks for the point. I did it for both.
I installed the mosquitto broker new. Now i got an login and i´m a step forward.

thanks…

If you still have the issue - this is what actually helped in my case:
https://www.zigbee2mqtt.io/integration/home_assistant.html

I basically needed to add following into my configuration.yaml

mqtt:
  discovery: true
  broker: [YOUR MQTT BROKER]  # Remove if you want to use builtin-in MQTT broker
  birth_message:
    topic: 'hass/status'
    payload: 'online'
  will_message:
    topic: 'hass/status'
    payload: 'offline'

And this is the quote from documentation

Zigbee2mqtt is expecting Home Assistant to send it’s birth/will messages to hass/status . Be sure to add this to your configuration.yaml if you want Zigbee2mqtt to resend the cached values when Home Assistant restarts

2 Likes

Hi,

I have a bunch of Xiaomi wireless switches (these: https://www.zigbee2mqtt.io/devices/WXKG03LM.html) working well with Zigbee2MQTT.

The only “issue” I have is that as these switches support double press events, and I use them for turning on lights, there is a noticable delay from when I do a single press to the light coming on, caused (in part) by the fact that the switch is waiting to see if I do a double press.

Assuming I don’t care about double press functionality, is there anything clever I can do to get around this, i.e. remove the double press functionality, i.e. some sort of firmware mod / hardware mod on the switch, or something I can configure in Zigbee2MQTT / Hassio?

I expect the answer is no but I thought I’d ask!

Thanks

Amazing work Koen, your rewritten code did wonders for some of my Aqara sensors, back to life and super stable.
Thank you so much!

Hi.
I’m looking for help.
I already tried to update few times, but i don’t understand what I have to do exactly.
I’m running Hassio 0.103, zigbee2mqtt is stil at 1.4.0
I would like to update it to 1.7.1, but I can’t understand the needed steps.
I know that 1.5.1 introduced breaking changes, and that’s were I got stuck.

By default, when upgrading to v1.5.1, the add-on will create a backup of your configuration.yml within your data path: $DATA_PATH/configuration.yaml.bk

no backup is created on my system, but ok, I can save the files manually before updating.
anyway, the configuration.yaml file stored in share/zigbee2mqtt does not change after update.
here is what it contains:

devices:
  '0x000d6ffffe688544':
    friendly_name: '0x000d6ffffe688544'
    retain: false
  '0x00124b001938cbb1':
    friendly_name: '0x00124b001938cbb1'
    retain: false
  '0x00158d00029aaf18':
    friendly_name: '0x00158d00029aaf18'
    retain: false
  '0x00158d0002ade3a2':
    friendly_name: '0x00158d0002ade3a2'
    retain: false
  '0x00158d0002e2e527':
    friendly_name: '0x00158d0002e2e527'
    retain: false
  '0x00158d0002ec01a2':
    friendly_name: '0x00158d0002ec01a2'
    retain: false
  '0x00158d00032d2ddc':
    friendly_name: '0x00158d00032d2ddc'
    retain: false
  '0x00158d0003a3f4a4':
    friendly_name: '0x00158d0003a3f4a4'
    retain: false
  '0x7cb03eaa0a049085':
    friendly_name: '0x7cb03eaa0a049085'
    retain: false
  '0x7cb03eaa0a059dc0':
    friendly_name: '0x7cb03eaa0a059dc0'
    retain: false
  '0x7cb03eaa0a05c41a':
    friendly_name: '0x7cb03eaa0a05c41a'
    retain: false
homeassistant: true
mqtt:
  base_topic: zigbee2mqtt
  password: mypassword
  server: mqtt://homeassistant
  user: DVES_USER
permit_join: false
serial:
  disable_led: true
  port: /dev/ttyACM0

what changes is the config shown in the add-on configuration.

before update:

{
  "data_path": "/share/zigbee2mqtt",
  "homeassistant": true,
  "permit_join": false,
  "mqtt_base_topic": "zigbee2mqtt",
  "mqtt_server": "mqtt://homeassistant",
  "serial_port": "/dev/ttyACM0",
  "devices": [],
  "network_key": [],
  "mqtt_user": "DVES_USER",
  "mqtt_pass": "mypassword",
  "disable_led": true
}

and after update:

{
  "data_path": "/share/zigbee2mqtt",
  "devices": [],
  "groups": "groups.yaml",
  "homeassistant": true,
  "permit_join": false,
  "mqtt": {
    "base_topic": "zigbee2mqtt",
    "server": "mqtt://core-mosquitto",
    "user": "DVES_USER",
    "password": "mypassword"
  },
  "serial": {
    "port": "/dev/ttyACM0"
  },
  "advanced": {
    "pan_id": 6754,
    "channel": 11,
    "network_key": [
      1,
      3,
      5,
      7,
      9,
      11,
      13,
      15,
      0,
      2,
      4,
      6,
      8,
      10,
      12,
      13
    ],
    "availability_blacklist": []
  },
  "ban": [],
  "whitelist": [],
  "queue": {},
  "socat": {
    "enabled": false,
    "master": "pty,raw,echo=0,link=/dev/ttyZ2M,mode=777",
    "slave": "tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5",
    "restartdelay": 1,
    "initialdelay": 1,
    "options": "-d -d",
    "log": false
  },
  "mqtt_base_topic": "zigbee2mqtt",
  "mqtt_server": "mqtt://homeassistant",
  "serial_port": "/dev/ttyACM0",
  "network_key": [],
  "mqtt_user": "DVES_USER",
  "mqtt_pass": "mypassword",
  "disable_led": true
}

Instructions say:

When upgrading, you should use this to fill in the relevant values into your new config, particularly the network key, to avoid breaking your network and having to repair all of your devices.

But I can’t understand what exactly I have to do.
Service does not start and I rolled back to the previous snapshot.
Can anybody please guide me?
Thanks.

I’m just guessing, but before you had

server: mqtt://homeassistant

and now you have

"server": "mqtt://core-mosquitto"

It seems a different mqtt server

Hi.
I already tried to change it, but service does not start anyway.
Then… it looks like the old config is appended to the new one.
More, I don’t know what to do with the network key.
Thank you for trying to help.

What you could try : save your configuration.yaml somewhere, delete all contents on your RbPi, and then try to start it. There seems to be information in it that has moved to the new JSON.

You mean that maybe it doesn’t get updated, so if I remove it, it will create a new one?