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

It seems someone created a 3rd model of a case for CC2531: https://www.thingiverse.com/thing:2947863

2 Likes

Yes!! Milestone. Today I was able to turn off the Xiaomi Gateway! Thank you guys for the work you put into this project!

3 Likes

Nice work @doubleUS! Congratulations! How about the range? Did it work with everything on your home? Thanks!

@Schneider: I was surprised about the range. My Pi3 with the sniffer is on the ground floor and I have two Ikea bulbs and a Xiaomi Mijia wireless switch on the second floor which works flawlessly.

1 Like

Have now successfully connected an xiaomi button.
But how can i now link my philips hue bulbs and set an group of 2 light bulbs and set the brightness for both together?
At the moment they’re linked to the hue bridge…

Amazing! Very good to know that. I am still waiting for the sniffer and tools to flash to arrive. Thanks a lot mate! Congrats again!

Question for those with Xiaomi door/window sensors - if you restarted HA and then opened a sensor when zigbee2mqtt can’t communicate with HA (monitor with journalctl -u zigbee2mqtt.service -f and then open a sensor when Not connected to MQTT server! appears), does the updated on/off status appear ok within the States page on HA?

The answer should be yes at the moment because the wiki advises setting retain: true within the Device specific configuration wiki page https://github.com/Koenkk/zigbee2mqtt/wiki/Device-specific-configuration which is a working solution.

However, this method isn’t the best solution so @Koenkk has been working on a HA based method during the later part of this issue on Github: https://github.com/Koenkk/zigbee2mqtt/issues/105#issuecomment-396375634 which I’ve been helping to test. We wondered if someone else could help with testing as well please because it’s not working on my HA setup, yet is ok on Koenkk’s build.

This test involves setting retain: true on HA (see below) and removing the retain: true lines on zigbee2mqtt 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'
    retain: true
  will_message:
    topic: 'hass/status'
    payload: 'offline'
    retain: true

For consistency, only those with this setup/config should test please:

TIA!

I have one device left to migrate everything works very good. Only annoying thing is the xiaomi buttons not working as they use to for events, so everything is MQTT now.

Hi all i am having some difficulty on getting it to work properly.
I managed to flash the firmware on the first go (to my surprise) and i am running on a raspberry pi3.
For some reason i complete step 5 on Running.
if i send the command: npm start everything is started and is in green except the 3 discovery lines that gives warning, and i receive a mqtt message with status one.
after i setup the service and add the configuration file and check service status I get:

