Giter Club home page Giter Club logo

hassio-zigbee2mqtt's People

Contributors

bouklett avatar bruvv avatar carldebilly avatar ciotlosm avatar cjsteward avatar danielwelch avatar deisi avatar dherran avatar dmitrybabeshko avatar dzungpv avatar felixstorm-c4a8-adm avatar frankzz avatar g1k avatar jensvanhooydonck avatar johannrichard avatar kasparsd avatar keesschollaart81 avatar kiall avatar kind3r avatar koenkk avatar lennardwesterveld avatar lovelylain avatar ramon-balaguer avatar rstein avatar sabuto avatar samlof avatar thaboom avatar thoj avatar turiok avatar vivantsenior 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

hassio-zigbee2mqtt's Issues

KeyError: 'log_directory'

When the (optional) log_directory parameter is missing I get this error in the logs:

Traceback (most recent call last):
  File "set_config.py", line 97, in <module>
    main(args.options_path, args.data_path)
  File "set_config.py", line 81, in main
    config.set_log_dir(data_path, options['log_directory'])
KeyError: 'log_directory'

How to support new devices - HASS.IO?

My apologies if I'm just being daft... and foremost great work to all involved in this project!

I'm trying to add my Nue branded light switches, but unable to determine how to do this in your HASS.io add-on (e.g. https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices )

The switch is making a connection but I imagine I need to create a converter as per the wiki next? I'm unable to access the necessary converter folders and .js files required by the wiki.

2018-7-3 15:02:14 INFO Connecting with device...
2018-7-3 15:02:14 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"connecting with device"}'
2018-7-3 15:02:14 INFO Device incoming...
2018-7-3 15:02:14 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"device incoming"}'
2018-7-3 15:02:14 INFO New device with address 0x00124b0019e14fa6 connected!
2018-7-3 15:02:14 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"device_connected","message":"0x00124b0019e14fa6"}'
2018-7-3 15:02:14 WARN Device with modelID 'FB56+ZSW1HKJ2.5' is not supported.
2018-7-3 15:02:14 WARN Please see: https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices

no devices join

Hi I have hassio and have setup your hassio-zigbee2mqtt and have the following in the log

[email protected] start /app
node index.js
2018-7-20 10:41:00 INFO Starting zigbee2mqtt version 0.1.0 (commit #ae41b7b)
2018-7-20 10:41:00 INFO Starting zigbee-shepherd
2018-7-20 10:41:04 INFO zigbee-shepherd started
2018-7-20 10:41:04 INFO Currently 0 devices are joined:
2018-7-20 10:41:04 WARN permit_join set to true in configuration.yaml.
2018-7-20 10:41:04 WARN Allowing new devices to join.
2018-7-20 10:41:04 WARN Set permit_join to false once you joined all devices.
2018-7-20 10:41:04 INFO Zigbee: allowing new devices to join.
2018-7-20 10:41:05 INFO Connecting to MQTT server at mqtt://homeassistant
2018-7-20 10:41:05 INFO zigbee-shepherd ready
2018-7-20 10:41:05 INFO Connected to MQTT server
2018-7-20 10:41:05 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/state', payload: 'online'

I have reflashed the usb sniffer and uninstalled the hassio-zigbee addon and have installed the zigbee2mqtt-edge addon and get the same messages as above .I have put the ikea led 1622g12 e27 right beside the usb sniffer in rpi2 .Any help or suggestions would be much appreciated

battery level and voltage on RTCGQ01LM

Hi there! I'm using a template to manage battery stats. I've just found that on Aqara and Mija motion / human body sensors I have this data on illumination sensor card, and only on that - so the ones that haven't it, they can't show. Hope I explained well myself.

Marco

Xiaomi cube not working in hassio addon

I switched from Hassbian to Hassos and found that the Xiaomi Cube MFKZQ01LM that before worked now is not recognized.
This is the log:

 zigbee2mqtt:info 2018-10-3 23:12:40 Device incoming...
  zigbee2mqtt:info 2018-10-3 23:12:40 MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"device incoming"}'
  zigbee2mqtt:warn 2018-10-3 23:13:27 Device with modelID '0x656275635f726f736e65732e696d756c' is not supported.
  zigbee2mqtt:warn 2018-10-3 23:13:27 Please see: https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices

Update docker image on any commit to zigbee2mqtt master branch

Currently, zigbee2mqtt is doesn’t seem to have any form of versioning, as the pace of development is pretty fast. As a result, we’re building the image by just cloning the master branch into our docker container.

