Will adding a USB hub break things?

I currently have my Zigbee dongle plugged directly into my machine, using Zigbee2MQTT and don’t have any issues.
I’m about to add a Zwave dongle too and figured would be a good time to add both to a USB dongle away from the machine…

However, (I think) I recall having to set a port for the USB device when I set up Zigbee2MQTT - will moving the USB to a dongle change that (and therefore break things?)

Unfortunately I can’t answer your question, but I can tell you, what happened in my case. I had troubles running Zigbee (Electrolama ZZH) when dongle was plugged directly into the machine port (Raspberry 4B) - it was loosing connection and stopping randomly at least once per day.
Then I connected it via USB Hub (unpowered, just passive) on the same USB port and it works without any issues since. And even port number or any settings didn’t change!

Although I can’t guarantee that it will be the same in your case…

If you’re using the /dev/serial/by-id/ path for the device you should be fine.

Of course, if you’re running HA in a VM on that computer, more steps may be required.

1 Like

I’m using:
image
(Zigbee2MQTT settings)

which looks like this in the addon settings:
image

That’s the address of the USB that the dongle is plugged into. You need to identify the long by-id path to your dongle and replace that path with it before you move the stick. Once your up and running with the by-id address you can move the stick easily (with caveat on virtual machine noted above)

1 Like

Sorry if this is obvious, but how do I identify the “long by-id path”?
And would I replace the path in both places (or does one set the other)

(I’m not on a virtual machine)

If you have access to the CLI (console) do:
ls -l /dev/serial/by-id
or if not “root”:
sudo ls -l /dev/serial/by-id

Stoud should print the ID of the particular Zigbee (or Zwave) dongle to the console.

As for the Zigbee Dongle you then set inside Z2M’s configuration.yaml instead of:


  port: /dev/ttyUSB0

change to:

  port: /dev/serial/by-id/[whatever_was_printed_at_console_with_the_previous_ls_command]
2 Likes

Okay, so I have terminal, ran the command and got

usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_24a8249e1c9dec11b3f0654d73138bba-if00-port0 -> ../../ttyUSB0```

Just to be clear, it’s the

usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_24a8249e1c9dec11b3f0654d73138bba-if00-port0

that I stick in there and ignore the → piece

(as an aside, the terminal does not seem to allow copying, which is very annoying!)

in most terminals select the text you want to copy with the mouse and right click.
It will be placed on clipboard.

if your terminal does not support that, try using Putty.

1 Like

That is correct :+1:t3:

2 Likes

I’m just using the terminal in the HA UI - “SSH & Web Terminal” addon

1 Like

I don’t use that addon but if you can mark (parts of) the console output the keyboard shortcuts CTRL+c (copy) and CTRL+v (paste) should do.

1 Like

You’d think, sadly they don’t
Not to worry anyway - my job is done on this, so i will save that problem for another day (thanks all for the help!)

2 Likes

Hmm, i just changed it using a hub without using the full serial path and it still works, but not sure how. I see it show in adapter but i also still see the /dev/ttyACM0 device (which i specified).

One thing i have noticed is that by putting a usb hub in between it seems to take longer for zigbeemqtt to find the device. But it looks like that’s only upon a complete host restart, not a normal HA restart.