Deconz for Hass.io

gjong thanks for the great work creating the deconz docker, I’m new to docker so I may be doing something wrong but once I had built the docker image I was unable to run due to a permission denied error. I had to add the following to the Dockerfile
RUN chmod +x start.sh

Once done worked a treat

Very new to this, but managed to get the deconz addon show up in hass.io, but then I try to Install it just try for a few seconds then this message shows up in log.
ERROR (SyncWorker_6) [hassio.docker.addon] Can’t build local/armhf-addon-conbee_deconz:1.1: ADD failed: failed to GET http://dl-cdn.alpinelinux.org/alpine/edge/testing/armhf/qt5-websockets-5.9.1-r0.apk with status 404 Not Found: I guess Its a file that is missing in the alpine index or maybe have been replaces with at newer. Anything I can do myself to solve this?
Best Regards //Richard

@gjong I’m having an issue running the hassio addon. The log is not really helpful though… Any idea where shall I start debugging it?

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
[cont-init.d] 00-banner.sh: exited 267.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
s6-maximumtime: warning: child process crashed
[cont-finish.d] 99-message.sh: exited 111.
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.

I presume you downloaded the code from bitbucket and deployed it locally into the hassio addon directory. If so and you did so recently there might be an issue with it trying to pull in a docker image from the public registry, I had to update the configuration to prevent this. Could you try the latest version from bitbucket and see if the problem still persists after a rebuild.

Sorry for the late reply. I tested the builds locally on armv6 (pi zero) and it seems to segfault aka error 139. I’d assume this has to do with upstream image. Yet I was unable to build an image that would work although running through hassioaddons/build-env and qemu seems to produce an image. The weird thing is that the segfaults do not happen on images fetched from hassioaddons repository. Which are based of the same base images.

Hi, @gjong i installed your add-on and it works, but i can’t upgrade the firmware using the command
bash docker run --rm -it --entrypoint "/bin/bash" --privileged --device /dev/ttyAMA0:/dev/ttyAMA0:rwm local/armhf-addon-deconz GCFFlasher_internal -f /usr/share/deCONZ/firmware/deCONZ_Rpi_0x261e050 0.bin.GCF

the error is

bash: docker: No such file or directory

You will need to log into the physical machine that runs resin containers rather than hass itself: https://home-assistant.io/developers/hassio/debugging/

Something along the lines:
$ ssh [email protected] -p 22222

@peel I’m not exactly sure what is happening in your build. Does it fail during the building process with the segmentation failure or during running. I’ve not yet tested building using the build-env tools from franck, but this is something I’m going to be looking into. What I noticed from your comment is that you are on armv6 with your Pi, I haven’t tested using that hardware before so I’ll try and help you best I can without that hardware. I know the base image is based on arm32v7, so I’m not sure if that may cause issues in the image.

I usually build it on a Windows machine first locally to test the build is working and then pull the changes into my Pi3 to build it through the UI of Hass.io. So far this has worked most of the builds, and if it failed it was due to a mistake in my build script. I try to fix those as quickly as possible or my wife will get angry when she can’t control the lights for more then a few hours.

@peel ok i’ve connected to ssh as you said but there isn’t a folder /usr/share/deCONZ

and now i can’t connect anymore to hassio.local:8123

You should do the following steps to update firmware

  • stop the addon with in Your home assistant website
  • SSH into the resinos machine, that is Your raspberry pi under port 2222
  • then run the docker commando, this should result in the container starting that the flash was Successfully.
  • after this you can Start the addon again.

Note the folder is not in Your resinos machine, but in the deconz docker image.

Some error but is it ok?

