I’ve been using Zigbee for a couple of years now in two different houses that I have rented.
For the most part I’ve never had any reliability or performance issues, until recently.
As I got up to around 60 different zigbee devices connected to my network… because
I’m a nerd and it’s fun to play with new sensors and lights when they come available…
things started to get flaky.
Lights would no longer turn on instantly when my PIR sensors detected motion.
I’d ask Google to turn off the lights in a room, and all but one of them would turn
off.
It really started to get annoying and I began researching what I could do to make this setup
more reliable.
After a few months of testing different things I can now share with you the three main improvements
I made to create a truly rock solid Zigbee network.
I personally use Zigbee with Home Assistant and the Zigbee2MQTT integration.
But these steps that I’m going to share will improve any Zigbee network with any integration.
The first thing I did to improve performance and reliability was upgrade my Zigbee USB
dongle.
When I first started out with Zigbee I bought my USB dongle on Amazon, and it was based
on the Texas Instruments CC2531 chipset.
It worked perfectly well out of the box in my small apartment and was compatible with
Zigbee2MQTT, my 5 or so smart lights and three temperature sensors.
When I moved to a slightly bigger house, it had a few issues with range and some of my
sensors that were far away stopped reporting information and wouldn’t work properly.
I fixed this by adding a few smart light bulbs into my network which acted as routers, but
I’ll touch a bit more on that later.
As my Zigbee network grew, I found that my USB coordinator would stop responding at all
every couple of weeks, and you’d have to stop Zigbee2MQTT, pull out the dongle, plug
it back in and restart it before it would start working again.
I also noticed that it became harder to pair new devices, as they just wouldn’t get detected.
I embarrassingly learned that the CC2531 chipset that my USB dongle was based on was an older
model, and that most people now recommend you use a newer version instead which supports
larger Zigbee networks and has better support from the community.
The recommended models now use the newer CC2652 chipset and there are a lot of different Zigbee
USB sticks on the market that use this hardware.
I’ve had great results with Slaesh’s stick, as well as this Sonoff Zigbee 3.0 USB Dongle
Plus.
For full disclosure, Sonoff offered to send me this USB stick for free to test as they’d
seen my previous Zigbee videos.
I agreed to this as I use a lot of Sonoff devices in my network and they tend to be
pretty reliable, even if they often feel cheaply made.
They are incredible value for money though - this USB stick is only $10.99, is based
on the new chipset and supports Zigbee 3.0 devices.
I’ve been using it for a couple of weeks now and have been really happy with it.
It performs better than my existing CC2531 stick, which actually cost me more than the
Sonoff is currently selling for.
The Sonoff looks just like any other Zigbee USB dongle, and comes with the coordinator
firmware pre-installed on it so it should work perfectly out of the box.
In the box you get the USB stick itself, and an external antenna.
It’s quite large in size compared to my other Zigbee Coordinators, but that shouldn’t
really matter as you should always connect your Zigbee stick to your Home Assistant device
using a USB extension cable.
This is another tip to improve your Zigbee reliability and performance.
A Zigbee USB stick is essentially a radio transmitter and receiver, which is susceptible
to radio interference.
If you connect your stick directly into the USB port of the device running Home Assistant,
like this raspberry pi, there could be interference from the onboard Wifi or Bluetooth chips.
Even though this Sonoff coordinator comes with an aluminium housing to reduce signal
interference, I still think it’s best to use a 1 or 2m USB cable to separate the device
away from anything that could cause this kind of radio interference, like a Wireless Access
Point or Bluetooth keyboard.
The Sonoff Zigbee 3.0 USB Dongle Plus is compatible with both ZHA and Zigbee2MQTT.
If you’re setting up a new Zigbee network from scratch you can just follow the guides
available online and the instructions are the same regardless of which model you use.
I’ve put a link in the description below to a video I did on how to set up Zigbee with
Home Assistant using ZHA.
If you’re replacing your old USB coordinator with a more powerful one on an existing Zigbee
network it gets a little more complicated.
You’ll need to either re-create your Zigbee network from scratch, which can be really
painful, or you can migrate your devices from one USB stick to another.
There’s a guy called Lewis, who has a great YouTube channel called Everything Smart Home,
and he made an excellent video that shows you how to migrate from one Zigbee USB stick
to another without having to re-pair your lights and sensors.
I personally decided to use this opportunity to make some extra improvements to my Zigbee
network, which required re-pairing all my devices, so I didn’t bother migrating anything.
But if you’re looking to just replace your old USB Zigbee Coordinator with the Sonoff
or any other more powerful dongle, then I suggest you check out Lewis’s video, which
I’ve linked in the description below.
It will save you a lot of time!
For some people, replacing the USB coordinator will be enough to make their network more
stable.
But if you’re like me you probably didn’t really plan your Zigbee network in any great
detail, and just started pairing devices willy nilly as you bought them, moved them around
your house and didn’t factor in anything like Router Placement or 2.4Ghz Wifi Interference.
Since I’d already mentally prepared myself about having to re-pair 60 Zigbee devices
and fix all my automations I thought I’d make all the improvements that I researched
in one hit over a weekend.
The second improvement I made was to ensure that my Wifi network was on a different set
of channels to my Zigbee network to prevent radio interference.
Zigbee and some Wifi networks both work on the same set of radio frequencies, which is
the 2.4 Ghz range.
This radio frequency is then broken up into separate channels, much like how radio stations
and TV channels used to work.
If you have a lot of Wifi devices, and Zigbee devices all near each other, and they are
set up to use overlapping radio channels, then there is a chance that they may fight
for airtime and signals could get lost or delayed.
It’s a lot like trying to communicate with someone in a crowded room where everyone is
talking at once.
To prevent this you can set your Wifi network up to use one set of channels, and your Zigbee
network up to use a different channel that is not overlapping the same frequency.
Changing your Zigbee channel usually requires you to re-pair your devices.
I figured I may as well do this as I had planned to re-pair them anyway.
I’ve linked to this website in the description below which shows you which Zigbee channels
overlap with which 2.4 Ghz WiFi channels, and provides a bit more information about
how this all works.
I decided to set up my Zigbee network on Channel 11, which is the lowest number channel.
You can set this in both ZHA or Zigbee2MQTT, but do be aware that you will probably have
to re-pair your devices if you do this.
I then went to my Wifi settings and excluded the overlapping channels to make sure that
my Wireless devices used the higher channels, and hopefully didn’t clash with each other.
Also be aware that if you live in a city or crowded apartment building that your neighbours
wifi may also interfere with both your WiFi and Zigbee networks.
There are many Wifi Analyser type apps you can get on your smart phone that check all
the wireless networks in your area and tell you which channels are the most popular and
which ones might be less crowded.
If you have a different 2.4 Ghz and 5 Ghz Wifi network in your home, then I suggest
you connect as many devices with the 5 Ghz network as you can.
Most new devices support 5 Ghz, and not only is it faster, but it also doesn’t interfere
with the Zigbee network.
Sadly older or cheaper Wifi devices, like most WiFi Home Automation equipment doesn’t
yet support 5 Ghz.
The third improvement I made to improve my Zigbee network reliability and performance
is to create a solid mesh network.
If you’re not aware, permanently hard wired Zigbee devices, such as light bulbs and smart
switches have the ability to act as Zigbee Routers, which can pass Zigbee signals through
them.
This means that you can pair a battery powered sensor near a Zigbee lightbulb, and the light
bulb can pass that signal onwards to your USB coordinator.
It could also pass it to another router, which means you can extend your network well beyond
the distance limitations of your USB coordinator if you have a big house or thick walls.
Routers also allow you to add more devices to your network than your coordinator supports
by default, because each device is talking to a router rather than the main coordinator.
I explain this in a bit more detail in my What Is Zigbee video, which I’ve linked
in the description below.
I wanted to make sure that my routers were correctly placed and paired so that my Zigbee
mesh network is as robust as possible.
This required a bit of pre-planning about where I would place my smart light bulbs and
battery powered sensors.
I also had to make sure that I paired them in the right order to build out this network
properly.
Here’s the theory.
A Zigbee USB coordinator, like the Sonoff, can support about 20 devices talking to it
directly.
Once it hits that limit, the only way that you can pair more devices is if one of the
existing ones can act as a router.
Radio signals generally emit outwards in a sphere…
I know, I know, it depends on the antenna and the gain and all that, but for the purposes
of this explanation it’s good enough… you’ll get better results if you place your
Home Assistant server with your USB coordinator attached somewhere in the middle of your house.
If you put it in the basement, it will probably not reach to the top floor unless you have
routers in between.
It will still work, but if you can put it in the middle somewhere it will probably work
better.
I then started pairing my hard wired devices, that would act as routers, first starting
from close to my coordinator and then slowly moving outwards.
This way the routers closest to the Coordinator would pair with the coordinator itself until
all 20 slots were taken up.
Then the routers that are further away from the coordinator can pair with the other routers
and build up the mesh network.
Once I had all my routers paired, I moved on to the battery powered devices like my
temperature and motion sensors.
When I paired these devices the first time, I used to do it near the coordinator in my
office and then move them to their final resting place.
This turned out to be a stupid idea because they would pair with the router or coordinator
in my office, and then I would move them out to the kitchen or wherever and they’d lose
connection.
I now re-paired the devices in situ, where I planned to use them, so they would immediately
connect to the closest router.
This whole process was a massive pain in the arse and took me several hours over the course
of a weekend.
But it really has made a big improvement to the performance and stability of my network.
I no longer hear my partner yelling at me from across the house because the “magic
lights didn’t turn on”.
Re-pairing all my devices actually gave me one other benefit as well - and that was the
opportunity to re-name them all using a sensible naming convention and add them all to area’s
in Home Assistant.
I used to make up names for my sensors and smart devices on the spot without any sort
of plan or system.
After two years of this it ended up looking like a dogs breakfast and I couldn’t remember
where “coloured bulb 2” was.
Do you use a naming convention with your Home Assistant devices or entities?
I’d love to hear about them in the comments as I plan on making an entire video dedicated
to this topic in future.
It would be great to incorporate all your ideas into this video, and get perspectives
other than just Pedram’s…
Hi Pedram.
The downside to renaming all your devices is that you have to fix any automations and
scripts that rely on these.
You’ll also need to recreate any Home Assistant groups that contain these entities.
I just did these slowly over time when I noticed that a particular automation had stopped working.
For me the benefits have outweighed the effort and I’m really happy with the results.
If you thought this video was useful, then please give it a thumbs up to let me know.
If you’re looking to get Zigbee working on Home Assistant with the Sonoff or another
USB dongle, then check out this video here.
If you want to know my opinions about whether ZHA is better than Zigbee2MQTT, then check
out this video here.
I regularly release videos about Zigbee, Home Assistant and Home Automations in general,
so if that’s your jam then click the subscribe button and together we’ll make your home
smarter.