Jump to content

Issues setting up deCONZ docker (Likely because I have no idea what I am doing)


Recommended Posts

Hey folks! I am trying to set up this docker in my unRAID install.

I haven't ever used a docker that didn't come from the community apps plugin, and I am struggling getting this one to work.

(It's for using smart bulbs and stuff via a USB dongle.)

 

I got it up and running, and it seems to work - it's accessible via TOWER:666, can see the USB device, and responds to REST API.

...But it behaves erratically, and does seem to be using the storage location I mapped it to in the config. (It's entirely empty)

I think I messed up the mapping, and that's why it doesn't seem to always preserve changes, etc.

 

The script on the docker page looks like this:

docker run -d \
    --name=deconz \
    --net=host \
    --restart=always \
    -v /opt/deconz:/root/.local/share/dresden-elektronik/deCONZ \
    --device=/dev/ttyUSB0 \
    marthoc/deconz

Does this configuration seem appropriate based on that info?

image.png.fea01c6d04bf7c268272348d6a58efd0.png

image.png.f5066f887f69ef669041b8eeaf18137a.png

 

(The WebUI button in unRAID doesn't actually work either, and leads to TOWER/666 instead of TOWER:666, I am not sure why.)

 

I'd love some help!

Edited by Ruthalas
Link to comment

Things that stand out really quick

* the WebUI should be: http://[IP]:[666]/

* Network type should be host (or a custom network)

* No need to enable Privileged

 

Depending on the actual things going on in the docker container, you might need to make sure /dev/ttyUSB0 has the right permissions and/or ownership

  • Like 1
Link to comment
15 hours ago, ken-ji said:

Things that stand out really quick

* the WebUI should be: http://[IP]:[666]/

* Network type should be host (or a custom network)

* No need to enable Privileged

 

Depending on the actual things going on in the docker container, you might need to make sure /dev/ttyUSB0 has the right permissions and/or ownership

I have made these changes.

Thank you for the guidance!

The container can successfully make use of the USB device right now, so I believe those permissions are in order.

 

4 hours ago, Squid said:

You also need to add all of the environment variables that it lists on the docker page and configure appropriately

 

 

I haven't used the unRAID interface to add an environment variable before.

This is what I have now, does it appear that I have added them appropriately?

(I selected an alternate port for the webui, as 80 is devoted to unRAID as far as I understand it.)
image.png.8e65e3ea7e77f9f427da1360b1dcea86.png

 

I will have to set up my lights again this evening and check if the configuration sticks this time.

 

Thank you for your help so far!

Edited by Ruthalas
Link to comment
  • 6 months later...
  • 1 month later...

I got this working today, I think there was a misunderstanding about which path the container needs mapped. The deCONZ application writes to:

/root/.local/share/dresden-elektronik/deCONZ

So that is the container path that needs to be mapped to appdata. I have mine set up like this screenshot and it is properly writing to appdata.

 

 

Screen Shot 2019-02-24 at 12.08.22 PM.png

  • Like 1
Link to comment
  • 1 month later...
On 2/24/2019 at 2:11 PM, armsaw said:

I got this working today, I think there was a misunderstanding about which path the container needs mapped. The deCONZ application writes to:


/root/.local/share/dresden-elektronik/deCONZ

So that is the container path that needs to be mapped to appdata. I have mine set up like this screenshot and it is properly writing to appdata.

 

 

Screen Shot 2019-02-24 at 12.08.22 PM.png

Thanks! This worked perfectly. I should have checked this months ago since I lost my entire config at the time of restart thinking it was the /opt/ path.

Link to comment
  • 4 weeks later...

I hope it's OK to post here. I would be very grateful for some help.

 

With above feedback I've got the docker running properly (I think). However, I’m unable to pass through my conbee II stick. If I use --device=/dev/ttyUSB0 as extra parameter, the docker will not start.

 

When I run command lsusb on my unRAID console, I get:

Bus 002 Device 003: ID 0424:2660 Standard Microsystems Corp. Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 0781:5567 SanDisk Corp. Cruzer Blade
Bus 001 Device 021: ID 1cf1:0030 Dresden Elektronik
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

In my log I see this when I unplug and plug the conbee stick in my server.

May 11 17:40:30 Microserver kernel: usb 1-1.2: USB disconnect, device number 21
May 11 17:40:43 Microserver kernel: usb 1-1.2: new full-speed USB device number 22 using ehci-pci
May 11 17:40:43 Microserver kernel: cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
May 11 17:40:51 Microserver kernel: usb 1-1.2: USB disconnect, device number 22
May 11 17:40:51 Microserver kernel: usb 1-1.2: new full-speed USB device number 23 using ehci-pci
May 11 17:40:51 Microserver kernel: cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device

I have also tried --device=/dev/ttyACM0. The docker will start, but it seems that the stick is not passing through to the application.

I'm uncertain on how I can best proceed with troubleshooting and would be very grateful for your kind support!

Link to comment
  • 4 weeks later...

I believe I have the same problem as you guys. I got the Deconz docker container up and running but the Conbee (I) device is not discovered. At least I can't add my Ikea Trådfri control outlet and when I check the gateway settings in the web ui it says: "Firmware Not connected".

 

conbee.thumb.png.d47efc9cd4afce7a6c77369d17f0cf6e.png

 

After I have read the posts above I think I have entered the correct settings for the docker container:

 

deconz_docker.thumb.png.c910f400e39c5f4b07fc0dd97bbe2d98.png

 

Am I doing anything wrong?

 

Thanks,

David

Link to comment
  • 4 months later...
8 hours ago, fazj said:

Did you manage to sort this all out in the end David, seems i am running into the same issues. 

Unfortunately not, I gave up and purchased an Ikea Trådfri gateway instead. I tried several ways of forwarding the USB stick to the docker but I did not manage to get it working. I think I read somewhere that a Linux OS might appropriate an USB device/controller for itself and thereby inhibiting the possibility to forward it properly.

Link to comment
  • 1 month later...
On 10/10/2019 at 11:08 PM, Klench said:

Unfortunately not, I gave up and purchased an Ikea Trådfri gateway instead. I tried several ways of forwarding the USB stick to the docker but I did not manage to get it working. I think I read somewhere that a Linux OS might appropriate an USB device/controller for itself and thereby inhibiting the possibility to forward it properly.

I recently bought a Conbee II as well and had some troubles forwarding it into the marthoc/deconz docker. First I started to add a new docker in unraid completely from scratch, since it is not available as a community app. These are my settings for the docker container:Unbenannt.thumb.PNG.dbf3708aa4f2899689cb9367157e48f6.PNG

The deconz gateway variable has to be a "device" as config type. Keep in mind that there are different device names for the gateways:

Conbee I = /dev/ttyUSB0 (default)

Conbee II = /dev/ttyACM0

Raspbee =  /dev/ttyAMA0 or /dev/ttyS0

 

Be sure to dial out any serial devices as mentioned in the docker instructions before forwarding the device:

sudo usermod -a -G dialout $USER

Starting the docker with these settings worked perfectly for me. The Conbee II will be identified correctly.

Link to comment
  • 4 weeks later...

I'm about to buy a Conbee II myself, and would like to have it working with my Home Assistant server running on my unraid-server. I think I even need help with installing the docker to unraid, since it's not even available via the community apps plugin.

 

Is there some kind of guide for doing that?

 

Thanks.

 

/Söder

Edited by soder
typos mostly
Link to comment

In Community Apps, search for deconz and click the Click Here To Get More Results From DockerHub and install the container from marthoc.

 

You'll want to set Network Type to Host.

 

At the bottom of the page will be the link Add another Path, Port, Variable, Label or Device. It does what it says.

 

Add the container path /root/.local/share/dresden-elektronik/deCONZ to point to your config directory, ex. /cache/appdata/deconz

 

You'll also want to pass your device into the container. I just use the Extra Parameters field to do this: --device=/dev/[your_device]

 

Then pass any of the environment variables you need listed on this page (passing them all is fine, just define the values):

https://hub.docker.com/r/marthoc/deconz/

 

The Conbee II defaults to the device name /dev/ttyACM0. If you have another USB device like an Aeotec Zstick, it will also try to assign itself  /dev/ttyACM0 or  /dev/ttyACM1 (depends on which device is assigned first upon boot).

 

Read this about setting a persistent name if thats the case:

https://forums.unraid.net/topic/71372-usb-passthrough-device-location-changing/

 

Then add the Environment Variable DECONZ_DEVICE and enter the value of your persistent name, ex. /dev/[persistent_name]

 

Make sure to telnet into your server and add the user to the dial out group the Drahznar suggested above.

 

If you're having problems with the device connecting in the container, try updating the firmware. I did my firmware update in Windows as I couldn't get it to flash successfully using the docker firmware method described on the docker page.

 

Attached is how I setup my container.

Screen Shot 2020-01-02 at 2.37.30 PM (2).png

  • Like 2
  • Thanks 1
Link to comment
21 hours ago, a_n_d_y said:

In Community Apps, search for deconz and click the Click Here To Get More Results From DockerHub and install the container from marthoc.

 

You'll want to set Network Type to Host.

 

At the bottom of the page will be the link Add another Path, Port, Variable, Label or Device. It does what it says.

 

Add the container path /root/.local/share/dresden-elektronik/deCONZ to point to your config directory, ex. /cache/appdata/deconz

 

You'll also want to pass your device into the container. I just use the Extra Parameters field to do this: --device=/dev/[your_device]

 

Then pass any of the environment variables you need listed on this page (passing them all is fine, just define the values):

https://hub.docker.com/r/marthoc/deconz/

 

The Conbee II defaults to the device name /dev/ttyACM0. If you have another USB device like an Aeotec Zstick, it will also try to assign itself  /dev/ttyACM0 or  /dev/ttyACM1 (depends on which device is assigned first upon boot).

 

Read this about setting a persistent name if thats the case:

https://forums.unraid.net/topic/71372-usb-passthrough-device-location-changing/

 

Then add the Environment Variable DECONZ_DEVICE and enter the value of your persistent name, ex. /dev/[persistent_name]

 

Make sure to telnet into your server and add the user to the dial out group the Drahznar suggested above.

 

If you're having problems with the device connecting in the container, try updating the firmware. I did my firmware update in Windows as I couldn't get it to flash successfully using the docker firmware method described on the docker page.

 

Attached is how I setup my container.

Screen Shot 2020-01-02 at 2.37.30 PM (2).png

About "adding the user to the dial out", the "sudo usermod -a -G dialout $USER", if I use the terminal from within the unraid interface, I'm root.

 

Does that mean I just should do "sudo usermod -a -G dialout root" ?

 

I've got the docker running now, and bought the Conbee II stick today and plugged it in the server. lsusb points me to

Bus 002 Device 005: ID 1cf1:0030 Dresden Elektronik 

and I've set "/dev/bus/usb/002/005" in the deCONZ device and rebuilded the docker.

 

How should it look in the deCONZ interface if the server and software recognizes the usb-stick?

 

Thanks.

 

EDIT: I changed my device to /dev/ttyACM0 and now it worked. The /dev/bus/usb path is for something else?

 

/Söder

Edited by soder
Link to comment

I believe sudo usermod -a -G dialout $USER adds the current user (root in your case) to the dial out group.

 

The docker should be running under root unless your specifically assign it a different user to run under  (I'm not sure how to do that, but I'm running mine with the default user fine).

 

I used ls -l /dev/serial/by-id to get the serial ID. As long as you don't plug the Conbee into a different USB port than the one its in now in the future, what you have should work fine.

 

Once you log into Phoscon > Hamburger Menu > Settings > Gateway, if it shows a firmware number, its connected. Otherwise it will say "not connected"

  • Thanks 1
Link to comment
36 minutes ago, a_n_d_y said:

I believe sudo usermod -a -G dialout $USER adds the current user (root in your case) to the dial out group.

 

The docker should be running under root unless your specifically assign it a different user to run under  (I'm not sure how to do that, but I'm running mine with the default user fine).

 

I used ls -l /dev/serial/by-id to get the serial ID. As long as you don't plug the Conbee into a different USB port than the one its in now in the future, what you have should work fine.

 

Once you log into Phoscon > Hamburger Menu > Settings > Gateway, if it shows a firmware number, its connected. Otherwise it will say "not connected"

Great. It's live for me. I even found my first unit (Aqara Termometer och hygrometer) in a couple of seconds. 😃

 

I will now spend some time to get these units in to Home Assistant in some way. 😃

 

/Söder

Link to comment
20 minutes ago, a_n_d_y said:

Nice!

 

Just follow the integration for it here:

https://www.home-assistant.io/integrations/deconz/

 

And the devices will pop up and be available in HA to do your bidding. Really easy!

I'm reading that right now, but there's nothing popping up for me in the HA interface on reboot.. 

There's nothing else I should do with the docker now when I got the deCONZ interface working and finding sensors?

 

EDIT: I did the API thing, and then in HA I could find it and the sensor. 😃

Thanks.

 

/Söder

Edited by soder
Link to comment
  • 4 months later...
On 1/2/2020 at 9:41 PM, a_n_d_y said:

In Community Apps, search for deconz and click the Click Here To Get More Results From DockerHub and install the container from marthoc.

 

You'll want to set Network Type to Host.

 

At the bottom of the page will be the link Add another Path, Port, Variable, Label or Device. It does what it says.

 

Add the container path /root/.local/share/dresden-elektronik/deCONZ to point to your config directory, ex. /cache/appdata/deconz

 

You'll also want to pass your device into the container. I just use the Extra Parameters field to do this: --device=/dev/[your_device]

 

Then pass any of the environment variables you need listed on this page (passing them all is fine, just define the values):

https://hub.docker.com/r/marthoc/deconz/

 

The Conbee II defaults to the device name /dev/ttyACM0. If you have another USB device like an Aeotec Zstick, it will also try to assign itself  /dev/ttyACM0 or  /dev/ttyACM1 (depends on which device is assigned first upon boot).

 

Read this about setting a persistent name if thats the case:

https://forums.unraid.net/topic/71372-usb-passthrough-device-location-changing/

 

Then add the Environment Variable DECONZ_DEVICE and enter the value of your persistent name, ex. /dev/[persistent_name]

 

Make sure to telnet into your server and add the user to the dial out group the Drahznar suggested above.

 

If you're having problems with the device connecting in the container, try updating the firmware. I did my firmware update in Windows as I couldn't get it to flash successfully using the docker firmware method described on the docker page.

 

Attached is how I setup my container.

Screen Shot 2020-01-02 at 2.37.30 PM (2).png

 

 

---------- EDIT

I don't get it. I followed you little guide but it just doesnt work for me. The device when i use  ls -l /dev/serial/by-id is ttyACM1 for me and i can start up Decons docker and log in but it shows me the stick but the firmware says Not Connected. I have tried everything ;(

 

This is what my docker looks like.. ;(

lQBovyz.png

 

Of couse i got it working but as usual: I don't know how.

I read somewhere about using an extension cord so i plugged on in and restarted Unraid, ran the command to see the port which had changed once. I changed it and restarted the docker container and then it worked. Maybe not much information but maybe it can be helpful for someone.

Thanks for the guide, much appreciated!
Bought Unraid today after trail ended. It's really nice and i really like it :)

Edited by mituv85
Link to comment

Have you updated the firmware? I had to update mine in Windows.

 

Its recommended to use a USB extension cable and be plugged into a USB 2.0 port.

 

If you're still having issues I guess I would look over your docker logs to see if that gives you any indication of what's going on.

Link to comment
On 5/12/2020 at 9:21 PM, a_n_d_y said:

Have you updated the firmware? I had to update mine in Windows.

 

Its recommended to use a USB extension cable and be plugged into a USB 2.0 port.

 

If you're still having issues I guess I would look over your docker logs to see if that gives you any indication of what's going on.

I got it working. Maybe because of the extension cord. :) Thanks ❤️

Link to comment
  • 2 weeks later...

Hi all,

 

I tried to setup Deconz following your post but I receive error in log :

 

Quote

New 'Joshua:80 (root)' desktop at :80 on machine Joshua

Starting applications specified in /etc/X11/Xvnc-session
Log file is /root/.vnc/Joshua:80.log

Use xtigervncviewer -SecurityTypes VncAuth,TLSVnc -passwd /root/.vnc/passwd Joshua:80 to connect to the VNC server.

18:31:00:188 HTTP Server listen on address 0.0.0.0, port: 666, root: /usr/share/deCONZ/webapp/
18:31:00:206 CTRL. 3.16.218:31:00:229 COM: /dev/ttyACM0 / serialno:
18:31:00:229 COM: --dev: /dev/ttyACM0 (ConBee II)
18:31:00:229 ZCLDB init file /root/.local/share/dresden-elektronik/deCONZ/zcldb.txt
18:31:00:332 parent process /bin/sh
18:31:00:332 gw run mode: docker
18:31:00:332 GW sd-card image version file does not exist: /root/.local/share/dresden-elektronik/deCONZ/gw-version
18:31:00:336 DB sqlite version 3.16.2
18:31:00:336 DB PRAGMA page_count: 37
18:31:00:336 DB PRAGMA page_size: 4096
18:31:00:337 DB PRAGMA freelist_count: 0
18:31:00:337 DB file size 151552 bytes, free pages 0
18:31:00:337 DB PRAGMA user_version: 6
18:31:00:337 DB cleanup
18:31:00:360 DB create temporary views
18:31:00:385 don't close database yet, keep open for 900 seconds
18:31:00:385 started websocket server at port 443
18:31:00:389 found node plugin: libde_rest_plugin.so - REST API Plugin
18:31:00:390 found node plugin: libde_signal_plugin.so - Signal Monitor Plugin
18:31:00:397 found node plugin: libstd_otau_plugin.so - STD OTAU Plugin
18:31:00:407 COM: /dev/ttyACM0 / serialno:
18:31:00:407 COM: --dev: /dev/ttyACM0 (ConBee II)
18:31:05:892 Announced to internet http://dresden-light.appspot.com/discover
18:31:07:813 Invalid admin password hash: $1$8282jdkm$w.o6XjJEGLzAYkVqLPAYx1
18:31:10:900 COM: /dev/ttyACM0 / serialno:
18:31:10:900 COM: --dev: /dev/ttyACM0 (ConBee II)
18:31:10:945 device disconnected reason: 4, index: 0
18:31:11:892 wait reconnect 15 seconds
18:31:11:900 COM: /dev/ttyACM0 / serialno:
18:31:11:900 COM: --dev: /dev/ttyACM0 (ConBee II)
18:31:12:893 wait reconnect 14 seconds

 

I used   

sudo usermod -a -G dialout $USER

 

to solve USB running command on unraid console and then reboot but nothing changed.

 

Can someone please support me?

 

TY

Link to comment
On 1/2/2020 at 8:41 PM, a_n_d_y said:

In Community Apps, search for deconz and click the Click Here To Get More Results From DockerHub and install the container from marthoc.

 

You'll want to set Network Type to Host.

 

At the bottom of the page will be the link Add another Path, Port, Variable, Label or Device. It does what it says.

 

Add the container path /root/.local/share/dresden-elektronik/deCONZ to point to your config directory, ex. /cache/appdata/deconz

 

You'll also want to pass your device into the container. I just use the Extra Parameters field to do this: --device=/dev/[your_device]

 

Then pass any of the environment variables you need listed on this page (passing them all is fine, just define the values):

https://hub.docker.com/r/marthoc/deconz/

 

The Conbee II defaults to the device name /dev/ttyACM0. If you have another USB device like an Aeotec Zstick, it will also try to assign itself  /dev/ttyACM0 or  /dev/ttyACM1 (depends on which device is assigned first upon boot).

 

Read this about setting a persistent name if thats the case:

https://forums.unraid.net/topic/71372-usb-passthrough-device-location-changing/

 

Then add the Environment Variable DECONZ_DEVICE and enter the value of your persistent name, ex. /dev/[persistent_name]

 

Make sure to telnet into your server and add the user to the dial out group the Drahznar suggested above.

 

If you're having problems with the device connecting in the container, try updating the firmware. I did my firmware update in Windows as I couldn't get it to flash successfully using the docker firmware method described on the docker page.

 

Attached is how I setup my container.

Screen Shot 2020-01-02 at 2.37.30 PM (2).png

Dude - this is amazing, I've been pulling my hair out for hours trying to fix this and your post sorted me right out!!!  

 

I was stuggling with an API issue in HomeAssistant trying to link it up to the spaceinvaderone docker image - I didn't want to create my own docker because that's a ballache, but obviously it's the only way to get it really working.  Thank you so much for putting all the technical detail into the post. 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...