In docker hub, a new image is built and pushed with every commit to this repository’s master branch. However, updates to the underlying zigbee2mqtt library are not reflected in images until a new one is built (via changes/commits in this add-on). So users aren’t able to update zigbee2mqtt library if they are using the add-on until a new build.

The most obvious way I’ve seen to handle this is to add a github webhook in the zigbee2mqtt repository that POSTs to a web service (which I’ll create), which in turn calls the Travis API to trigger a build.

@Koenkk would you be willing to add a webhook when the time comes?

Issue with 0.1.1

I’m getting the following since upgrading:

/zigbee2mqtt-0.1.1/node_modules/zcl-packet/lib/foundation.js:683
rudataType(this);
^
TypeError: ru[dataType] is not a function
at Dissolve. (/zigbee2mqtt-0.1.1/node_modules/zcl-packet/lib/foundation.js:683:21)
at Dissolve._transform (/zigbee2mqtt-0.1.1/node_modules/dissolve/index.js:80:16)
at Dissolve.Transform._read (/zigbee2mqtt-0.1.1/node_modules/dissolve/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at Dissolve.Transform._write (/zigbee2mqtt-0.1.1/node_modules/dissolve/node_modules/readable-stream/lib/_stream_transform.js:172:12)
at doWrite (/zigbee2mqtt-0.1.1/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:279:12)
at writeOrBuffer (/zigbee2mqtt-0.1.1/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:266:5)
at Dissolve.Writable.write (/zigbee2mqtt-0.1.1/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:211:11)
at Dissolve.Writable.end (/zigbee2mqtt-0.1.1/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:426:10)
at FoundPayload._getObj (/zigbee2mqtt-0.1.1/node_modules/zigbee-shepherd/node_modules/zcl-packet/lib/foundation.js:242:12)
at getObjCB (/zigbee2mqtt-0.1.1/node_modules/zigbee-shepherd/node_modules/zcl-packet/lib/foundation.js:51:22)
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.

Enable access to host's /dev/serial/by-id devices

When one has more than one USB dongle, hassio will randonmly assign the physical devices to the ttyACM* interfaces. Systems with more than 1 dongle may render usless when they are rebooted by accident. At the moment, the container can't access the serial/by-id devices

~ # docker ps -a
CONTAINER ID        IMAGE                                         COMMAND                  CREATED             STATUS                     PORTS                                                                NAMES
2f0ef30d2662        homeassistant/raspberrypi3-64-homeassistant   "/bin/entry.sh pytho…"   6 days ago          Up 6 days                                                                                       homeassistant
4fa118bce970        homeassistant/aarch64-hassio-supervisor       "python3 -m hassio"      7 days ago          Up 7 days                                                                                       hassos_supervisor
ea5c97a93ad2        dwelch2101/zigbee2mqtt-aarch64                "./run.sh"               9 days ago          Up 9 days                                                                                       addon_7ad98f9c_zigbee2mqtt
253df2a3f200        homeassistant/aarch64-addon-ssh               "/run.sh"                9 days ago          Up 9 days                  0.0.0.0:22->22/tcp                                                   addon_core_ssh
3df813ed1720        homeassistant/aarch64-addon-mariadb           "/usr/bin/entry.sh /…"   9 days ago          Up 9 days                  0.0.0.0:3306->3306/tcp                                               addon_core_mariadb
f62f1df2829d        homeassistant/aarch64-addon-mosquitto         "/run.sh"                9 days ago          Up 9 days                  0.0.0.0:1883-1884->1883-1884/tcp, 0.0.0.0:8883-8884->8883-8884/tcp   addon_core_mosquitto
a6647fd3fc70        homeassistant/aarch64-addon-letsencrypt       "/usr/bin/entry.sh /…"   12 days ago         Exited (1) 12 days ago                                                                          addon_core_letsencrypt
fc8c23a4890b        hassioaddons/node-red-aarch64                 "/init"                  2 weeks ago         Exited (129) 2 weeks ago                                                                        addon_a0d7b954_nodered
~ # docker exec -it ea5c97a93ad2 /bin/ls -l /dev/
total 466
lrwxrwxrwx    1 root     root            13 Aug 27 21:47 fd -> /proc/self/fd
crw-rw-rw-    1 root     root        1,   7 Aug 27 21:47 full
-rwxr-xr-x    1 root     root        476800 Jul 16 00:55 init
drwxrwxrwt    2 root     root            40 Aug 27 21:47 mqueue
crw-rw-rw-    1 root     root        1,   3 Aug 27 21:47 null
lrwxrwxrwx    1 root     root             8 Aug 27 21:47 ptmx -> pts/ptmx
drwxr-xr-x    2 root     root             0 Aug 27 21:47 pts
crw-rw-rw-    1 root     root        1,   8 Aug 27 21:47 random
drwxrwxrwt    2 root     root            40 Aug 27 21:47 shm
lrwxrwxrwx    1 root     root            15 Aug 27 21:47 stderr -> /proc/self/fd/2
lrwxrwxrwx    1 root     root            15 Aug 27 21:47 stdin -> /proc/self/fd/0
lrwxrwxrwx    1 root     root            15 Aug 27 21:47 stdout -> /proc/self/fd/1
crw-rw-rw-    1 root     root        5,   0 Aug 27 21:47 tty
crw-rw----    1 root     audio     166,   0 Aug 27 21:47 ttyACM0
crw-rw----    1 root     audio     166,   1 Sep  5 22:29 ttyACM1
crw-rw----    1 root     audio     204,  64 Aug 27 21:47 ttyAMA0
crw-rw-rw-    1 root     root        1,   9 Aug 27 21:47 urandom
crw-rw-rw-    1 root     root        1,   5 Aug 27 21:47 zero

enabling access to serial/by-id devices would help workaround this undesired behaviour by hardcoding the interface

Timed permit_join?

Hey,

What do you think of doing "timed" permit_join?

I can update documentation & gist to show this as I think would be more helpful for people as it's a bit more secure. We can start with something really high like 10 minutes which should be plenty of time for experiments.

I already did something similar for zha: component here: https://gist.github.com/ciotlosm/3e074c4ba8b32ded32ef1da22b70a7f9 but this is using the already in-service timer, but not hard to produce.

screen shot 2018-06-01 at 11 51 42

The way it would work:

  • User presses input_boolean which starts timer and sets the input_boolean to on
  • Time is visible on interface
  • When timer ends (reaches 0) automation resets input_boolean to off and removes permit_join

MQTT message config

I have an problem to send with MQTT the config permit_join

In mosquito_sub I see the following:
homeassistant/zigbee2mqtt/bridge/state online
homeassistant/zigbee2mqtt/bridge/config/permit_join true

and in the error log from hassio-zigbee2mqtt:

2018-06-21T19:06:05.647Z - info: Starting zigbee2mqtt version 0.0.0 (commit #9dbdfc0)
2018-06-21T19:06:05.724Z - info: Starting zigbee-shepherd
2018-06-21T19:06:07.195Z - info: zigbee-shepherd started
2018-06-21T19:06:07.206Z - info: Currently 0 devices are joined:
2018-06-21T19:06:07.213Z - info: Connecting to MQTT server at mqtt://xxxxxxxxxxxx
2018-06-21T19:06:07.772Z - info: zigbee-shepherd ready
2018-06-21T19:06:07.804Z - info: Connected to MQTT server
2018-06-21T19:06:07.807Z - info: MQTT publish, topic: 'homeassistant/zigbee2mqtt/bridge/state', payload: 'online'
2018-06-21T19:10:00.312Z - warn: Cannot handle MQTT config option 'config' with message 'true'

My config:

{
  "data_path": "/share/zigbee2mqtt",
  "homeassistant": true,
  "permit_join": false,
  "mqtt_base_topic": "homeassistant/zigbee2mqtt",
  "mqtt_server": "mqtt://xxxxxxxxxxxx",
  "serial_port": "/dev/ttyACM1",
  "mqtt_user": "xxxxxxx",
  "mqtt_pass": "xxxxxxxx"
}

Homeassistant config:

mqtt:
  broker: core-mosquitto
  username: !secret mqtt_user
  password: !secret mqtt_password
  discovery: true
  discovery_prefix: homeassistant
  birth_message:
    topic: 'hass/status'
    payload: 'online'
  will_message:
    topic: 'hass/status'
    payload: 'offline'

Can anyone help me to enable the permit_join through MQTT

Rollback using `commit` doesn't work

Log output:

[Info] Configuration written to /share/zigbee2mqtt/configuration.yaml
/app/run.sh: line 17: git: command not found
[2018-06-09 18:59:26] PM2 log: Launching in no daemon mode

"Error: Resource busy, cannot open /dev/ttyACM0"

When I initially set up and configured everything (using a CC2531 stick and the latest firmware as per today), I couldn't get things working using the zigbee2mqtt component. I got the one minute wait in the log and then a message about having to press the reset button. So I installed the zigbee2mqtt-edge version and it worked fine. Today things started acting up again. zigbee-sheperd was apparantly not running, and the log was full of messages about it. So I stopped the zigbee2mqtt-edge component and installed the now updated "regular" component. It too doesn't work for me now. This is what my log shows:

[Info] Configuration file found. Will overwrite configurable               fields with values from add-on configuration
[Info] Configuration written to /share/zigbee2mqtt/configuration.yaml
[2018-10-03T17:38:00.452Z] PM2 log: Launching in no daemon mode
[2018-10-03T17:38:00.879Z] PM2 log: Starting execution sequence in -fork mode- for app name:npm id:0
[2018-10-03T17:38:00.918Z] PM2 log: App name:npm id:0 online
> [email protected] start /zigbee2mqtt-0.1.6
> node index.js
  zigbee2mqtt:info 2018-10-3 17:38:04 Logging to directory: '/share/zigbee2mqtt/log/2018-10-03.17-38-04'
  zigbee2mqtt:info 2018-10-3 17:38:05 Starting zigbee2mqtt version 0.1.6 (commit #unknown)
  zigbee2mqtt:info 2018-10-3 17:38:05 Starting zigbee-shepherd
  zigbee2mqtt:info 2018-10-3 17:38:05 Error while starting zigbee-shepherd, attemping to fix... (takes 60 seconds)
  zigbee2mqtt:info 2018-10-3 17:39:06 Starting zigbee-shepherd
  zigbee2mqtt:error 2018-10-3 17:39:06 Error while starting zigbee-shepherd!
  zigbee2mqtt:error 2018-10-3 17:39:06 Press the reset button on the stick (the one closest to the USB) and start again
  zigbee2mqtt:error 2018-10-3 17:39:06 Failed to start
	{"message":"Error: Resource busy, cannot open /dev/ttyACM0","stack":"Error: Error: Resource busy, cannot open /dev/ttyACM0"}

Thanks for reading.

Edit: After messing around with unplugging and replugging the stick, pressing the reset button - I ended up with an error saying there's no file or folder at /dev/ttyACM0. Noticed under Hass.io > Hardware that it had changed to /dev/ttyACM1, and changed the configuration accordingly. After that it started working again. After a later reboot it had changed back to ACM0 and I had to reconfigure, but things are still working.

Leaving the issue up in case you want to take a look at the error I initially had anyway!

Crashes with CC2531 router paired

This is an issue from the original zigbee2mqtt that seems to be solved in the original version, but I'm still having this problem with the add-on.

When I add a CC2531 with router firmware to the CC2531 with CC2531ZNP-Pro-Secure_LinkKeyJoin it causes the addon to faill with the same error as the original post: Koenkk/zigbee2mqtt#116
Somewere in the middle Koenkk says it's fixed, but as I'm using the addon I don't know if I need to make some changes in order for it to work/update.

Can you help? Thanks in advance.

CloudMQTT

Hi there
Getting errors using CloudMQTT:

2018-7-23 09:33:13 INFO Connecting to MQTT server at mqtt://m21.cloudmqtt.com
2018-7-23 09:33:23 ERROR Not connected to MQTT server!

Relevant config:
"mqtt_server": "mqtt://m21.cloudmqtt.com",
"mqtt_user": "user",
"mqtt_pass": "pass"

Question: How can I use CloudMQTT? Could it be because I need a port number that is not exposed by config?

feature request: led control via services?

we can turn off led via configuration - but what if we could turn on/off led via services also? it would be neat to have an automation which would turn on the led during pairing timer, and then turn off the led after timer finishes (and pairing mode is off).

Adjust defaults

Creating an item to track a few changes that I think would be good, but as always happy for feedback:

Adjust config.json default for easier 1st time usage:

  • Make mqtt_server use mqtt://homeassistant as that should work in hassio because of shared network between containers
  • Switch permit_join to false
  • Point to documentation on how to enable/disable permit_join through mqtt - provide also in documentation automation example for using this from the interface

Error: ENOENT: no such file or directory, open '/share/zigbee2mqtt/configuration.yaml'

Hi,

Fresh installation, HASSIO conf:
{
"data_path": "/share/zigbee2mqtt",
"homeassistant": true,
"permit_join": false,
"mqtt_base_topic": "zigbee2mqtt",
"mqtt_server": "mqtt://localhost",
"serial_port": "/dev/ttyACM0"
}

I'm getting following error:
[2018-09-22T13:31:20.544Z] PM2 log: Starting execution sequence in -fork mode- for app name:npm id:0
[2018-09-22T13:31:20.561Z] PM2 log: App name:npm id:0 online

[email protected] start /zigbee2mqtt-0.1.5
node index.js
fs.js:646
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open '/share/zigbee2mqtt/configuration.yaml'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at read (/zigbee2mqtt-0.1.5/lib/util/settings.js:27:29)
at Object. (/zigbee2mqtt-0.1.5/lib/util/settings.js:15:16)
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)
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-09-22T11_31_27_251Z-debug.log
[2018-09-22T13:31:28.000Z] PM2 log: App [npm] with id [0] and pid [339], exited with code [1] via signal [SIGINT]
[2018-09-22T13:31:28.007Z] PM2 log: Starting execution sequence in -fork mode- for app name:npm id:0
[2018-09-22T13:31:28.023Z] PM2 log: App name:npm id:0 online
[email protected] start /zigbee2mqtt-0.1.5
node index.js
fs.js:646
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open '/share/zigbee2mqtt/configuration.yaml'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at read (/zigbee2mqtt-0.1.5/lib/util/settings.js:27:29)
at Object. (/zigbee2mqtt-0.1.5/lib/util/settings.js:15:16)
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)
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-09-22T11_31_34_838Z-debug.log
[2018-09-22T13:31:35.394Z] PM2 log: App [npm] with id [0] and pid [355], exited with code [1] via signal [SIGINT]
[2018-09-22T13:31:35.402Z] PM2 log: Starting execution sequence in -fork mode- for app name:npm id:0
[2018-09-22T13:31:35.420Z] PM2 log: App name:npm id:0 online
[email protected] start /zigbee2mqtt-0.1.5
node index.js
fs.js:646
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open '/share/zigbee2mqtt/configuration.yaml'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at read (/zigbee2mqtt-0.1.5/lib/util/settings.js:27:29)
at Object. (/zigbee2mqtt-0.1.5/lib/util/settings.js:15:16)
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)
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-09-22T11_31_42_152Z-debug.log
[2018-09-22T13:31:42.721Z] PM2 log: App [npm] with id [0] and pid [371], exited with code [1] via signal [SIGINT]
[2018-09-22T13:31:42.728Z] PM2 log: Starting execution sequence in -fork mode- for app name:npm id:0
[2018-09-22T13:31:42.744Z] PM2 log: App name:npm id:0 online

