I noticed today my Zigbee2MQTT stops working when I plug in an ESPHome device to upload new firmware to it.
When I set up the Sonoff Zigbee stick, it was recognised as ttyUSB0. So I entered that in the Zigbee2MQTT addon config page.
It worked perfectly, until today I plugged in a ESPHome device to update it’s firmware. The firmware uploading would keep failing and it said something about multiple devices on ttyUSB0. Then I noticed in the list of devices to choose from (in ESPHome addon), it said the ESPHome device was ttyUSB0, and the Sonoff stick had become ttyUSB1.
I then went into the Zigbee2MQTT addon to change the serial port in the config. That is when I noticed the addon was not running. It had stopped. After changing the port to ttyUSB1, I could start Zigbee2MQTT again and also the ESPHome firmware uploading worked again.
Then, when I unplugged the ESPHome device, the Sonoff stick became ttyUSB0 again, which again made the Zigbee2MQTT addon stop. Changing it’s serial port back to ttyUSB0 fixed it again.
So the main question basically is:
How do I give the Sonoff USB Stick a fixed serial port, so it doesn’t change when I plug in another USB serial device?
In case it’s relevant: I run HAOS in a VM on Proxmox. And I passthrough the connected USB devices to the HAOS VM.
On the page with the 2 charts, there is a button with 3 dots in the top right corner. Click that, and then “all hardware”. There you can find the string to use instead of /dev/ttyusbX
Then I assume the “all hardware” page is only available in HAOS. If you run it in docker, I think you should look for that string somewhere in your host OS. A good place to start would be where you passed through the USB dongle to your docker container. But I have no experience with that, so I probably can’t be much more help unfortunately.
What does the docker command or docker compose file you use for HA look like?