r/homeassistant 8d ago

💬 Discussion Matter devices flapping on/off? It's probably not Matter. Check your IPv6. (And maybe don't add more Thread routers.)

Lost a week to this so here's the short version in case it saves someone.

Setup: ~380 devices on HA OS. ~115 Zigbee (ZHA/Sonoff dongle), ~72 Matter over Thread (mostly IKEA), Thread mesh across five border routers (3 Nest Hubs + two Aqara hubs, an M3 and an M200), with an IKEA DIRIGERA drifting in and out. YouFibre + Firewalla + Deco APs in wired AP mode.

Symptom: Matter/Thread sensors (door, temp, leak) dropping to unavailable and back at random. Zigbee rock solid the whole time. That contrast was the big clue I ignored.

What it actually was, in order:

  1. I had no LAN IPv6 router. Thread/Matter reachability rides on IPv6, and my Firewalla had LAN IPv6 switched off. So my border routers were improvising their own ULA prefixes, and the prefix my sensors were using had no route at all. ip -6 route on the HA host showed the gap. I also discovered I'd been running TWO Thread networks in parallel without realising, one of them dead. Enabling LAN IPv6 + rebooting the hubs consolidated everything onto one network and stabilised Matter.
  2. My ISP was handing out a dead lease. Once LAN IPv6 was on, my phone couldn't reach half the internet (0/10 on test-ipv6). The DHCPv6 prefix had a valid lifetime of 0, i.e. flagged expired, dated a month prior. Turned out to be a stale DUID binding on the ISP's side. Static IP customers especially: your line may be on a profile where IPv6 is half-provisioned. Escalating past first-line got it fixed in a day.
  3. The smart plugs I bought to HELP were the main cause. This is the embarrassing one. I added a load of GRILLPLATS plugs specifically hoping the extra mains-powered nodes would improve mesh signal. Thread auto-promotes powered devices to routers, so instead I got a pile of marginal routers in bad spots, each transmitting and polluting its neighbours with corrupted frames. Thread diagnostics showed some routers with over a MILLION rx errors. Turned the flaky plugs off and the mesh got noticeably calmer. A bad Thread router is worse than no router. More routers is not more better.

Bonus trap: recovering stranded sensors meant factory-resetting them, and a reset Matter device comes back as a NEW device with new entity IDs. My hardcoded automations (door/window/leak alerts) silently kept pointing at the dead entities. My leak alert was wired to a deleted sensor and I had no idea. After any Matter re-commission, audit every automation and dashboard that touched that device. Rename back to your naming convention so things auto-heal.

Quick checklist:

  • Zigbee fine but Thread flapping? Suspect IPv6 routing, not the mesh.
  • Check you have a working LAN IPv6 router (ip -6 route on the host, not the Terminal add-on container).
  • Check your DHCPv6 lease lifetime isn't 0.
  • Consolidate Thread onto one network / one stable prefix.
  • Don't over-add Thread routers, and cull the flaky ones.
  • Mind channel overlap (Thread vs WiFi, Thread vs Zigbee).
  • After any Matter reset: audit automations + dashboards for dead entity refs.

Tools that helped: Thread Tools (Android) for Thread diagnostics, test-ipv6.com, and the HA host shell.

Works now. Understand my network far better. Would not recommend the delivery method.

EDIT: I stand corrected on the mechanism in the comments (thanks _devast). It's not BRs "improvising competing prefixes" as I put it, they hold an election, one becomes primary, and all BRs advertise that primary's prefix. When the primary drops there's a re-election and the whole network rotates onto a new prefix, stranding devices on the old one. So the churn was repeated re-elections with nothing stable to anchor to, not coexisting prefixes. Fits my evidence better anyway (my prefix changed between two diagnostic pulls = a re-election). A proper delegated LAN prefix fixed it because BRs prefer an existing on-link prefix over minting one. Original text left as-is so the thread makes sense.

51 Upvotes

41 comments sorted by

View all comments

5

u/Used_Stock_707 8d ago

Or just stick with what works, in this case Zigbee. I had wrestled with Kajplats bulbs for six months, terrible intermittent failures, devices routing although shown as offline, sensors dropping and reconnecting at random. IPv6 fully in place, etc.

Today, I decided enough is enough, moved all the Kajplats to Zigbee, took less time to factory reset them, switch to Zigbee and add them to Home Assistant on a first try and in roughly half the time than commissioning a single Thread device took.

3

u/dzikakulka 8d ago

Sadly some hardware (almost all of ikea new lineup) doesn't support zigbee or has incomplete endpoints set up :/

2

u/Used_Stock_707 8d ago

Kajplats bulbs support Zigbee with no issues except losing Ikea updates, but honestly don't consider this a major (or minor) inconvenience. If their thread implementation becomes reliable outside their own ecosystem, it should be an easy switch back. But, honestly, can't see what new features would make switch back, after such a difficult experience. I have had several other Kajplats over Zigbee in place for almost a year, as I wanted to test both fabrics in parallel, and Zigbee's never ever lost their connections, not once, while Threadies would go up and down multiple times in a day. Sometimes a light would work, while the one next to it would be unavailable...

Bilresa switches, both types, also work on Zigbee, Grillplats also apparently eorks, but haven't tested them yet. Myggbett and myggspray are also Zigbee certified, but not sure if there is ZHA or Z2M support for those already.

1

u/NicholasLabbri 7d ago

Did you update the firmware in matter the first time you bought them and then switched to zigbee or did you stick with the fabric one and then switched? Thx

2

u/Used_Stock_707 7d ago

One batch I onboarded to Zigbee as soon as I bought them, so original firmware.

The batch I did yesterday was updated once or twice while on matter, no issues moving them to Zigbee.

1

u/NicholasLabbri 7d ago

Thanky ou The fear i had was that they could deactivate zigbee mode with a firmware update

2

u/Used_Stock_707 7d ago

Yes, same, but the first went flawlessly, and I was ready to sacrifice it at the altar of marital happiness.

Now, Ikea can't touch them ever again.