Is it possible to direct crash logs to /share/zigbee2mqtt? Debug logging support?

I noticed that when a crash occurs the log is written to a container path:

e.g. :
/root/.npm/_logs/2018-05-17T18_39_57_529Z-debug.log

When the container is restarted after the crash the _logs dir is removed, so log is lost.
Can we re-direct crash logs to the mapped volume for persistence?

Also is there any easy way to enable debug logging per here:
https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-debug
(I will see if I can hack it in for now)

Question: How to build a forked version using the edge add-on?

I've forked zigbee2mqtt to make a minor change and thought I'd be able to use your add-on as a local add-on and simply change the git clone line to:

git clone -b unique_id --single-branch --depth 1 https://github.com/mihalski/zigbee2mqtt.git /app

However it STILL seems to use a different branch (or possibly repository?) when I install from the local add-on repository. I have verified this by checking the contents of the offending file inside the docker container that is built.

Am I doing something obvious wrong?

Toward version 0.1

@ciotlosm

Seems like we're nearing a point where we can go to a first versioned release.
Creating a tracking issue to that end:

  • resolve #15

  • resolve #2 (add pm2)

  • determine how to handle versioning / releases

Dev version

Is it possible to create an addon of the DEV version of Zigbee2MQTT.

There is something solved (Koenkk/zigbee2mqtt#198) wich i needed quickly.
Please let me know!

cache_state not working in 0.1.7 edge build ?

I switched to the edge build for new device compatibility but then my sensors stopped working correctly.
I have xaomi tem/hum/press sensors and they only show the latest state reported:
so when zigbee2mqtt log shows:
MQTT publish, topic: 'zigbee2mqtt/0x00158d000534207653, payload: '{"temperature":20.19,"linkquality":44,"humidity":40.31}'
Only the temp and humidity are displayed in home assistant and pressure would be empty

Unable to start

I'm getting the following error:

[Info] Configuration file found. Will overwrite configurable fields with values from add-on configuration
[Info] Configuration written to /share/zigbee2mqtt/configuration.yaml

[email protected] start /app
node index.js
2018-5-28 06:25:50 INFO Starting zigbee-shepherd
2018-5-28 06:25:53 ERROR Error while starting zigbee-shepherd!
2018-5-28 06:25:53 ERROR Failed to start

Any ideas would be greatly appreciated.

errors on addon start

I've tweaked a bit the addon to start and I see:

Input error: Is a directory
jq: error: Could not open file empty: No such file or directory
Input error: Is a directory
jq: error: Could not open file empty: No such file or directory
[Info] Setting configuration.yaml...
[Info] Configuration written to /app/adata/configuration.yaml:
homeassistant: true
mqtt: {base_topic: zigbee2mqtt, server: 'mqtt://192.168.0.100'}
permit_join: true
serial: {port: /dev/ttyACM0}
Lifecycle scripts included in zigbee2mqtt:
  start
    node index.js
available via `npm run-script`:
  docgen
    node support/docgen.js

After this the addon fails to start.

Addon not installed

Hi had homeassistant running for a few days on rpi-3b+ and decided to reinstall and make it my main home automation device. Installed zigbee2mqtt 0.1.3 on rpi with cc2531 earlier and everything worked without failures.

Today i did a fresh install on hassio (1.10 x32), flashed sd and inserted, when i wanted to install i saw that version 0.1.5. was available. So pushed the install button and waited for it to complete but got the text "Addon is not installed" in the Log section. The zigbee2mqtt dir was created but no files in it in the share dir of hassio.

I noticed after opening this issue that a lot of addons where not being installed, so opend an issue in the home-assistant/hassio-homeassistant section. Don't know if this is the right section for it.

When i do click start i get the KeyError: 'log_directory' issue and fs.js:646. I inserted the screenshots.

When additional information is needed please request.

** Edit 1**
I installed the hassio 64 bit image for rpi-3 and had no problem installing addons. But when i run zigbee2mqtt stil having the fs.js:646

** Edit 2 **
i Manually created the zigbee2mqtt directory in /share and the configuration.yaml that is supposed to be created there. Except the log directory failure #52 is in the log and if set in the config it gives understanding in the logs. But the addon does work and start as seen in the last screenshot added

Traceback (most recent call last): File "set_config.py", line 97, in <module> main(args.options_path, args.data_path) File "set_config.py", line 81, in main config.set_log_dir(data_path, options['log_directory']) TypeError: set_log_dir() takes 2 positional arguments but 3 were given

Version hassio supervisor
schermopname 6

Addon not installed
schermopname 3

Log directory error
schermopname 4

Run errors when started
schermopname 5

** Edit 2 ** Starting but with errors
schermopname 8

readme.md typo

copy paste error
in table of readme.md
disable_led | string | no | Your MQTT Password, if set.

Addon reports wrong running srtate

Hi,

Addon didn't start properly due to port changed:
"[Info] Configuration file found. Will overwrite configurable fields with values from add-on configuration
[Info] Configuration written to /share/zigbee2mqtt/configuration.yaml
[2018-09-29T19:48:02.905Z] PM2 log: Launching in no daemon mode
[2018-09-29T19:48:04.916Z] PM2 log: Starting execution sequence in -fork mode- for app name:npm id:0
[2018-09-29T19:48:05.274Z] PM2 log: App name:npm id:0 online

[email protected] start /zigbee2mqtt-0.1.6
node index.js
zigbee2mqtt:info 2018-9-29 19:48:42 Logging to directory: '/share/zigbee2mqtt/log/2018-09-29.19-48-41'
zigbee2mqtt:info 2018-9-29 19:48:58 Starting zigbee2mqtt version 0.1.6 (commit #unknown)
zigbee2mqtt:info 2018-9-29 19:48:58 Starting zigbee-shepherd
zigbee2mqtt:info 2018-9-29 19:48:59 Error while starting zigbee-shepherd, attemping to fix... (takes 60 seconds)
zigbee2mqtt:info 2018-9-29 19:49:59 Starting zigbee-shepherd
zigbee2mqtt:error 2018-9-29 19:49:59 Error while starting zigbee-shepherd!
zigbee2mqtt:error 2018-9-29 19:49:59 Press the reset button on the stick (the one closest to the USB) and start again
zigbee2mqtt:error 2018-9-29 19:49:59 Failed to start
{"message":"Error: No such file or directory, cannot open /dev/ttyACM0","stack":"Error: Error: No such file or directory, cannot open /dev/ttyACM0"}"

But reports state "running"

Addon config not working

I was expecting the addon config JSON to be written as configuration.yaml in the data_path dir (where the app looks for it).

e.g.
{
"data_path": "/share/zigbee2mqtt",
"homeassistant": true,
"permit_join": true,
"mqtt_base_topic": "zigbee2mqtt",
"mqtt_server": "mqtt://192.168.1.10:1883",
"serial_port": "/dev/ttyACM0",
"mqtt_user": "sensors",
"mqtt_pass": "xxxxxxxx"
}

would be written out as:

# Home Assistant integration (MQTT discovery)
homeassistant: true

# allow new devices to join
permit_join: true

# MQTT settings
mqtt:
  # MQTT base topic for zigbee2mqtt MQTT messages
  base_topic: zigbee2mqtt
  # MQTT server URL
  server: 'mqtt://192.168.1.10:1883'
  # MQTT server authentication, uncomment if required:
  user: sensors
  password: xxxxxxxx

# Serial settings
serial:
  # Location of CC2531 USB sniffer
  port: /dev/ttyACM0

# Advanced configuration

...
...

Did I misinterpret what the config is used for? Or is this a WIP?

Built locally addon fails to start

I want to build the addon locally so that I can use my fork of zigbee2mqtt when testing for new devices.

In order to achieve this I did the following:

  1. Cloned this hassio-zigbee2mqtt repo
  2. Created a new dir \hassio\addons\zigbee2mqtt
  3. Copied the four files from hassio-zigbee2mqtt/zigbee2mqtt (config.json, dockerfile, run.sh and set_config.py) to the dir \hassio\addons\zigbee2mqtt
  4. Removed the image statement from config.json
  5. Installed the addon from my local repo. It builds locally. When this happens I can see (via portainer) that a new docker image is created and is same size as the image pulled from your dockerhub
  6. Start the addon...

I get an error:

[FATAL tini (5)] exec /app/run.sh failed: No such file or directory

In portainer I compared the image layers and it seems that the two images - yours from docker hub and mine built locally - are identical with the exception of tags...

really odd.

docker hub image requires tag to match config.json version

https://hub.docker.com/r/dwelch2101/zigbee2mqtt-armhf/tags/ currently is not tagged, and the version inside config.json is 'dev'.

Version needs to be a number, and that number must also be a tag in docker hub.

Sample error:

18-05-10 19:23:29 INFO (MainThread) [hassio.addons.git] Clone addon https://github.com/ciotlosm/hassio-zigbee2mqtt repository
18-05-10 19:23:33 INFO (MainThread) [hassio.addons] Load addons: 36 all - 1 new - 0 remove
18-05-10 19:23:49 INFO (MainThread) [hassio.addons.addon] Create Home-Assistant addon data folder /data/addons/data/69f3b574_zigbee2mqtt
18-05-10 19:23:49 INFO (SyncWorker_0) [hassio.docker.interface] Pull image dwelch2101/zigbee2mqtt-armhf tag dev.
18-05-10 19:23:52 ERROR (SyncWorker_0) [hassio.docker.interface] Can't install dwelch2101/zigbee2mqtt-armhf:dev -> 404 Client Error: Not Found ("manifest for dwelch2101/zigbee2mqtt-armhf:dev not found").

Remove permit_join from options

@danielwelch I opened this issue as a discussion.

My recommendation would be to:

  • Remove permit_join from options
  • Always make permit_join false
  • Allow changing of permit_join only through mqtt

This way it is possible to support implementation of an input boolean (https://www.home-assistant.io/components/input_boolean/) to enable/disable joining.

My proposed approach:

  • Create an input boolean that defaults to false
  • Create an automation that reads the zigbee2mqtt/bridge/state to reset the input boolean to false
  • Create an automation to send mqtt on zigbee2mqtt/bridge/config/permit_join when pressing this input boolean (as toggle true/false)

Note: If you have recorder enabled and allow permit_join to be received from @Koenkk on zigbee2mqtt/bridge/state we could get around removing permit_join from options.

zigbee2mqtt addon needs restart every minute

Hi guys,

First of all a shout out to everybody who is/was involved with this project, i think it has great potential.

I have connected 3 tradfri spots, it works fine for a minute or so but then nothing works anymore. I have to restart the zigbee2mqtt addon within my hassio.

Does anyone else have this issue? The logs within the addon says the following:

zigbee2mqtt:error 2018-8-26 20:53:01 Zigbee publish to 'xxxxxxxxxxxxx', genOnOff - off - {} - null failed with error Error: request timeout
zigbee2mqtt:error 2018-8-26 20:53:04 Zigbee publish to 'xxxxxxxxxxxxxx', genOnOff - off - {} - null failed with error Error: request timeout
zigbee2mqtt:error 2018-8-26 20:53:07 Zigbee publish to 'xxxxxxxxxxxxxxxx', genOnOff - off - {} - null failed with error Error: request timeout

After restarting the zigbee2mqtt addon i can turn the lights on and off for a minute but then again these errors

Thanks for your time!

Greetings

Unable to pair new devices

I get the message in log shortly after startup -

2018-6-11 10:18:45 INFO
{"message":"request unsuccess: 16","stack":"Error: request unsuccess: 16
 at /app/node_modules/zigbee-shepherd/lib/components/zdo.js:46:21
 at CcZnp. (/app/node_modules/cc-znp/lib/ccznp.js:257:13)
 at Object.onceWrapper (events.js:315:30)
 at emitOne (events.js:116:13)
 at CcZnp.emit (events.js:211:7)
 at CcZnp._mtIncomingDataHdlr (/app/node_modules/cc-znp/lib/ccznp.js:357:14)
 at /app/node_modules/cc-znp/lib/ccznp.js:333:22
 at _combinedTickCallback (internal/process/next_tick.js:131:7)
 at process._tickCallback (internal/process/next_tick.js:180:9)"}

Existing devices in DB & config communicate fine.

Xiaomi 'mains' devices send 'alive' information. Currently all hardcoded to 'online'.

Not a bug per-say, more feature correction, but it seems that all of the Xiaomi mains powered devices send a timed CID which could be used for 'online' monitoring.

In the code you have it hardcoded to not look for 'awake' frames from any Xiaomi device.

// Set all Xiaomi devices (manufId === 4151) to be online, so shepherd won't try
        // to query info from devices (which would fail because they go tosleep).
        // Xiaomi lumi.plug has manufId === 4447 and can be in the sleep mode too
        const devices = this.getAllClients();
        devices.forEach((d) => {
            if ((d.manufId === 4151) || (d.manufId === 4447)) {
                const device = this.shepherd.find(d.ieeeAddr, 1);
                if (device) {
                    device.getDevice().update({
                        status: 'online',
                        joinTime: Math.floor(Date.now() / 1000),
                    });
                }
            }
        }); 

For example I have a QBKG03LM and ZNCZ02LM, and both send an 'online' messages every 6-8mins

Frame looks to be the same 'base' spec for all items.
I.e. GenBasic CID with AttID '65281' with an array item included pf varying size.
If you receive this CID (aswell as the 'trigger' ones) within say a 10minute window, mark the device as online. Otherwise it's offline after 10minute counter has elapsed.

zigbee2mqtt:debug 2018-10-2 20:57:27 Recieved zigbee message of type 'attReport' with data '{"cid":"genBasic","data":{"65281":{"3":27,"5":8,"7":"0x0000000000000000","8":4886,"9":512,"100":1,"149":0.42732903361320496,"150":2304,"152":0.3319999873638153,"154":16}}}' of device 'lumi.plug' (0x00158d000xxxxxxxx)

zigbee2mqtt:debug 2018-10-2 20:58:04 Recieved zigbee message of type 'attReport' with data '{"cid":"genBasic","data":{"65281":{"3":21,"5":11,"7":"0x0000000000000000","8":4383,"9":512,"100":0,"101":0,"149":0.0008930352632887661,"152":0,"154":16}}}' of device 'lumi.ctrl_ln2.aq1' (0x00158d000xxxxxx)

Would be cool if you could add in checks for the mains devices, probably via ID, so they could be tracked.
P.s. Looks like Received in the debug message has a spelling typo :-)

Let me know if you need any more info!

Thanks!
Ben

BT not working

I have this device https://www.home-assistant.io/components/sensor.mitemp_bt/ but can not read the info.

i think that the problem is this

bcm43xx_init
Flash firmware /lib/firmware/brcm/BCM43430A1.hcd
Set BDADDR UART: b8:27:eb:aa:aa:aa
Set Controller UART speed to 921600 bit/s
Device setup complete

the number MAC not is correct. b8:27:eb:aa:aa:aa

Create support for Tradfri motion sensor

Hi!

I am new to the hass.io setup of zigbee2mqtt. The first device I added to the CC is an unsupported Tradfri motion sensor, so it made sense to add support for it and drop a PR. The zigbee2mqtt guide is pretty clear on the matter.

However: How is this done in a hass.io environment, where you dont have access to the devices.js and FromZigbee.js within the zigbee2mqtt container? This seems to be essential in order to the characteristics of the device.

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.