root@hassio:~# bash
root@hassio:~# docker run --rm -it --entrypoint "/bin/bash" --privileged --device /dev/ttyAMA0:/dev/ttyAMA0:rwm local/armhf-addon-deconz GCFFlasher_internal -f /usr/share/deCONZ/firmware/deCONZ_Rpi_0x261e0500.bin.GCF
rmmod: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin file '/lib/modules/4.4.50/modules.builtin.bin'
rmmod: ERROR: Module ftdi_sio is not currently loaded
rmmod: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin file '/lib/modules/4.4.50/modules.builtin.bin'
rmmod: ERROR: Module usbserial is not currently loaded
GCFFlasher V2_11 (c) dresden elektronik ingenieurtechnik gmbh 2017/12/10
no device specified use RaspBee (/dev/ttyAMA0)
using firmware file: /usr/share/deCONZ/firmware/deCONZ_Rpi_0x261e0500.bin.GCF
reset target
flashing 126124 bytes: |==============================|
verify: ....
SUCCESS
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.50/modules.dep.bin'
modprobe: FATAL: Module usbserial not found in directory /lib/modules/4.4.50
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.50/modules.dep.bin'
modprobe: FATAL: Module ftdi_sio not found in directory /lib/modules/4.4.50

Strange as it May sound yes the update was Successfully completed. The error are about software that is missing to flash the conbee stick. All usb related.

If you restart the addon it should state that the firmware is up to date.

I’ve just developed a new deCONZ Add-on for Hass.io (sorry @gjong, definitely not trying to step on your toes at all, I’ve had a look at your Add-on and it’s excellent work, but I’m aiming for both Conbee and RaspBee support).

  • This add-on should support both Conbee and RaspBee.
  • This add-on relies on a Docker Hub image (not local build) which should make installing fast, on both amd64 and armhf; and, there is a build pipeline in place to automatically update the image and add-on when a new deCONZ beta is released.
  • This add-on should persist your ZigBee network data in your config folder in a subfolder called “deconz” (which will persist through version updates).
  • This add-on runs on the host network and allows you to change the listening ports of the webui and websockets interfaces with config variables (should help with uPNP detection with the PWA WebUI).

I would be grateful for any beta testers since this is my first Add-on - I’ve verified that it works on my end on a RasPi 3, but more testing is definitely needed.

To install, add this repo to your Hass.io Add-On Store tab: https://github.com/marthoc/hassio-addons.

Thanks!

6 Likes

Sounds awesome @marthocoo

Great work!

@marthocoo its good to have a central image that would work for both the Raspbee and the Conbee. I only build one for the Raspbee because none of the other docker images seemed to work. To look if it works properly with the Raspbee I installed your image and uploaded a backup I took from my own docker image.

Though it took several attempts to upload the backup it finally worked and I can confirm the image works within Hassio with the Raspbee. All the lights, groups and scene’s where imported and seem to work.

@gjong Thanks for testing! Unfortunately in doing more testing it appears that my addon doesn’t persist the configuration like I thought it did - seems that there are more places on the filesystem that user data are stored. Does your addon persist config through an upgrade/reinstall? I’ve raised an issue with the deCONZ dev to see if I can get something added to deCONZ itself that would help with this. Until then I’ve added some info to the addon regarding backing up and restoring config before upgrading as a workaround.

It does persist through updates of the addon. I store the data in /data/deconz and then symlink it to the default deCONZ folder. But I doubt that it will last a uninstall and re-install, since that directory is then removed by resinos.

I’ve had issues with the default hassio mounts not working properly, but that was fixed when I moved over to the debian-base image of franck.

@gjong Interesting - I didn’t consider that the directory is removed during uninstall (maybe defeats the point of persisting?) but not upgrade. Maybe mine will work fine during upgrade then since all I’m doing is changing root’s homedir to /data, so that the .local/share/dresden-elektronik/deCONZ subfolder is created inside /data.

@marthocoo I’m trying to get the HASS io plugin working. How do i specify which USB device to use?

I have a conbee connected to hass. It shows up in the hardware listing when i SSH into HASS and give the command “hassio host hardware” .

I also have other Serial usb devices connected to my hass io (smart meter reading).

If i go to the webpage, i only see a conbee gateway with the ip address hass IO, no conbee device as i previous had on an other system running deconz.