Scratch my previous posts…this doesn’t work…I have been fiddling with this for a few hours and it doesn’t seem to stick. I’m just not sure I understand how the homeassistant container is created/run. I can see the service that calls the supervisor container but not sure I understand how it goes from there…
I’ve been trying to get this to work too… no luck yet, but at least have worked through how to submit curls against this URL now that it requires authentication
You can submit this in an SSH session on Hassio to deal with authentication issues
curl -H “X-HassIO-Key: $HASSIO_TOKEN” -d ‘{“devices”: [“ttyAMA0”]}’ http://hassio/homeassistant/options
However, this fails with another error. "{“result”: “error”, “message”: “extra keys not allowed @ data[‘devices’].”
Hopefully someone on this thread will be able to take the next step.
A further observation on this thread that may prove useful.
I note that the HASSIO SSH plug-in is a container, furthermore, that container doesn’t map /dev devices in the same way as the homeassistant container.
To debug my issue (which was to see how a USB HID device appeared), I used the following approach;
-
I used this link to SSH into the base operating system https://developers.home-assistant.io/docs/en/hassio_debugging.html
-
From there I could view devices in a couple of ways
2a. View the devices visible to the base OS ‘ls /dev’. I note I could see my device
2b. View the devices in the homeassistant container ‘docker exec homeassistant ls /dev’
For me, the requirement to add devices to be mapped explictly wasn’t needed, my device as usbhid0 appeared in both the base OS and the homeassistant container (though not in the HASSIO SSH container)
So this is how I hacked this error:
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: ‘/dev/ttyUSB0’
- Connect a screen and keybard to your Raspberry PI running HassOS.
- Press Enter
- You will see homeassistant login
- Login as root
- You will see ha >
- Type in: login
- You will see # (this means you are now on the HassOs Terminal as root)
- Type in: vi /etc/udev/rules.dev/paradox.rules
- Insert the following into the file by pressing i on your keyboard: SUBSYSTEMS==“usb”, ATTRS{idVendor}==“0403”, ATTRS{idProduct}==“6001”, SYMLINK+=“paradox”, MODE=“0666”
- Press Esc
- Type in (note the : in front of wq): :wq
- Type in: cat paradox.rules
- You should see SUBSYSTEMS==“usb”, ATTRS{idVendor}==“0403”, ATTRS{idProduct}==“6001”, SYMLINK+=“paradox”, MODE=“0666” being displayed
- Reboot and your Paradox Addon should now be able to access /dev/ttyUSB0
If you are running hassio on a virtual machine you can get the information by two commands.
In Home Assistant CLI , either SSH or locally, enter the bold text after the ~ $
- ~ $ ha hardware info
- ~ $ dmesg | grep usb
I am running Virtualbox 6 (it need to be version six to have host to client usb support). If you are running Virtualbox 5.x consider upgrading to version 6.
Be aware that the virtual machine made in VB 5x is not supported fully in 6.x.
Two things that you then can do is: export the whole machine first to OVF format and then import it in the new Virtual Machine program (VMware, VB6, etc…).
Or start with a fresh VM and keeping your HASS configuration by make a copy from your config map (all the yaml files, custom components and database) Then setup a new VM; install fresh hassio (ovf import) and copy the content of your config map on the new installed HA.
Using Home Assistant Operating System on VM
hardware info
The text goes by so fast it is not readable.
As far as I know dmesg is not available.
What else can I try?
go to Supervisor, then System, then click on the 3 vertical dots under Host, then Hardware.
You will see a list of your USB ports and lots more.
Hi, Came across this thread when attempting to connect a usb device (arduino) via Firmata. Athena provided the final step. Thanks. Note that dmesg | grep usb tells you the name of the USB device but not that it is located in /dev. So the full serial_port name for firmata and other integrations is /dev/usbname_from_dmsesg.
I have Hassio installed in a virtual box vm. I struggled to “see” the physical usb port. Here is my solution:
1.) Set up the virtual machine to allow access to a USB device.
2.) When following tiebing creating the filter is NOT optional. Use VBoxManage list usbhost to get the required information for the filter.
3.) You can attach and detach the USB port as desired (the filter does it automagically) but note that the UUID of the usb device changes with each restart/reconnection. Use VBoxManage list usbhost to get the ‘latest’ UUID. This isn’t necessary if you set up the filter properly.
4.) You can delete filters if required. Google the virtual box filter instructions. Note that if you delete filter 0, then filter 1 becomes filter 0 (if it exists).