● zigbee2mqtt.service - zigbee2mqtt
   Loaded: loaded (/etc/systemd/system/zigbee2mqtt.service; disabled; vendor pre
   Active: active (running) since Tue 2018-06-19 17:15:02 AEST; 2s ago
 Main PID: 19402 (npm)
   CGroup: /system.slice/zigbee2mqtt.service
           ├─19402 npm
           ├─19413 sh -c node index.js
           └─19414 node index.js

Jun 19 17:15:02 hassbian systemd[1]: Started zigbee2mqtt.
Jun 19 17:15:04 hassbian npm[19402]: > [email protected] start /opt/zigbee2mqtt
Jun 19 17:15:04 hassbian npm[19402]: > node index.js
lines 1-12/12 (END)

I don’t think the shepherd is on since is that line is missing and i don’t get a mqtt message with the status.
if i use the command sudo journalctl -u zigbee2mqtt.service -f
i used to get permission denied to the database /opt/zigbee2mqtt/data/database.db (for some reason the user to the db file was root i moved to pi and give it write permission and i think all is fine now.

Thanks

It seems to be ok from your description, and the status command shows zigbee2mqtt is running (Active: active (running))

Check that everything is owned by pi in /opt/zigbee2mqtt, including the . (dot) line:

pi@zigbeepi:~ $ cd /opt/zigbee2mqtt/
pi@zigbeepi:/opt/zigbee2mqtt $ ls -al
total 528
drwxr-xr-x   9 pi   pi     4096 Jun 14 20:59 .
drwxr-xr-x   4 root root   4096 Jun  7 16:56 ..
-rw-r--r--   1 pi   pi   105403 Jun  7 16:56 architecture.png
drwxr-xr-x   2 pi   pi     4096 Jun 19 17:50 data
drwxr-xr-x   2 pi   pi     4096 Jun  7 16:56 docker
-rw-r--r--   1 pi   pi       71 Jun  7 16:56 .dockerignore
-rw-r--r--   1 pi   pi       25 Jun  7 16:56 .eslintignore
-rw-r--r--   1 pi   pi      372 Jun  7 16:56 .eslintrc.json
drwxr-xr-x   8 pi   pi     4096 Jun 14 20:57 .git
-rw-r--r--   1 pi   pi      938 Jun  7 16:56 .gitignore
-rw-r--r--   1 pi   pi   171440 Jun  7 16:56 header.png
-rw-r--r--   1 pi   pi      211 Jun  7 16:56 index.js
drwxr-xr-x   3 pi   pi     4096 Jun 14 20:57 lib
-rw-r--r--   1 pi   pi    35141 Jun  7 16:56 LICENSE
drwxr-xr-x 224 pi   pi    12288 Jun 14 20:59 node_modules
-rw-r--r--   1 pi   pi   140325 Jun 14 20:57 npm-shrinkwrap.json
-rw-r--r--   1 pi   pi     1153 Jun 14 20:57 package.json
-rw-r--r--   1 pi   pi     3064 Jun 11 20:16 README.md
drwxr-xr-x   2 pi   pi     4096 Jun 14 20:57 support
drwxr-xr-x   2 pi   pi     4096 Jun  7 16:56 .travis
-rw-r--r--   1 pi   pi     2409 Jun  7 16:56 .travis.yml
-rw-r--r--   1 pi   pi      257 Jun  7 20:18 zigbee2mqtt.service

The output of journalctl -u zigbee2mqtt.service -f should look like this:

pi@zigbeepi:~ $ sudo systemctl restart zigbee2mqtt
pi@zigbeepi:~ $
pi@zigbeepi:~ $ journalctl -u zigbee2mqtt.service -f
-- Logs begin at Thu 2016-11-03 17:16:42 GMT. --
Jun 19 17:50:12 zigbeepi npm[16517]: 2018-6-19 17:50:12 INFO zigbee-shepherd started
Jun 19 17:50:12 zigbeepi npm[16517]: 2018-6-19 17:50:12 INFO Currently 2 devices are joined:
Jun 19 17:50:12 zigbeepi npm[16517]: 2018-6-19 17:50:12 INFO window_ensuite_velux (0x00158d0001b149eb): MCCGQ11LM - Xiaomi Aqara door & window contact sensor (EndDevice)
Jun 19 17:50:12 zigbeepi npm[16517]: 2018-6-19 17:50:12 INFO window_bed2_mainleft (0x00158d000245b389): MCCGQ11LM - Xiaomi Aqara door & window contact sensor (EndDevice)
Jun 19 17:50:12 zigbeepi npm[16517]: 2018-6-19 17:50:12 WARN `permit_join` set to  `true` in configuration.yaml.
Jun 19 17:50:12 zigbeepi npm[16517]: 2018-6-19 17:50:12 WARN Allowing new devices to join.
Jun 19 17:50:12 zigbeepi npm[16517]: 2018-6-19 17:50:12 WARN Set `permit_join` to `false` once you joined all devices.
Jun 19 17:50:12 zigbeepi npm[16517]: 2018-6-19 17:50:12 INFO Zigbee: allowing new devices to join.
Jun 19 17:50:12 zigbeepi npm[16517]: 2018-6-19 17:50:12 INFO Connecting to MQTT server at mqtt://192.168.1.50
Jun 19 17:50:12 zigbeepi npm[16517]: 2018-6-19 17:50:12 INFO zigbee-shepherd ready
Jun 19 17:50:16 zigbeepi npm[16517]: 2018-6-19 17:50:16 INFO Connected to MQTT server
Jun 19 17:50:16 zigbeepi npm[16517]: 2018-6-19 17:50:16 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/state', payload: 'online'

What does the output of your logs look like?

1 Like

Is there way to turn off green LED?

it’s so bright

5 Likes

Thanks for your help. Just looked at my list of files and all are same as yours.
The one that gave me permission error is database.db from data folder. for some reason it was under root not pi and is not shown in to the list since is in the data folder.
It seams that everything is working fine about to add some of my switches etc…
Just finished adding my devices without a problem.
Thanks

Same here, thinking to disolder it or add some electric tape on it.

Koenkk Thank you so much to all the contributors this is amazing. Finally i managed to take off my hub.
Once again 10000 thanks and much more.

2 Likes

@haskimo please open an issue here: https://github.com/Koenkk/zigbee2mqtt/issues This way we can track this as an enhancement.

I suggest you at least look into getting one of those 3d plastic printed cases to reduce the brightness until we can check alternative solutions.

2 Likes

Maybe raise the LED issue against the firmware repo instead/as well?
https://github.com/Koenkk/zigbee2mqtt-firmware
Presumably LED control is a function of the f/w

Just black heatshink the whole thing.

1 Like

Can someone please help me with my automation, i want to use my aqara wall switch single battery powered to control my bathroom light Ikea 1000lm light.

- id: '1529615997019'
  alias: Wandschakelaar badkamer plafond lamp aan
  trigger:
  - event_data:
      click: single
      entity_id: sensor.0x00158d0001834370
    event_type: click
    platform: event
  condition: []
  action:
  - data:
      entity_id: light.0x000b57fffeb72a6d
    service: light.turn_on

Its not working, am i missing something?

Preformatted text

Please post your code properly, using the </> button - see at the very top of this page, and every page on the forum.

In zigbee2mqtt sensors events cannot be used for triggers, they work only once. You need to setup the trigger with mqtt as described in the wiki.

https://github.com/Koenkk/zigbee2mqtt/issues/128

thank you, better now?