How do I view the USB devices with HASS.io?

I have the same issue, did you ever resolve it?

Use hassio hardware info

3 Likes

Is there any news on being able to mount USB storage? Are addons like MariaDB able to use it? I was looking at having my MariaDB databases saved to a USB stick instead of the Hass SD card.

there is a way to set persistent usb in hass.io with docker on ubuntu?

I believe you can…I’m no docker expert but here is what you want to try.
First create a persistent symlink on your Ubuntu host using udev. I assume you have that set already, there are quite a few posts explaining how to do this. Once you have /dev/zwave (or whatever you are connecting) install portainer so you can visually manage your docker containers (again, assume it’s easier at cli bit I’m no expert). Edit your homeassistant container and go to Advanced->Runtime and resources. There you will see all your /dev/ mappings, remove one and add your device…once done deploy the container and it should work. Make sure you backup before.,…if it wasn’t clear yet…I’m no expert.

Going crazy here trying to find Advanced -> Runtime and Resources settings for the homeassistant container in Portainer. Please point me in the right direction. Thanks.

UPDATE: Found it under the Duplicate/Edit button when viewing container details.

Unfortunately, the suggestion is not working for me. I added devices with the symbolic link names that I created, e.g., /dev/zwave, and mapped them to devices of the same name in the container. I then clicked Deploy Container. The mapping did not persist after a reboot.

Am I doing something wrong? Cheers.

Select the homeassistant container, hit the “Duplicate/Edit Button” then scroll down. Advanced is the section of the page and Runtime and resources is a tab…see attached screenshot.

if you kept the old container, you need to make sure that it is not running anymore…it will start on it’s own if you don’t remove it…I’m not sure how the supervisor container handles this duplicate/edit but I did notice that when I tried to keep the old container it started up again…also noticed that for some reason it updates homeassistant to the beta version…

Thanks. I think that may be the behavior I’m seeing, And, sure enough, homeassistant updated to the beta version.

Thanks for the suggestion and tips. I’ll come back to this after some further investigation.

I’ve also seen this:
For some devices the /dev/ttyAMA0 device is not detected by udev and is therefore not mapped by Docker. To explicitly set this device for mapping to Home-Assistant, execute the following command using the ssh add-on:

$ curl -d ‘{“devices”: [“ttyAMA0”]}’ http://hassio/homeassistant/options
After that, you need to change usb_path to /dev/ttyAMA0 in your configuration.yaml.

But this is probably for an older version as the URL doesn’t use authentication. If you could find that in the documentation somewhere you may be able to get the URL that will authenticate.

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…

@Teri928 I was hoping to do the same with putting the MariaDB files on a mounted USB. Any luck?

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;

  1. I used this link to SSH into the base operating system https://developers.home-assistant.io/docs/en/hassio_debugging.html

  2. 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’

  1. Connect a screen and keybard to your Raspberry PI running HassOS.
  2. Press Enter
  • You will see homeassistant login
  1. Login as root
  • You will see ha >
  1. Type in: login
  • You will see # (this means you are now on the HassOs Terminal as root)
  1. Type in: vi /etc/udev/rules.dev/paradox.rules
  2. Insert the following into the file by pressing i on your keyboard: SUBSYSTEMS==“usb”, ATTRS{idVendor}==“0403”, ATTRS{idProduct}==“6001”, SYMLINK+=“paradox”, MODE=“0666”
  3. Press Esc
  4. Type in (note the : in front of wq): :wq
  5. Type in: cat paradox.rules
  • You should see SUBSYSTEMS==“usb”, ATTRS{idVendor}==“0403”, ATTRS{idProduct}==“6001”, SYMLINK+=“paradox”, MODE=“0666” being displayed
  1. 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 ~ $

  1. ~ $ ha hardware info
  2. ~ $ 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.

2 Likes

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.

6 Likes

Thanks! :+1:

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).