If /dev/ttyUSB0 (Zigbee stick) has the wrong permissions, please add an error stating that

I’ve installed home assistant on my PC running arch Linux, using this guide [1]. When /dev/ttyUSB0 has the wrong permissions, an USB to zigbee stick is not detected (understandable), but home assistant doesn’t give the error that it’s not allowed to access the device note, giving the impression that the Zigbee stick itself is not supported.

Please consider adding an error message like “writing to /dev/ttyUSB0 Operation not permitted”

In detail:

Click add integration. Now a list with brands pops up
Choose zigbee home automation. now it asks for the serial port
Select /dev/ttyUSB0 - CP2102N USB to UART Bridge controller
Click submit. Now it asks for Radio type. Accept EZSP 
choose submit. Now it asks the serial port settings. Accept 115200 and /dev/ttyUSB0 and no data flow control
Press submit. Now the error "Failed to connect" comes up
no messages are added to the terminal where I am running this command:
# journalctl -fu home-assistant

Press X. The dialog dissapears.

On the host system I see /dev/ttyUSB0 is accessible by root and uucp. 
# ls -l /dev/ttyUSB0
crw-rw---- 1 root uucp 188, 0 Jan 24 08:26 /dev/ttyUSB0

I also see home assistant (hass) is running as the user hass:
# pstree -u
systemd─┬─hass(hass)───15*[{hass}]

The user hass isn't a member of the group uucp, so it isn't allowed to communicate with /dev/ttyUSB0:
# cat /etc/group
hass:x:972:

To force access to /dev/ttyUSB0 I set the permissions to 666:
# chmod 666 /dev/ttyUSB0
# ls -l /dev/ttyUSB0
crw-rw-rw- 1 root uucp 188, 0 Jan 24 08:26 /dev/ttyUSB0

Now I try to access the zigbee stick again:
Click add integration. Now a list with brands pops up
Choose zigbee home automation. now it asks for the serial port
Select /dev/ttyUSB0 - CP2102N USB to UART Bridge controller
Click submit. I see a spinning thing. After 15 seconds, It asks "Choose the network settings for your radio" 
Choose "erase network settings and create a new network" I see "Loading next step for Zigbee Home Automation" and after about a minute "success"
Choose bedroom and finish

My versions:

Requirement already satisfied: six>=1.5 in /var/lib/hass/.venv/lib/python3.13/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.37.0,>=1.36.5->boto3>=1.10.49->pycognito==2024.5.1->hass-nabucasa==0.87.0->homeassistant==2025.1.3) (1.17.0)
# uname -a
Linux archlinux 6.12.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 18 Jan 2025 02:26:57 +0000 x86_64 GNU/Linux

[1] Home Assistant - ArchWiki

Jesus… trying chmod 666 to solve problems

Mate this is not a HA problem

I suggest you learn Arch, learn about Linux users and groups, post this issue on the arch support forum surely someone will help… I’ve heard their community is not completely full of egotistic ****s someone may help you

Tl:Dr User has a permissions problem and doesn’t know how to add the user ‘hass’ to the correct groups needed to access the device

Thank you _dev_null, I fully agree with your post… At the same time you have completely missed the point I was trying to make.

Agreed the chmod 666 is the worst way to solve a permission problem. It’s also the fastest and most clear way to demonstrate the user hass doesn’t have the needed permissions to /dev/ttyUSB0, and that the problem goes away when the user hass is allowed to read/write /dev/ttyUSB0

The missing feature in home assistant is that home assistant does give the error “Failed to connect”, but doesn’t tell the user WHY it failed to connect. That’s the feature request, a more clear error.

I suggest home assistant gives this error in case it’s not allowed to read/write the device node:

“Failed to connect: Operation not permitted”

Is the above the best way to convey that information, or is a different error more clear?

This may also be resolved by using the suggested by_serial id for the stick instead of that one. This has the added benefit that when a reboot changes the port that the Linux selects for your device, stuff still works.

I would also look into adding user permissions to dialout to allow this, as opposed to giving everyone permission should you want to continue using the same id path.

The arch linux wiki also has a solution:
" No access to USB devices In the default installation, the Home Assistant may not have the necessary access to work with some devices, such as a Zigbee USB dongle. This is because such devices are controlled by the uucp system group.

Edit the home-assistant.service and add SupplementaryGroups=uucp to the [Service] section so that the default hass user belongs to the right group. Then, after a daemon-reload and restart of home-assistant.service it should be up and running."

But that’s not the point. I am requesting more verbose error messages, so I know if the permissions are not good, or if i have chosen the wrong ttyUSB device node. For instance when I have both a zigbee stick, and an USB to RS485 converter connected.

1 Like

That would be solved by using the by_serial (or by_id) alias which the Linux kernel has done for many years for exactly this reason.

1 Like

Obviously you can do what you want, but continually telling people that are agreeing with each other and not agreeing with you should tell you something.
I hope you find your way.

Also arch isn’t really a supported OS for anything HA I don’t think. So we can’t be of much help to you anyways, you appear to be in

territory.

Out of curiosity, why did you choose Arch ?

Of all the linux distros I’ve used since the 90s it’s the most bas*****d version ever. Being built on Linux imho is an insult to us and the linux name. It’s unnecessarily more difficult and easier to break.

Yes it’s a delight for power users but not exactly newbie friendly … It’s like the Arch creator wanted something to keep him on the edge like a red hot poker stick up his anus :rofl:

IMHO arch is great. Pretty much the best documentation out there. I have lost count of the time I have googled how to do something in Linux, and ended on the arch docs.

Yes the documentation has to be good as one wrong turn on Arch and you’ll screw it all up :laughing:

Also the docs are good but what happens is that Joe Bloggs ends up copying and pasting it all in without learning or understanding exactly what their doing.

Sorry, thread derailed.

In typical Arch fashion let’s throw out some commands for one to follow

sudo useradd -G uucp hass
sudo systemctl restart home-assistant

Not sure what it does but may help :man_shrugging:

I’ve split out the discussion about Arch Linux above to this new thread:

Maybe we can continue that discussion there?