USB connection problems with Hass.IO on Intel NUC, Docker and Ubuntu

Can somebody, definitively, explain to me how to configure USB ports in a setup with Hass.IO on Docker, on Ubuntu (Server 18.04) on an Intel NUC? I have both an Aeotec Z-Wave stick (5gen) and a Conbee II Zigbee stick that I would like to use and so far I have been fairly unsuccessful. I have scoured these forums as well as the subreddit and have found partial answers to my questions but none of them seem to work, or (most probably) I’m doing something wrong that I can’t figure out.

What I know:

  • I have both the sticks connecting and they kind of work when I reference them as /dev/ttyACM0 and /dev/ttyACM1, but as is often mentioned here this isn’t a reliable way of referencing since at boot these references can get mixed up.
  • I have tried using /dev/serial/by-id/etcetc but Deconz complains most of the times and ZWave simply stops working altogether.
  • I have tried setting up udev rules and adding a pass through to the homeassistant docker using Portainer (Portainer installed separately next to Hass.IO, not as a Hass.IO add-on). I can see the udev rules being picked up by Ubuntu, but passing through to Hass.IO doesn’t seem to work since they are not visible through SSH and the System > Hardware tab in the Hass.IO screen.
  • I have ruled out, I think, that something might be wrong with the sticks because things seem to work correctly if I connect only one of the two and there is no doubt over which stick is ttyACM0.
  • I did notice something about adding a user to the “dialout” group, but I’m not entirely sure which user and how to add this (command line, through Portainer)? This is in relation to the pass through with the udev rules.

Many thanks to anyone willing to think with me on this problem! I’m very aware that this probably has to do with my lack of experience with Linux, I just can’t seem to put the right bits of information together to make this work. Thanks again!

Update:
I didn’t get a definitive answer on my first question, however I got other stuff fixed in regard to Zigbee.

Could you be seeing this bug?

https://github.com/home-assistant/hassio-addons/issues/781

It’s worth a try to figure out :slight_smile: I guess I need to remove the Zwave stick and see of deconz works with the “by-id” reference. Will report back later, thanks for pointing me to this bug (although I’m not happy with this being a situation unresolvable by me :wink: )!

Hi
If you run hassio on HassOS on a Raspberry then it is difficult to resolve

But since you run your Home Assistant on Ubuntu in Docker there is an easy and quite acceptable easy fix. The issue is in the way the Addon is working. But noone says Deconz has to be an Addon. It can run on a different machine. Home Assistant talks to Deconz via a websocket.

What I did was install Deconz directly in Ubuntu.

This is what it takes to move from Addon to bare metal.

First you create a backup of your Phoscon which is done inside Phoscon. Create the backup and download it and keep it at a safe place.
Next stop the Deconz addon and remove it.
Inside Home Assistant you delete the Deconz integration.

Now to the installation on Ubuntu

It is all described here. To get the same versions as the Addon you need to install the Beta.

In summary

sudo gpasswd -a $USER dialout

wget -O - http://phoscon.de/apt/deconz.pub.key |  sudo apt-key add -

sudo sh -c "echo 'deb [arch=amd64] http://phoscon.de/apt/deconz  $(lsb_release -cs)-beta main' > /etc/apt/sources.list.d/deconz.list"

sudo apt update

sudo apt install deconz

You can now start Deconz from the Application menu in Ubuntu.
If you run Ubuntu without a GUI you can start it with systemctl

sudo systemctl enable deconz
sudo systemctl start deconz

You now have Deconz running on bare metal. It gets auto updated when you run your normal maintenance apt update and apt upgrade cycles in the Ubuntu. It automatically starts at boot.

Last you need to open the Phoscon App which runs on standard web port 80 of the host Ubuntu by default. So you open it from a browser.

And then last step is to create login and reload the backup you made earlier.

When you get back in Home Assistant it should already have detected the new Deconz and then it is just to reapply the Deconz integration with the IP address of the host Ubuntu and all should load back as it was before.

