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

I am having problems with the Docker install of zigbee2mqtt.

This is my docker-compose.yaml file.

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

This works but it gives an error in the docker console and it keeps shutting down mqtt server.

Using '/app/data' as data directory

> [email protected] start /app
> node index.js

2018-5-19 11:28:11 INFO Starting zigbee-shepherd
2018-5-19 11:28:12 INFO zigbee-shepherd started
2018-5-19 11:28:12 INFO Currently 0 devices are joined:
2018-5-19 11:28:12 INFO Connecting to MQTT server at 192.168.85.5

/app/node_modules/q/q.js:155
                throw e;
                ^
Error: Missing protocol

    at Object.connect (/app/node_modules/mqtt/lib/connect/index.js:64:13)
    at MQTT.connect (/app/lib/mqtt.js:21:28)
    at zigbee.start (/app/lib/controller.js:42:27)
    at shepherd.start (/app/lib/zigbee.js:29:13)
    at /app/node_modules/q/q.js:2055:17
    at runSingle (/app/node_modules/q/q.js:137:13)
    at flush (/app/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node index.js`
npm ERR! Exit status 1
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/2018-05-19T11_28_12_389Z-debug.log

Using '/app/data' as data directory
> [email protected] start /app
> node index.js

Any help on this pleaseā€¦

EDIT :slight_smile:
Got it working, had just in the configuration.yaml file -

server:ā€˜192.168.85.5ā€™ instead of -

mqtt:
base_topic: zigbee2mqtt
server: ā€˜mqtt://192.168.85.5ā€™
user: xx
password: xx

Thanks and sorry for worrying any of youā€¦

@Koenkk Thanks for this project. i manged to get my Ikea bulbs working in HA.
But i donā€™t understand how to change the entity_id name.

The friendly_name has changed but the entity_id is still the same.

Any help to change this.

EDIT:

Ok found it. Its in the zigbee2mqtt configuration.yaml fileā€¦

/ List of devices, automatically updates when new devices join, E.G.:
/ ā€˜0x00158d0001d8e1d2ā€™:
/ friendly_name: bedroom_switch # Friendly name to be used in MQTT topic
/ retain: true # Retain MQTT messages
devices:
ā€˜0x000b57fffeaff3ecā€™:
friendly_name: ā€˜0x000b57fffeaff3ecā€™
retain: false
ā€˜0x000b57fffe9b7a5eā€™:
friendly_name: ā€˜0x000b57fffe9b7a5eā€™
retain: false
ā€˜0x000b57fffeaa2748ā€™:
friendly_name: ā€˜0x000b57fffeaa2748ā€™
retain: false

I seem to need to look at this file abit moreā€¦

Maybe Iā€™m having a clueless moment but isnā€™t this more or less the same thing that deconz and Conbee does?

1 Like

Hereā€™s one answer to your question. Iā€™m sure thereā€™s more.

So functionally it does the same thing just goes about it differently.

Could this work with the Philips Hue Motion Sensors and Dimmers?


Does anyone know if the hardware is available anywhere in Europe? I get stung with a ā‚¬7 customs fee for every package I receive from China and so far I havenā€™t found a shop with all three items in stock, they either have the debugger or the Cable+dongle so itā€™s at least two packages and thus two fees (essentially doubling the price). :frowning:

I am in the UK and used Ebay , Parts from China post free no customs charge.

Iā€™m not in the UK but in Sweden and the Swedish Post has recently begun charging a customs fee on all packages from outside the EU because they were flooded with low value packages from China. Unfortunately they canā€™t handle the large volumes and it takes weeks or even a month to get your package after paying the customs charges.

I checked Amazon.co.uk and eBay.co.uk for European sellers but I couldnā€™t find all items and those available were 10x the Chinese price. I guess Iā€™ll just have to bite the bullet and order from Chinaā€¦

1 Like

When trying to add anything other than the aqara double switch or the aqara door/window sensor i get the following message on the hassio addon (danielwelch)

spinlock: false []
2018-5-24 14:49:12 INFO New device with address 0x00158d0001a35dfc connected!
/app/node_modules/yaml-js/lib/parser.js:553
            throw new exports.ParserError('while parsing a flow mapping', this.marks.slice(-1)[0], "expected ',' or '}', but got " + token.id, token.start_mark);
            ^
while parsing a flow mapping
  on line 4, column 25
expected ',' or '}', but got :
  on line 5, column 23
    at ParserError.YAMLError [as constructor] (/app/node_modules/yaml-js/lib/errors.js:70:46)
    at ParserError.MarkedYAMLError [as constructor] (/app/node_modules/yaml-js/lib/errors.js:90:45)
    at new ParserError (/app/node_modules/yaml-js/lib/parser.js:17:48)
    at Loader.__dirname.Parser.Parser.parse_flow_mapping_key (/app/node_modules/yaml-js/lib/parser.js:553:19)
    at Loader.__dirname.Parser.Parser.check_event (/app/node_modules/yaml-js/lib/parser.js:61:48)
    at Loader.__dirname.Composer.Composer.compose_mapping_node (/app/node_modules/yaml-js/lib/composer.js:248:20)
    at Loader.__dirname.Composer.Composer.compose_node (/app/node_modules/yaml-js/lib/composer.js:160:21)
    at Loader.__dirname.Composer.Composer.compose_mapping_node (/app/node_modules/yaml-js/lib/composer.js:250:27)
    at Loader.__dirname.Composer.Composer.compose_node (/app/node_modules/yaml-js/lib/composer.js:160:21)
    at Loader.__dirname.Composer.Composer.compose_mapping_node (/app/node_modules/yaml-js/lib/composer.js:250:27)
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/2018-05-24T13_49_12_807Z-debug.log

Edited

My sniffer kind of works. I have a xiaomi cube, but I cannot get my device to pair. If I enable to debugger, I see the device send signals, I also see its addresse, but It simply wonā€™t pair. Iā€™m using Daniel Welchā€™s repo for Hassio. I also have Aqara Wall switches which wonā€™t pair (long press them until they stop blinking). Any advice?

Edit:

Ok, I got the cube running, I just had to press the ā€œlinkā€ button inside the cube for a longer period. I still canā€™t pair it with my Aqara Wall Switch though. Nothing what I do seems to make it find itā€¦ any help?

Iā€™m having a difficult time with configuring my mqtt url. I run the MQTT add-on for HassIO on one Pi but iā€™ve installed your package on a separate Pi. What would I put for the MQTT server URL?

In my home assistant configuration I have the MQTT component set up per below. Any help would be appreciated.

mqtt:
  broker: core-mosquitto
  discovery: true
  discovery_prefix: homeassistant
mqtt://core-mosquitto

@nickrout i tried and its still not working,

2018-5-25 10:29:53 INFO Starting zigbee-shepherd
2018-5-25 10:29:54 INFO zigbee-shepherd started
2018-5-25 10:29:54 INFO Currently 0 devices are joined:
2018-5-25 10:29:54 INFO Connecting to MQTT server at mqtt://core-mosquitto
2018-5-25 10:29:54 INFO zigbee-shepherd ready
2018-5-25 10:30:04 ERROR Not connected to MQTT server!

try mqtt://xxx.xxx.xxx.xxx:1883
xxx.xxx.xxx.xxx being the internal IP address of your Hassio server, and 1883 being the port Mosquitto is running on.

For your home assistant configuration.yaml:

mqtt:
  broker: localhost
  discovery: true
  username: mqtt_user
  password: mqtt_pass

Replace ā€œmqtt_userā€ & ā€œmqtt_passā€ with the relevant credentials, or delete the lines if not required.

@sturgeo that worked. Thank you.

How do i add new converters running in a docker container
The node_modules/zigbee-shepherd-converters/devices.js is not in the data directory

please advise

1 Like