Closed tinkerdudeno1 closed 2 years ago
For the record I should add: usd-devices
is not part of the virgin HA Docker image. It does work when you mount the host usb-devices
command to the container, but it's not there out of the box. But even with the info from there, I wasn't able to reliably link a serial device like /dev/ttyUSB1 to it. That was to much of a deep dive into Linux serial device handling and way to many symbolic links and seemingly duplicate and overwhelmingly cascacded directories for my head.
Hi @tinkerdudeno1,
did you try the new version which should solve your situation? Thanks, István
Yes I did try the new version, it was my own development ;-) Works like a charm for me (hope I didn't break anything) Thanks for merging!
First of all: Thanks for your efforts in this project. I'm new to HA and was excited to see someone took a step to get the Elero stuff going. I have HA running in Docker using their official image. Unfortunately, discovery does not seem to be working in there.
Let me try to sum up what I understand: Discovery is done here in your code https://github.com/W00D00/home-assistant-elero/blob/cf8ff7c8fe9406db4a7d9f616509b415abcf7723/config/custom_components/elero/__init__.py#L171-L184
When I e.g. print
cp.manufacturer
within that loop, it's always None. Just likelsusb
on the system returns no detailed info:However,
usb-devices
shows everything we need:The info is there, it's just not being used by the pyserial package. All this is a limitation of the Alpine base image HA uses, I have yet to find a different image with the same problems. I think it should be possible to at least add additional queries in the code in case the "traditional" discovery via pyserial fails but it would be quite a rewrite of the code.