The result is a Deconz that runs 100% independent of the Home Assistant Docker thingy and gets updated when Dresden Elektronik updates it.

Thanks Kenneth, it’s nice to take the time to explain this :slight_smile: I was considering if this route was possible but was (so far) unable to see how to connect a standalone deconz to HassIO. Websockets is the answer. And since I’m still not a Linux power user this all helps a lot, thanks so much!

Hi Michael
Even when Deconz runs as Addon it still talks via the Websocket. There is no difference.

Note that when you run Deconz with the headless version you cannot run the GUI Deconz app via VNC like with the Addon. If your Ubuntu is with a GUI then the installation adds a menu item in the application menu system. Then you need to do sudo systemctl stop deconz and start the Deconz program in the Ubuntu desktop environment. When running Deconz works normally in Home Assistant. When you are done you exit the Deconz software and start the headless version again with sudo systemctl start deconz.

You can for sure create a VNC session of the graphical Deconz software but I see no reason. The only time I need the Deconz GUI is when I software upgrade an Ikea firmware or need to see the mesh network. I prefer not having a VNC session running to take resources from the machine unless I need it.

I’m running the whole installation on a headless NUC that’s sitting in a closet somewhere. But all the things I have planned for it I can do through the web interface, it’s mostly there for running Aqara and some other sensors without a Xiaomi hub. My lights are all Ikea and I have the Ikea hub so that lights are still controllable when Home Assistant fails (which it has done many times the last year or so, that’s why I’m moving to the NUC).

The installation went well and all seems to be working fine, it’s finding the USB stick without a problem and it communicates well with my Hue Dimmer Switch. However, there is another problem that maybe you can help with?

I have two Aqara Door/Window sensors paired with Deconz that become unresponsive after a while. When I add them they work fine, they show open and close animations immediately in the Deconz GUI as well as in Home Assistant. But after one or two hours the become just unresponsive. They just always show “closed” states. When I delete and repair the sensors in Deconz they just work fine again until they become unresponsive again. I’ve tried replacing the battery but that didn’t help. The sensors are also quite close to the stick (~1,5m and ~6m) so interference shouldn’t be a big issue as well. It would be a coincidence if both sensors would be broken so my guess there might be something wrong in Deconz? If you have any idea what might be going on, or where to look further (where can I find logs?) that would be helpful! So far I haven’t found many answers here on the forums.

I have read many have had problems with these sensors. Not only on Deconz. I remember seeing similar reports from people running Zigbee2MQTT
It seems to be more related to which other devices you have on the system acting as routers.
It could also be that we have different versions of firmware in our Aqara sensors. And if that is the problem the solution could be to buy some newer ones - after all they are dirt cheap. Mine are rock solid and I have 6 of them. But I also have a huge installation of Philips Hue bulbs and smart plugs and other mains powered routers so I have a lot of redundancy.
I doubt interference is the cause of loosing devices.

Yes, I ordered some already last week for a different project so I can compare them hopefully. These ones say they are version 20161128, assuming it’s a date that’s three years old so you could probably be right. We’ll see. I’m also thinking how I can add a permanently mains connected device in between to see if that helps. Thanks again so far :slight_smile:

An update for any future readers:

I think I’ve found a solution to my problems, it either has to do with a firmware update of the Conbee II stick or a factory reset of the stick. After a couple of days of bad results I installed Deconz on a spare RasPi and tried a couple of things. Instead of the beta I installed the stable version and this version prompted me to update the firmware on the stick (or I have overlooked this option so far). After that I saw the option to factory reset and I could almost hit myself in the head for not thinking about this. I didn’t have a huge Zigbee network relying on this stick so resetting was a no-brainer. I’m not sure which of these two measures did the trick, I would guess the reset, but it worked. At least, everything seems to be working fine so far.

I’m waiting one more day before finally calling this a final success, but we’re close! And happy to, the new sensors arrived and a bunch more are on their way. Adding them to the Zigbee network will add a lot more possibilities for automation and I’m looking forward to that. Thanks @KennethLavrsen for thinking with me on this!

1 Like