Re-configuring My Messy Zigbee Network, Alexa, Matter, Hue and Tradfri Lamps

This is not so much a project, as the culmination of a long process of improving, debugging and rationalising my Zigbee network. I struggled to find anyone else with exactly the same problem I was having, but received some excellent help from the community (notably @HomeIsWhereTheSmartIs@toot.wales on mastodon) and wanted to share and give something back.

Anyways...

I've had Phillips Hue lights for a long time, since before my first experiments with Home Assistant, controlled primarily by voice via Amazon Echo devices in each room of the house. I started mixing these with the cheaper Ikea Tradfri bulbs when they became available, and they worked well.

I started using Home Assistant, more for tinkering than serious home automation, and part of this was installing a USB SkyConnect zigbee adapter and a load of Aqara/Lumi temperature and humidity sensors around the house. The Lumi devices worked reasonably well, but sometimes needed to be reconnected, as they are battery powered and only had the one central SkyConnect adapter to connect to. I eventually added a Sonoff smart switch just to act as a repeater/router, and this improved connectivity of the Lumi devices.

I added the Hue integration to Home Assistant and it could control them well for automations alongside our primary means, Alexa voice commands.

Then, last year, I had to replace some failing Tradri lamps and found that the newer versions did not play nicely with the Hue Hub. They would pair and operate initially, but become unresponsive after about 12hrs. A power cycle would bring them back to life, but this was unworkable long term. The solution was to buy a second-hand Tradfri hub and move the Ikea lamps to it. Alexa worked well with the Hue and Tradfri skills added, and I could issue lights on/off commands for a room and the Hue and Tradri lamps would comply within a few seconds.

We now had three zigbee networks in the house, though, and things started to get flaky.

I knew the obvious answer would be to move everything to Home Assistant's Zigbee network and get rid of the Tradfri and Hue hubs, but that would mean losing the Alexa voice control, which is a Must Have in my household. I was aware of the nascent Home Assistant voice control, but didn't consider it mature enough, and didn't want to replace all my Echo devices. So I put up with a system that was "good enough".

Then a few weeks ago (early May, 2026) we started having some weird problems with the Tradfri lights and Alexa. Commands issued to the lights via Home Assistant and the Tradfri integration were instant, as were command issued from the "Ikea Smart Home 1" app on my iPhone, but commands issued via Alexa to a subset of lamps (always the same ones) in the house had a significant delay, between 30s and 2-3 minutes. My son discovered a work around, to issue the voice commands three times in a row, and this worked reliably, but was a pita.

I used tcpdump on my router, and wireshark on my laptop, to examine the internet traffic when controlling these lamps and saw traffic to and from the same AWS host when controlling the Tradfri lamps, regardless of what mechanism was used (Ikea smartphone app, Alexa, or Home Assistant integration). I'd see the command go out to the cloud from the commanding device, followed by a command coming back in from the cloud to the Tradfri hub. This happened very quickly for all methods, but the commands issued via Alexa took much longer for the Tradfri hub to relay to the lamps for some reason.

Seeking advice on social media, I was asked the obvious "why don't you just move everything to the HA zigbee network", and I explained that Alexa voice control was a Must Have and that, as far as I knew, the only way to retain this was with an Amazon developer account, and to create a custom skill that would talk to my HA instance, although this would involve prefixing each command with "Alexa, ask Home Assistant to..." and, as I understood it, would also lose all the room-based context regards lights, heating control, etc.

Then @HomeIsWhereTheSmartIs@toot.wales came to the rescue, suggesting that I look into the Home Assistant Matter Hub (referred to as HAMH from now on) software, as this would enable me to expose any of my HA devices to Alexa, and still be able to put them "in" rooms. My HA instance at the time was in a docker container, and I couldn't get the HAMH container to talk to HA. So I finally got around to migrating to a HAOS VM instead so I could just install the App, and that went relatively smoothly (after a bit of messing around with SSL certs). With it all finally working I set up a Matter hub, added a door sensor to it, and it worked perfectly!

HomeIsWhereTheSmartIs's advice was to set up a separate Matter hub for each room in the house. This makes managing the exposed devices and their include/exclude filters much easier. When configuring additional hubs they were assigned incrementing TCP/UDP ports from 5540 upwards. The HAMH software warned me that Alexa could only connect to Matter hubs running on 5540, but this didn't seem to be the case and I now have nine Matter hubs connected to my Alexa service.

Now came the job of moving the lamps from their old radios to the HA Zigbee network. The Hue lamps are great, as soon as you remove them from the Hue app they automatically go into pairing mode and you can scan for and add them to HA. The Tradfri lamps, unfortunately, need to be reset with power off/on x6 procedure.

To avoid being left with many duplicate entries for your lights I would recommend the following procedure, or a version that fits your home layout:

  • remove the relevant integration(s) in Home Assistant (Hue and Tradfri for me)
  • then, room by room:
  • remove the lamps from Alexa
  • remove the lamps from the manufacturer system/hub (Hue or Tradfri, resetting the lamps as necessary)
  • add the lamps to the Home Assistant zigbee network
  • add the lamps to the room's Matter hub
  • add the Matter hub to Alexa and assign the lamps to the correct room

