Jump to content

QNAP Container Station - Smarthome USB PLM passthrough to HA


kzboray

Recommended Posts

Posted

First time HA user trying to get HA working in a container running on a QNAP server. I’ve successfully loaded the container and HA works great! It see all the devices on my network, but I can’t figure out how to pass through the Smarthome Insteon PLM connected via USB to the QNAP Container Station application.

I can see the USB device listed in the OS...

[~] #  lsusb | grep Serial
Bus 003 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

And I can see it’s on ttyUSB0...

[~] # dmesg | grep Serial
[    7.223967] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[   21.839210] usbserial: USB Serial support registered for pl2303
[  350.701171] usbserial: USB Serial support registered for FTDI USB Serial Device
[  350.708525] ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
[  350.721294] usb 3-2: FTDI USB Serial Device converter now attached to ttyUSB0
[309620.927037] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[309621.060767] usbserial: USB Serial deregistering driver FTDI USB Serial Device
[309664.804139] usbserial: USB Serial support registered for FTDI USB Serial Device
[309664.811582] ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
[309664.824747] usb 3-2: FTDI USB Serial Device converter now attached to ttyUSB0

But when I go to setup the container in Container Station on the QNAP device ttyUSB0 isn’t listed.

2021-11-22_13-19-59.png.71f703dccbfb3ba63a9e491ef38e41a3.png

 

Any suggestions?

Posted

++++++++++++++
UPDATE
++++++++++++++

As it turns out my QNAP server a 870pro circa 2015 won’t support USB pass-through. I was not able to determine if this is still the case on newer OS versions, but for QNAP OS 4.3.6 you just can’t create a HomeAssistant container via the ContainerStation app that supports USB pass-through, you have to do it via the command line.

Once you have created the container it will show up in the Container Station app and you can Start/Stop it there as well as do some minor configuration changes. But you should pass all the necessary parameters via the command line.

Specifically I was trying to pass-through an Insteon USB PLM attached to /dev/ttyUSB0. It’s important to know what the port is, because you will be asked to enter it when setting up the Insteon Integration in HA. You can find it by…

dmesg | grep Serial

The command to start the container is this…

docker run -d --name="home-assistant" -v /share/CACHEDEV1_DATA/homes/kzboray/homeassistant:/config -v /etc/localtime:/etc/localtime:ro -e TZ=America/Los_Angeles --memory="4g" --device=/dev/ttyUSB0:/dev/ttyUSB0 --net=host homeassistant/home-assistant

Location of the HA config files. Change it to where ever you want them to be.

-v /share/CACHEDEV1_DATA/homes/kzboray/homeassistant:/config

Time Zone setting. If this isn’t set you will have problems with HA

-e TZ=America/Los_Angeles

The max amount of memory for the container. A Single digit number followed by M, G, or T

--memory="4g"

This is where the USB device is passed-through to HA. You can have multiple entires, so if I add a z-wave dongle I would add another --device.

 --device=/dev/ttyUSB0:/dev/ttyUSB0

Finally the network port must be set to Host.

--net=host

A caveat is that by creating a container this way you really need to setup the proper configuration in the command line or you will be stuck with the container you create. The only way to change the container setup is to first remove it and then create a new one. Also removing the container in Container Station or via the command line will not remove the configuration.yaml file. This means when you create another container via the command line it will see the old configuration.yaml. This might be fine, or you may want to delete the /config directory after removing the container.

I am new to Docker and a newb at Linux so I am sure there will be new problems with this as time goes on, but this should help to get you started.

  • Like 1
Guest
This topic is now closed to further replies.

×
×
  • Create New...