Some tips about setting up Zigbee or Z-wave mesh networks.

I’ve had a few people new to Home Assistant ask about how to best set up their mesh networks. Here’s my take on what works best.

Before you start using Zigbee, make sure your Zigbee and 2.4GHz WIFI aren’t stepping on each other

See https://www.youtube.com/watch?v=t-gw7kURXCk for details, but the TL;DR is that Zigbee uses the same 2.4GHz radio frequency band that 2.4GHz WIFI does, so choose your channels wisely to avoid overlap.

You probably already know that wifi channels interfere with each other, so the best channels to use to avoid interference are 1, 6 and 11. Once you put Zigbee into the mix, you need to also know that Wifi channel 1 interferes with zigbee channels 11-17, wifi channel 6 interferes with zigbee channels 13-23, and wifi channel 11 interferes with zigbee channels 18-26. Some zigbee devices don’t work with channel 26, so even though it’ll get the least interference from wifi, you’ll want to rule it out.

If you’re using multiple wifi access points, you’ll want to set them to use different wifi channels so they don’t interfere with each other. Your best choices are using wifi channels 1 & 6 with zigbee channel 24, wifi 6 & 11 with zigbee channel 11, or wifi 1 and 11 with zigbee channel 18.

Changing the Zigbee channel forces you to re-pair every Zigbee device. This sucks, so plan ahead. Changing the 2.4GHz WIFI channel on your access points is a lot less painful. You don’t have to worry about this with Z-Wave since it uses 800-900Mhz depending on the country.

How to determine what zigbee channel zigbee2mqtt is using

Go to Settings, Advanced, and then you’ll see your zigbee channel.

z2m-zigbee-channel

Use a USB extension cable

Computers can spew out a lot of radio interference, especially if you’re using a single-board computer like a Raspberry Pi or ODROID that has a cheap plastic case that is effectively unshielded. A 15 foot USB extension cable will make a lot of signal issues with your Zigbee or Z-Wave mesh disappear, with the added bonus that you can put the dongle in a location that’s not convenient to put a computer. I’ve got my servers racked in my basement, but the dongles are on the basement ceiling directly under powered Zwave and Zigbee switches so my meshes are very strong.

Add your powered devices first

Zigbee and Z-Wave both are mesh networks. If you’re doing a new setup, start with your powered devices since they can act as routers. Start with the ones closest to your coordinator, then work your way outward. This way, when you start adding your battery devices the mesh will already have routers in place and the battery devices won’t all try to connect directly to the coordinator.

Add devices where you’re going to use them, not while next to your coordinator

In the past, I’ve had new Zigbee and Z-Wave devices sometimes show spotty performance. After some experimentation, the problem seemed to be based on where the new device was when I added it to the mesh. When you add a device when it’s right next to the mesh coordinator attached to your Home Assistant machine, it will query all the routers it can see, see that the coordinator is available, and to try to minimize hops to the coordinator it will connect directly. This would be no big deal except that when you move it somewhere else (like when I moved a new smart plug from the basement next to my Home Assistant machine to the second floor), it will still try to talk directly to the coordinator rather than any adjacent routers and have sub-optimal performance.

Instead, take it to wherever you’re going to use it and plug it in there and pair it there. This will let it detect which of your routers have the strongest signals and connect to them instead of trying to connect directly to the coordinator. If you’re adding a new router like a smart plug, this will immediately strengthen your mesh.

It’s not a huge deal if you don’t do it this way. With Zigbee the coordinator will eventually get around to rebalancing the routing connections. Z-Wave will require you to heal the mesh, it doesn’t do it automagically in the background like Zigbee does.

You should heal your Z-Wave network every time you add a device. When you first add a device to the Z-Wave nework, only the device it initially connects to will know it exists and be able to route messages to the new device. Healing the network makes all the devices in your mesh learn about all the other devices - until they learn about the other devices, you will end up with some wonky message routing paths.

TL;DR - Add powered devices to your mesh first. Add new devices to your mesh where you’re actually going to use them. If you’re using Z-Wave, you should periodically heal your Z-Wave mesh so it can re-calculate optimum routing. Heal the Z-Wave mesh even if you haven’t added, moved or removed any devices - sometimes even moving furniture around can affect the signal between devices, so give it a chance to recalculate optimum routing.

Edit: Added instructions for finding zigbee channel on zigbee2mqtt, included optimal wifi-zigbee channel combinations.