Once all your lamps are on the HA zigbee network, in a Matter hub, and added to Alexa, you can turn off and disconnect your old Hue and/or Tradfri hub, freeing up that precious 2.4GHz radio space!

On the evening that I'd moved everything over to HA I found that there was sometimes a little delay in commands being issued to the lamps, and a couple of times Alexa told me that the hub the lamps were connected to wasn't responding. Looking at the Zigbee network visualisation map in HA almost all the lamps were connected to the HA Zigbee adapter, though. By the following morning all devices (except the Lumi devices, which is apparently a known issue) had reconfigured and set up a proper mesh, with many redundant connections and pathways, and the system has been 100% reliable since.

Yep, it's an issue with the older zigbee 1.2 Aqara devices. Assuming you're not cutting power to any of your bulbs, you can remove each Aqara sensor & re-pair it via the closest bulb in the room.

I'm doing the same thing with both the older flood sensor as well as the door sensor. Both paired solidly via a Tuya valve closer in ZHA & a Lidl (Tuya) bulb in Z2M respectively.

You should be able to do the same with the Hue bulbs. Not 100% sure if pairing via the IKEA bulbs will be stable for you, though. I seem to recall some of their devices don't really play well with Aqara, but I could be wrong.

Thanks, I’ll have a go at re-pairing the Aqara devices and see how well they work with the Tradfri lamps. Good to know they may be unstable, though :+1:

FWIW, HA Devs have a tutorial on creating a custom Alexa skill. This skill works just like having the Nabu skill with subscription and doesn't require a vocal preface of "Alexa, ask Home Assistant...", meaning, all you have to say is "Alexa, turn on the hallway light" (eg).

I built this skill for myself a few years ago. Still runs like a champ. It's not for the feint of heart as it requires quite a few steps to setup. The HA Matter Hub App is the easier go-to nowadays for Alexa compatibility. Nonetheless, the custom skill exists and is there for people if they want it.

In other news, now that you have your zigbee network centralized using HA, you may want to investigate and research how to optimize the network for better connectivity. For example, zigbee, though it's own protocol, is still a radio wave that uses the 2.4G bandwidth. Zigbee channel 11 interferes with Wi-Fi channel 1. Make sure your zigbee radio is using a channel that is away from your Wi-Fi channel. If you have your Wi-Fi channel set to auto, STOP THAT IMMEDIETELY, lol. Set it to use a specific channel.

Ah, would that I had such control :grinning_face:

Another element in my 2.4GHz woes that I neglected to mention is my TPlink Deco mesh WiFi. It performs flawlessly, but uses 2.4GHz as its backhaul between APs, and I can’t set the channels it uses.

On my to-do list is running cables around the house to provide a wired backhaul for the APs, and PoE. That’s a big job to do properly, though, so not one that’s going to get done quickly.

Search around these forums for that phrase. I swear that a huge chunk of zigbee (& other) issues end up being caused by Deco's locked down inability to control your own network.

I'm not telling you not to do that since additional ethernet is always a good idea for future proofing. But if you're going to go through the hassle, you should consider replacing your APs with something less locked down.

@WiteWulf you may not even need to buy new hardware for this. Check out OpenWRT, you might be able to flash that onto your TP-link devices (check the list here, not all Deco versions are supported: OpenWrt Table of Hardware)

+1 for OpenWRT. It's what I use and it's a game changer.

Thanks for the feedback and tips, folks.

As a little more background (and to go off on a tangent, sorry): I'm a network engineer by trade (although have moved more into datacentre management these days, which is just Home Assistant on a much bigger scale, tbh :grinning_face:).

I've been running OpenWrt on my router/firewall for 20 years or so (currently old WRT32X, but originally on an actual WRT54GL) but am not currently a fan of it's wireless capabilities, particularly when it comes to mesh, beam forming and fast transition. The Deco kit works very well for me (it actually runs a re-skinned OpenWrt as most consumer hardware does), and is one of the few off-the-shelf mesh products that allow you to disable the firewall/router aspect of the system and use them purely as APs. Every other commercial product I've seen disables the mesh if you run them in AP mode. As I wanted to retain the power and flexibility of OpenWrt on my router, not double-NAT, and have a stable mesh Deco was a clear winner. The TPLink Deco integration for Home Assistant is also extremely useful for inferring presence in our house from individuals' smartphones connecting and disconnecting from the wireless network. That said, it's interesting to know that it's been implicated in so many problems on these forums, and I'll certainly bear it in mind.

While it would be /nice/ to have more control over the channels used, I also appreciate that in a complex radio environment like mine it's better to allow the wireless network controller to take control of spectrum usage and signal strength. I've got a load of Cisco 9120 wireless APs (which I get a lot more control over) that I'm going to upgrade my network with at some point, and I'll be letting that do the same, changing the channel my Zigbee runs on around the wireless network.

Understandable, and tbh. Until you have control over your wifi channels. Zigbee optimization in the environment will be an exercise in perpetual frustration.

If that were my set up I'd push the AP deployment up above everything else and dump the Deco. Beam forming and such is great but if it whallops your Zigbee net in the process its not fit for the deployment. :wink: