Giter Club home page Giter Club logo

zigbee2mqtt's Introduction



Zigbee2MQTT πŸŒ‰ 🐝

Allows you to use your Zigbee devices without the vendor's bridge or gateway.

It bridges events and allows you to control your Zigbee devices via MQTT. In this way you can integrate your Zigbee devices with whatever smart home infrastructure you are using.

The documentation provides you all the information needed to get up and running! Make sure you don't skip sections if this is your first visit, as there might be important details in there for you.

If you aren't familiar with Zigbee terminology make sure you read this to help you out.

Zigbee2MQTT integrates well with (almost) every home automation solution because it uses MQTT. However the following integrations are worth mentioning:




  • Integration implemented natively in Gladys Assistant (documentation).


Architecture

Architecture

Internal Architecture

Zigbee2MQTT is made up of three modules, each developed in its own Github project. Starting from the hardware (adapter) and moving up; zigbee-herdsman connects to your Zigbee adapter and makes an API available to the higher levels of the stack. For e.g. Texas Instruments hardware, zigbee-herdsman uses the TI zStack monitoring and test API to communicate with the adapter. Zigbee-herdsman handles the core Zigbee communication. The module zigbee-herdsman-converters handles the mapping from individual device models to the Zigbee clusters they support. Zigbee clusters are the layers of the Zigbee protocol on top of the base protocol that define things like how lights, sensors and switches talk to each other over the Zigbee network. Finally, the Zigbee2MQTT module drives zigbee-herdsman and maps the zigbee messages to MQTT messages. Zigbee2MQTT also keeps track of the state of the system. It uses a database.db file to store this state; a text file with a JSON database of connected devices and their capabilities. Zigbee2MQTT provides a web-based interface that allows monitoring and configuration.

Developing

Zigbee2MQTT uses TypeScript (partially for now). Therefore after making changes to files in the lib/ directory you need to recompile Zigbee2MQTT. This can be done by executing npm run build. For faster development instead of running npm run build you can run npm run build-watch in another terminal session, this will recompile as you change files.

Supported devices

See Supported devices to check whether your device is supported. There is quite an extensive list, including devices from vendors like Xiaomi, Ikea, Philips, OSRAM and more.

If it's not listed in Supported devices, support can be added (fairly) easily, see How to support new devices.

Support & help

If you need assistance you can check opened issues. Feel free to help with Pull Requests when you were able to fix things or add new devices or just share the love on social media.

zigbee2mqtt's People

Contributors

airdrummingfool avatar andreasbrett avatar andrewlinden avatar carpenike avatar ciotlosm avatar clockbrain avatar dependabot[bot] avatar drafteed avatar dzungpv avatar frenck avatar github-actions[bot] avatar grafalex82 avatar hacker-cb avatar kiall avatar kirovilya avatar koenkk avatar mrskycriper avatar mundschenk-at avatar nerivec avatar nukusinji avatar nurikk avatar presslab-us avatar ptvoinfo avatar qm3ster avatar sebastianheierhoff avatar sjorge avatar slugzero avatar tb-killa avatar thecellmc avatar timoline avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zigbee2mqtt's Issues

Xiaomi Motion Sensor Not sending occupancy:false

I have a motion sensor setup, however it rarely sends a occupancy:false. I currently have it pointing away from everything, so should not have any motion detections.

it is a Motion_Front_Yard (0x00158d00010e49cc): RTCGQ01LM - Xiaomi MiJia human body movement sensor

screenshot_20180520_103140

as you can see, it was true all over night, when we were all asleep. Any help would be appreciated.

devices:
  '0x00158d00010e49cc':
    friendly_name: 'Motion_Front_Yard'
    occupancy_timeout: 30
    retain: false

Todo for first version

  • Wiki: Getting started
  • Wiki: Running the gateway
  • Wiki: Supported devices
  • Wiki: (Bonus) How to integrate with home assistant
  • More robust MQTT connect fail handling
  • Support basic range of devices
  • Improve stability
  • MQTT authentication

Extend range of zigbee network using CC2531/CC2530 routers

