Usb connections change

Hello,

i have multiple usb devices connected,
when i lose power or do a reboot, HA configures the usb again,
sometimes things stop working and i need te switch some usb cables to make it work again,

is there a solution to give them permanent port number?

tried to use chatgpt to get a solution, but that didnt work
adding this to configuration.yaml only causes errors in all my devices :
sensor:

  • platform: serial
    name: “USB Arduino”
    serial_port: “/dev/usb-arduino”
    baudrate: 115200

  • platform: serial
    name: “Zigbee Dongle”
    serial_port: “/dev/usb-zigbee”
    baudrate: 115200

after that i tried to use the udev rule. (second suggestion of chatgp)
but that give this error in the therminal:
zsh: command not found: udevadm

does someone have this same problem and got a good solution?
i have HA working on a HP Thinclient

Thank you,

Gr jos

use /dev/serial/by-id/…

in terminal, use

ls /dev/serial/by-id 

to determine the correct id’s

2 Likes

You can also get the serial/by-id/ value here in the list of hardware.
Open your Home Assistant instance and show hardware information.

1 Like

As mentioned in the previous posts, you can certainly use /dev/serial/by-id/ if the config for whatever Zigbee integration you’re using.

You don’t provide any more info what this “USB Arduino” is, nor how it’s integrated into HA, so we can’t help you with that until you do

1 Like

thank you all for your reply

i used ls /dev/serial/by-id

an got the following

usb-FTDI_FT232R_USB_UART_A15WRHSN-if00-port0
usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0
usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231031204608-if00
usb-Silicon_Labs_CP2104_USB_to_UART_Bridge_Controller_010D5B4B-if00-port0

also in hardware:

got connected:
p1 smart meter cable
zigbee dongle
modbus to heat pump
RS485 to ardiuno (using mysensors)

Ok, now we’re getting somewhere. Despite not telling us which integrations you use beyond mysensors, it seems you might be able to use the serial path when defining the config for your RS485 to arduino:

thank you for your reply,

p1 smart meter cable — DSMR Smart meter
zigbee dongle — Zigbee home automation
modbus to heat pump (cp2102) — configured in configuration.yaml (now i see modbus as interation)
RS485 to ardiuno (cp2104) — mysensors

I selected the right port in the mysensors instalation,
but when i do a reboot ttyUSB1 can change in ttyUSB0 of ttyUSB2
so then it loses connection.

last reboot after update, it switched 2 usb conectors and lost my p1 smart meter and the mysensors
than i looked what usbs were different, switched the cables (faster than setting everting up again)
and then they work again,

If you entered dev/ttyACM during installation, then you didn’t set the “right” port. You simply selected the port that was currently assigned to your device.

As explained above, you should be using /dev/serial/by-id to avoid the issues you are experiencing. Unfortunately this means you will probably have to reconfigure (or delete & reinstall) your integration in order to get to the setup page.

I think i understand what you mean now,

got them here both, the old /dev/ttyUSB1 (what i need to remove)
and the new one.

an the configuration in configuration.yaml

is this correct?