This is a quick guide on how to connect ZHA to a Zigbee coordinator on different hardware than the hardware HomeAssistant is running on.
Reasons for wanting to do this could include:
HomeAssistant running on hardware in a bad location in your house
Needing to use ZHA over Z2M
Long USB cords causing instability in Zigbee network
You will need another computer running Linux. A Raspberry Pi would work fine. I am using some really old Optiplex SFF running Debian.
On the linux computer, run apt install ser2net.
Get the USB path by-id. This prevents issues when plugging in other devices to USB ports or moving the device to a different port. ls /dev/serial/by-id
My output: usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2420347-if00
Edit the yaml config for ser2net with sudo nano /etc/ser2net.yaml
3.a The file will have a bunch of default config in it - comment all of that out and add the new config to the bottom:
Check: [Connect to a remote adapter | Zigbee2MQTT](Connect to a Remote Adapter) for examples of other adapter configs. Note I changed the Conbee II config slightly from the example in that article to match the default configs I noticed in the yaml file and added some options I think provide more stability. I am not sure if this was necessary.
Save with ctrl+x and execute:
sudo systemctl restart ser2net
In HomeAssistant navigate to Settings > Devices & Services > Integrations > ZHA (Configure button).
Click Migrate Radio
Select reconfigure the current radio
On serial device path click “enter manually”
Type in:
tcp://192.168.X.X:20108
9.a Substitute 192.168.X.X with the IP or hostname of the workstation that the coordinator is plugged into.
I have HomeAssistant running on a rack server in the basement. Previously I was using a very long USB cable and a lot of commands would fail, especially scenes involving a lot of Zigbee devices. Since making this change the stability has been rock solid.
Edit:
Changed the USB path to device by-id - Thanks SwerveShot
Added chardeley-min and chardelay-max options in ser2net.yaml - not sure if this actually does anything, but larger commans, like turn off all the lights at once, seem to be more consistent.
Added “or hostname” in option 9, as that is what I am using now
What an excellent idea. I was just wondering if this would be possible only to find a complete guide available to me. Thanks a lot for posting your setup.
At the moment I have a POPP ZB Stick connected directly to my home assistant server, but having it located elsewhere will be much better in terms of signal strength. So I will definitely give this a try.
I’m already using an old Raspberry Pi with ser2net to connect to my smart utility meter which is nowhere near my home assistant server. Adding a couple of new lines to my ser2net config is something I think I can probably handle.
Aside from the fact that I’m running a bit older version of ser2net which does not support a YAML style config the migration went fine. I don’t have a kickolduser setting and reloading the zha integration did not close the TCP connection right away. So I had to allow more than 1 connection.
Finally, as suggested on the ZHA integration page I switched to using the device path /dev/serial/by-id instead of using /dev/ttyUSB1. This will cause the configuration to still work when sticking USB devices in other ports than they were inserted originally. And maybe got another ttyUSB reference assigned. Devices in the /dev/serial/by-id path are simply symbolic links so it does not affect the way the devices work.
I don’t get errors when performing backups. I did recently switch to a Sonoff 3.0 and backing up from Conbee to Sonoff failed, but I think that’s to be expected.
Hello, first, thanks for this guide! I am also looking for such a solution so that I want to move my device running home assistant to basement, and I still need to put the Z-Wave and ZHA stick in the middle of living room.
I just have question, because in the home assistant ZHA documentation, it says Ser2Net remote adapter is not recommended, “Serial protocols used by the Zigbee Coordinator do not have enough robustness, resilience, or fault tolerance to handle packet loss and latency delays that can occur over unstable connections.”
I know this is somehow has to be comprised. I only want to ask, what is the real experience you have with this setup. Is there realizable behavior? Or it doesn’t have big impact?
Thanks! I currently only connected on IKEA remote button in the ZHA, and want to add a Aqara relay module later.