The CC2531 does not seem to have as good range as my Xiaomi hub.
Using same type of Xiaomi sensor (new generation reed switch sensor - MCCGQ11LM) I found that the CC2531 is failing to receive updates, where the Xiaomi does. Hub and CC sniffer are in same room ~1.5M apart. The reed sensors are in a room in floor below next to each other.
(Neither network has active/powered devices to act as repeater)

Is there any way to improve range?

  1. I have the dongle on a USB extension to move it away from the metal of my VM server, but I think I can use a longer extension to get further away from the metal...

  2. I can add powered device (e.g.) bulb as a repeater. Problem with this is that bulbs do get hard switched off sometimes. I dont have any zigbee sockets.

  3. There are CC2531 devices with a RF front end and external antenna with supposedly higher range.
    e.g. this one
    But these cost more + less easy to program (need to solder header) + not sure if firmware is compatible with the RFX2401C PA chip

Anything else?

Ikea Tradfri LED1536G5 E12 version is not supported

Another one for you :). This is the same LED1536G5 listed in supported devices, but mine is E12 type plug.

0 22:14:37 INFO New device joined the network!
0 22:14:37 INFO New device with address 0x000b57fffe2d9007 connected!
0 22:14:37 WARN Device with modelID 'TRADFRI bulb E12 WS opal 400lm' is not supported.

Allow to configure QoS

I think it would be a relief if we could also activate the permit_join via mqtt.
This would help if you use the system in combination with the appropriate smarthome system and use your zigbee2mqtt headless.

Another improvement could be the Intergration of QoS.
This would help if we prioritize different Type of Devices and their mqtt Data.
This extension should be configurable for every device themselve.

Support: planned to support devices.

  • MFKZQ01LM: Mi magic cube controller
  • QBKG04LM: Aqara single key wired wall switch
  • QBKG03LM: Aqara double key wired wall switch
  • QBCZ11LM: Aqara wall socket
  • JTYJ-GD-01LM/BW: MiJia Honeywell smoke detector
  • KTBL01LM/KTBL02LM: Aqara/MiJia air conditioning companion, WILL NOT be supported. This device is a gateway an therefore cannot be paired.

Belkin Wemo Bulb

I got this working by adding the following to device.js

    'MZ100': {
        model: 'MZ100',
        vendor: 'Wemo',
        description: 'Belkin WeMo Smart LED Bulb 800 lumen, dimmable',
        supports: 'on/off, brightness',
        homeassistant: [homeassistant.light_brightness]
    },

It shows in HomeAssistant and I'm able to control it, but I still get these messages:

Zigbee publish to '0x94103ef6bf428aad', genOnOff - on - {} - 1
Zigbee publish to '0x94103ef6bf428aad', genLevelCtrl - moveToLevel - {"level":6,"transtime":0} - 1
MQTT publish, topic: 'zigbee2mqtt/0x94103ef6bf428aad', payload: '{"state":"ON"}'
No converter available for 'MZ100' with cid 'genLevelCtrl' and type 'devChange'
Please create an issue on https://github.com/Koenkk/zigbee2mqtt/issues with this message.
Zigbee publish to '0x94103ef6bf428aad', genOnOff - off - {} - 1
MQTT publish, topic: 'zigbee2mqtt/0x94103ef6bf428aad', payload: '{"state":"OFF"}'
No converter available for 'MZ100' with cid 'genOnOff' and type 'devChange'
Please create an issue on https://github.com/Koenkk/zigbee2mqtt/issues with this message.

No converter available

I have a worning come up that i don't know what to do with:

2018-5-12 11:58:25 WARN No converter available for 'WXKG02LM' with cid 'genBasic' and type 'attReport'
2018-5-12 11:58:25 WARN Please create an issue on https://github.com/Koenkk/zigbee2mqtt/issues with this message.

this is for a double switch, which works for left, right and both clicks. so not sure what this actually means!

Docker

  • arm32v6 (E.G. raspberry pi)
  • amd64

Library appends to payload previous messages instead of sending just what is received.

Messages get merged on subsequent calls from same device. This is more of a problem for example on Xiaomi Cube where you can have rotate with two parameters (action and direction) vs normal actions where you have only one.

Update: I've noticed the action was moved to rotate_left/ rotate_right which makes more sense, but I do think that messages on MQTT should match what is received from device and not combine messages unless we always send all attributes.

Actual

2018-5-7 22:57:20 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0001fa5c9d', payload: '{"temperature":26.86}'
2018-5-7 22:57:20 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0001fa5c9d', payload: '{"temperature":26.86,"humidity":36.63}'
2018-5-7 22:57:20 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0001fa5c9d', payload: '{"temperature":26.86,"humidity":36.63,"pressure":970}'

Expected:

2018-5-7 22:57:20 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0001fa5c9d', payload: '{"temperature":26.86}'
2018-5-7 22:57:20 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0001fa5c9d', payload: '{"humidity":36.63}'
2018-5-7 22:57:20 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0001fa5c9d', payload: '{"pressure":970}'

Sengled Element Classic support?

Would it be possible to add support for the Sengled element classic series of lightbulbs? (They are a good low cost hue white alternative).

Per device state

We have a topic with the state of the gateway but we miss a topic per device with the state of the device.

This is important to know if a device has become disconnected/powerer_off/removed

Hue dimmer switch

I hit the setup button on the back of the switch, and successfully paired the switch.
Pressing any button on the switch does nothing.
Interestingly, no light shows in the upper left corner on the device (like it usually does) when a button is pressed.

Is there additional support required in the sniffer firmware required to support this device? It would be great to be able to drop the hue hub all together and use my own home grown solution.

Below is the addition to the devices.js file:

{
'RWL020': {
        model: '324131092621',
	vendor: 'Philips',
	description: 'Hue Dimmer Switch',
        supports: 'single, double, triple, quadruple, many and long click',
        homeassistant: [homeassistant.sensor_click]
    }
}

Refactor & rename

  • For proper MQTT command support.
  • Name change -> we can handle more than only Xiaomi now (TRADFRI also).

Running in Docker

Hello @Koenkk ,

Thanks for all your great work.

I am having some issues running the code in docker, My setup is using Libreelec (Kodi) with the docker addon. Had to go via this route, as I am having an issue with range and instead of trying to get a new Pi, I may as well maximise the Pis with Kodi in the other rooms; then just buy a new sniffer.

I get the following error when I try to run the code

#docker -H 0.0.0.0:2375 run -it -v $(pwd)/.config/share/data:/app/data --device=/dev/ttyAMA0 koenkk/zigbee2mqtt:arm32v6
Using '/app/data' as data directory

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

2018-5-22 05:43:06 INFO Starting zigbee-shepherd
2018-5-22 05:43:09 ERROR Error while starting zigbee-shepherd!
2018-5-22 05:43:09 ERROR Failed to start
^C2018-5-22 05:43:19 ERROR Not connected to MQTT server!
2018-5-22 05:43:19 ERROR Cannot send message: topic: 'zigbee2mqtt/bridge/state', payload: 'offline
2018-5-22 05:43:19 INFO zigbee-shepherd stopped

It seems not to be connecting to my mqtt broker, which I have setup in the configuration.yaml file. I am sure that mqtt configuration is right, as I have used it in another setup, which is not based on using the docker.

Please I need help in pointing me to the logs so I can see what exactly the issue is. The logs in the /data directory says the same above, so doesn't help. I need to know if its an authentication issue (which I doubt), or network or something.

Though looking at the solution based on using the CC2530 based Zigbee coordinator and router, but still will be nice to just get a solution on this one.

Thanks and kind regards

Group support

Hi there,

I'm using groups for my IKEA TrΓ₯dfri bulbs - will that be supported/work with this also?

LED1623G12 E26 version not supported

Thank you for this project, just getting started with your Docker container.

I have the Ikea Tradfri LED1623G12 model bulb, but in E26 plug.

0 19:30:00 INFO New device with address 0x000b57fffe2f1df7 connected!
0 19:30:00 WARN Device with modelID 'TRADFRI bulb E26 opal 1000lm' is not supported.

Seems this would be a simple addition, but I am not sure how to edit the device files with the Docker container. Can you advise how best to do this with Docker? Can the needed files be written to a volume so that I can edit them?

Sometimes on pairing of new devices process exists with error

Error:

2018-5-10 11:59:48 INFO Zigbee: allowing new devices to join.
spinlock: false []
/home/user/zigbee2mqtt/node_modules/q/q.js:155
                throw e;
                ^

Error: Unhandled "error" event. (Cannot get the Node Descriptor of the Device: 0x00158d000110828c)
    at ZShepherd.emit (events.js:185:19)
    at /home/user/zigbee2mqtt/node_modules/zigbee-shepherd/lib/components/controller.js:609:28
    at _rejected (/home/user/zigbee2mqtt/node_modules/q/q.js:864:24)
    at /home/user/zigbee2mqtt/node_modules/q/q.js:890:30
    at Promise.when (/home/user/zigbee2mqtt/node_modules/q/q.js:1142:31)
    at Promise.promise.promiseDispatch (/home/user/zigbee2mqtt/node_modules/q/q.js:808:41)
    at /home/user/zigbee2mqtt/node_modules/q/q.js:624:44
    at runSingle (/home/user/zigbee2mqtt/node_modules/q/q.js:137:13)
    at flush (/home/user/zigbee2mqtt/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
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!     /home/user/.npm/_logs/2018-05-10T09_03_52_289Z-debug.log

Debug:

0 info it worked if it ends with ok
1 verbose cli [ '/home/user/.nvm/versions/node/v8.8.1/bin/node',
1 verbose cli   '/home/user/.nvm/versions/node/v8.8.1/bin/npm',
1 verbose cli   'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /home/user/.nvm/versions/node/v8.8.1/lib/node_modules/npm/bin/node-gyp-bin:/home/user/zigbee2mqtt/node_modules/.bin:/home/user/.nvm/versions/node/v8.8.1/bin:/usr/local/sbin:/usr/local/bin:/usr/local/apache-maven/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/go/bin:/home/user/esp/xtensa-esp32-elf/bin
9 verbose lifecycle [email protected]~start: CWD: /home/user/zigbee2mqtt
10 silly lifecycle [email protected]~start: Args: [ '-c', 'node index.js' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `node index.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/home/user/.nvm/versions/node/v8.8.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (/home/user/.nvm/versions/node/v8.8.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:927:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/user/zigbee2mqtt
16 verbose Darwin 17.5.0
17 verbose argv "/home/user/.nvm/versions/node/v8.8.1/bin/node" "/home/user/.nvm/versions/node/v8.8.1/bin/npm" "start"
18 verbose node v8.8.1
19 verbose npm  v5.4.2
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `node index.js`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Seems this is related to timeouts during connection. I had this happen on the cube a couple of times. If I keep pressing "link" button during connection it gets through.

TRADFRI bulb E27 opal 1000lm

2018-5-6 18:51:11 WARN Device with modelID 'TRADFRI bulb E27 opal 1000lm' is not supported.
2018-5-6 18:51:11 WARN Please create an issue on https://github.com/Koenkk/zigbee2mqtt/issues to add support for your device

Please add to lib/devices.js

    'TRADFRI bulb E27 opal 1000lm': {
        model: 'LED1623G12',
        vendor: 'IKEA',
        description: 'TRADFRI LED bulb E27 1000 lumen, dimmable',
        supports: 'on/off, brightness',
        homeassistant: [homeassistant.light_brightness_colortemp]
    }

2018-5-6 18:52:13 INFO 0x000b57fffe3298aa (0x000b57fffe3298aa): LED1623G12 - IKEA TRADFRI LED bulb E27 1000 lumen, dimmable

Extract shepherdSettings in configuration.yaml

Please help extract shepherdSettings in configuration.yaml.

So far we need for the hassio addon to persist data for the following to change:

dbPath: `${__dirname}/../data/database.db`

I assume the same is true for the other setting if you have multiple CC2531:

net: {panId: 0x1a62}

I have a proposal for cooperation with you

Hi, Koen!

We are both developing the subject of Zigbee-devices (Xiaomi and other), so I propose to combine our experience.
You do the mqtt-version, and I'm the adapter for the ioBroker. But both these decisions use NodeJS and Zigbee-Shepherd library.
Therefore, I propose to create a common library of device and parsers for further use in your and my applications. This library should depend only on the zigbee-shepherd, handle the zigbee events, and generate processed events.

I am accustomed to your approach to the architecture of parsers (unlike my single file) - I suggest taking this as a basis.

I think this is an excuse not to do double work and not to copy the code from the library to the library.

What can you say about this?

p.s. Sorry for my English

Unhandled Error - Cannot get the Node Descriptor

I am trying to pair a Xiaomi round switch with a newly create bridge, and have this error when i try to pair it. it's code majigga is WXKG01LM

Unfortunately it crashes the bridge :(

when setting pairing mode i get spinlock: false []

where as others have given me spinlock: true [ { func: [Function: func], ieeeAddr: '0x00158d00012568ae' } ] or spinlock: true []

/home/leigh/apps/zigbee2mqtt/node_modules/q/q.js:155
                throw e;
                ^

Error: Unhandled "error" event. (Cannot get the Node Descriptor of the Device: 0x00158d0001256963 (Error: Timed out after 10000 ms))
    at ZShepherd.emit (events.js:186:19)
    at /home/leigh/apps/zigbee2mqtt/node_modules/zigbee-shepherd/lib/components/controller.js:609:28
    at _rejected (/home/leigh/apps/zigbee2mqtt/node_modules/q/q.js:864:24)
    at /home/leigh/apps/zigbee2mqtt/node_modules/q/q.js:890:30
    at Promise.when (/home/leigh/apps/zigbee2mqtt/node_modules/q/q.js:1142:31)
    at Promise.promise.promiseDispatch (/home/leigh/apps/zigbee2mqtt/node_modules/q/q.js:808:41)
    at /home/leigh/apps/zigbee2mqtt/node_modules/q/q.js:624:44
    at runSingle (/home/leigh/apps/zigbee2mqtt/node_modules/q/q.js:137:13)
    at flush (/home/leigh/apps/zigbee2mqtt/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
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!     /home/leigh/.npm/_logs/2018-05-12T03_44_42_166Z-debug.log

Request a report of status of device

I can't find how request current status of device...
For example, a temperature sensor sends a report when the values changed significantly, but i want it regularly (hourly, minutely). Like "heartbeat" with Xiaomi gateway.

Trying to pair an Ikea Tradfri dimmer causes crash

I have tried to pair an Ikea dimmer like this.

To be honest I was not expecting it to work as I understand that supporting this device is complex due to the way it works.

Nonetheless, here is the log from the crash:

`2018-5-17 19:39:29 INFO Zigbee: allowing new devices to join.
spinlock: false []
spinlock: true []
spinlock: true [ { func: [Function: func], ieeeAddr: '0x000b57fffe13a3ef' } ]
already in joinqueue
/app/node_modules/q/q.js:155
throw e;
^

Error: Unhandled "error" event. (Cannot get the Node Descriptor of the Device: 0x000b57fffe13a3ef (Error: Timed out after 10000 ms))
at ZShepherd.emit (events.js:186:19)
at /app/node_modules/zigbee-shepherd/lib/components/controller.js:609:28
at _rejected (/app/node_modules/q/q.js:864:24)
at /app/node_modules/q/q.js:890:30
at Promise.when (/app/node_modules/q/q.js:1142:31)
at Promise.promise.promiseDispatch (/app/node_modules/q/q.js:808:41)
at /app/node_modules/q/q.js:624:44
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)
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-17T18_39_57_529Z-debug.log
`

Schematics and open questions

The following image is linked in the readme:

I guess a more detailed schematic looks like this?

[Generic MQTT gateway] <-> [Linux with zigbee2mqtt software] <-> [CC2531 dongle] <-> [Zigbee device 1-N]
  • I have the dongle as Zigbee connector
  • This software interacts with the dongle and runs on Linux
  • The software needs a MQTT gateway address to send/receive data

My open questions are:

  1. Does it need to be the CC2531 dongle or can the software work with any dongle?
  2. Why does the CC2531 need a custom firmware? Is this firmware part of the project / what does it change?
  3. Is my assumption correct that I can use a Raspberry Pi Zero together with this software and the CC2531 dongle to get a Zigbee to MQTT bridge?
  4. Can I have the setup described in 3 multiple times to cover my whole house? - What happens if they overlap?
  5. Is there a cheaper/less power consumption way to cover my whole house?

Installation issues

Hi, great to see renewed interest in this project. The old project I could install quite easily. However, I'm running into issue with this version. See below dump.

npm version = 6.0.0
Node version = 8.11.1

Could you please help?

pi@raspberrypi:~/zigbee2mqtt` $ npm start

> [email protected] start /home/pi/zigbee2mqtt
> node index.js

/home/pi/zigbee2mqtt/node_modules/serialport/node_modules/bindings/bindings.js:91
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 β†’ /home/pi/zigbee2mqtt/node_modules/serialport/build/serialport.node
 β†’ /home/pi/zigbee2mqtt/node_modules/serialport/build/Debug/serialport.node
 β†’ /home/pi/zigbee2mqtt/node_modules/serialport/build/Release/serialport.node
 β†’ /home/pi/zigbee2mqtt/node_modules/serialport/out/Debug/serialport.node
 β†’ /home/pi/zigbee2mqtt/node_modules/serialport/Debug/serialport.node
 β†’ /home/pi/zigbee2mqtt/node_modules/serialport/out/Release/serialport.node
 β†’ /home/pi/zigbee2mqtt/node_modules/serialport/Release/serialport.node
 β†’ /home/pi/zigbee2mqtt/node_modules/serialport/build/default/serialport.node
 β†’ /home/pi/zigbee2mqtt/node_modules/serialport/compiled/8.11.1/linux/arm/serialport.node
    at bindings (/home/pi/zigbee2mqtt/node_modules/serialport/node_modules/bindings/bindings.js:88:9)
    at Object.<anonymous> (/home/pi/zigbee2mqtt/node_modules/serialport/lib/bindings.js:3:35)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/pi/zigbee2mqtt/node_modules/serialport/lib/serialport.js:12:25)
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!     /home/pi/.npm/_logs/2018-05-09T09_55_35_050Z-debug.log
`

Unhandled Error - Index Out of Range

another error that just popped up... this seems to happen after getting data from a xiaomi temp/humidity sensor WSDCGQ01LM.

buffer.js:977
    throw new RangeError('Index out of range');
    ^

RangeError: Index out of range
    at checkOffset (buffer.js:977:11)
    at Buffer.readUInt8 (buffer.js:1015:5)
    at Object.zcl.header (/home/leigh/apps/zigbee2mqtt/node_modules/zcl-packet/lib/zcl.js:73:24)
    at Object.header (/home/leigh/apps/zigbee2mqtt/node_modules/zigbee-shepherd/lib/components/zcl.js:10:32)
    at dispatchIncomingMsg (/home/leigh/apps/zigbee2mqtt/node_modules/zigbee-shepherd/lib/components/af.js:631:29)
    at Controller.incomingMsgHandler (/home/leigh/apps/zigbee2mqtt/node_modules/zigbee-shepherd/lib/components/af.js:714:12)
    at emitOne (events.js:116:13)
    at Controller.emit (events.js:211:7)
    at Object.bridge._areqEventBridge (/home/leigh/apps/zigbee2mqtt/node_modules/zigbee-shepherd/lib/components/event_bridge.js:15:16)
    at CcZnp.<anonymous> (/home/leigh/apps/zigbee2mqtt/node_modules/zigbee-shepherd/lib/components/controller.js:98:16)
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!     /home/leigh/.npm/_logs/2018-05-12T03_54_07_130Z-debug.log

Error when paired device is not known

Really impressed with the progress from the original work of Andrew. I found a little error.

I previously paired devices to my dongle (with the Andrew version of the software). With the new fork when the program receives a message from an previuosly paired device it crashes, perhaps you can easily ctach this error.

2018-5-9 17:55:40 INFO MQTT publish, topic: 'zigbee2mqtt/sensorWoonkamer', payload: '{"temperature":26.67,"humidity":49.44,"pressure":1002}'
spinlock: false []
/home/pi/zigbee2mqtt/node_modules/q/q.js:155
                throw e;
                ^

Error: Unhandled "error" event. (Cannot get the Node Descriptor of the Device: 0x00158d00012434f4 (Error: Timed out after 10000 ms))
    at ZShepherd.emit (events.js:186:19)
    at /home/pi/zigbee2mqtt/node_modules/zigbee-shepherd/lib/components/controller.js:609:28
    at _rejected (/home/pi/zigbee2mqtt/node_modules/q/q.js:864:24)
    at /home/pi/zigbee2mqtt/node_modules/q/q.js:890:30
    at Promise.when (/home/pi/zigbee2mqtt/node_modules/q/q.js:1142:31)
    at Promise.promise.promiseDispatch (/home/pi/zigbee2mqtt/node_modules/q/q.js:808:41)
    at /home/pi/zigbee2mqtt/node_modules/q/q.js:624:44
    at runSingle (/home/pi/zigbee2mqtt/node_modules/q/q.js:137:13)
    at flush (/home/pi/zigbee2mqtt/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
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!     /home/pi/.npm/_logs/2018-05-09T17_56_21_421Z-debug.log

Lutron Connected Bulb Remote

Is it possible to add the Lutron Connected Bulb Remote? It is a 4-button ZLL dimmer.

It's a bit of an odd device, as it is generally paired to the bulbs directly rather than the hub. The 4 buttons connect directly to bulbs to do the following:

  • Light - 100%
  • Brighter
  • Dimmer
  • Light - 0%

Ideally, zigbee2mqtt would be able to read the commands directly, so that I could use them as plain old button controllers.

Before I buy a bunch of ZigBee hardware from China to test this, are there any caveats I should be aware of?

How to get the values of new devices

The docs tell me how to support new devices but I'm not sure what to put into zigbee2mqtt.js. How do I know that I need to put in msg.data.data['measuredValue'] - I guess it is not always msg.data.data['measuredValue'].

Support for Hue motion sensor SML001

In this issue I will capture the steps taken in order to implement support for the Hue motion sensor. Both for myself and the community in order to learn.

Step1: Pairing the sensor

The sensor was previously paired to the Hue bridge. After pressing the setup button at the back for 1 second the led on the device flashed green and orange. After 30 seconds it was sucessfully paired.

the following message was displayed.

2018-5-19 10:15:22 WARN Device with modelID 'SML001' is not supported.
2018-5-19 10:15:22 WARN Please create an issue on https://github.com/Koenkk/zigbee2mqtt/issues to add support for your device
2018-5-19 10:15:22 WARN Device with modelID 'SML001' is not supported.
2018-5-19 10:15:22 WARN Please create an issue on https://github.com/Koenkk/zigbee2mqtt/issues to add support for your device

Next step adding it to lib/devices.js

To be continued

Add support for hassio addon

I think this addon is great and deserves to be integrated into homeassistant easier by becoming a hassio addon.

I'm willing to help (first time doing addons) but instead of trying to copy your repo and hack it to make it work, I thought it's best to ask :)

I have already tried to make it a local addon by reusing some of the work you've been doing but so far haven't succeeded.

Things I've noticed so far:

  1. Your Dockerfile uses ADD . which adds a lot more files than required inside docker. I think would be best to create a new folder with just the required files (data, lib and the js in root) and name it app or so, to avoid the moving of files around
  2. You should use COPY from outside for start.sh instead of RUN cp inside, looks cleaner

Doing an addon with your config should be fairly straight forward by using a config similar to:

{
    "name": "zigbee2mqtt",
    "version": "1",
    "slug": "zigbee2mqtt",
    "description": "zigbee2mqtt addon",
    "url": "https://github.com/Koenkk/zigbee2mqtt",
    "startup": "before",
    "boot": "auto",
    "devices": ["/dev/ttyACM0:/dev/ttyACM0:rwm"],
    "options": {
      "mqtt_host": "mqtt://localhost"
    },
    "schema": {
      "mqtt_host": "str"
    }
  }

Note: I will keep trying to start it as local addon to see if I encounter other blockers.

Examples of addon repos: https://github.com/hassio-addons/addon-homebridge

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.