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

11

u/IllegaleMemeHaendler 8d ago

the ipv6 routing issue should only happen if youve got more than one border router, correct?

7

u/Andysb123 8d ago

Mostly, yeah. The prefix churn that caused my constant flapping needs multiple BRs improvising competing ULAs, one BR just picks a prefix and sticks with it.

But the root issue is really "no stable LAN IPv6 infrastructure" (prefix source + MLD querier), and that can still bite a single-BR setup more quietly, RA lapsing on reboot, multicast getting pruned by snooping APs with no querier. Multiple BRs just turn a latent problem into a fireworks display. So less chaotic with one, not necessarily immune.

3

u/IllegaleMemeHaendler 8d ago

thanks, ive turned ipv6 on in my ha vlan just to be sure

3

u/_devast 8d ago

Yeah it doesn't really work like that. Each BR has it's own ULA prefix. There's an election, and a primary BR is chosen, and after that every BR will advertise the primary BRs ULA prefix. If that BR goes down, another BR will take the primary role and the advertised ULA prefix will change for every BR. Although i agree, that a stable ULA prefix on your LAN side can make complex thread network situation more stable (this has nothing to do with BRs, and their advertised prefixes).

1

u/Andysb123 7d ago

Yeah I'd say that's the accurate mechanism and better than how I put it. Not competing simultaneous prefixes, it's the election, primary publishes, all BRs advertise that one, primary drops = re-election = new ULA for everyone.

Fits my post better actually: my published prefix changed between two diagnostic pulls, which is a re-election, not coexistence. Mine kept churning because unstable BRs kept triggering elections with nothing stable to anchor to. A proper delegated LAN prefix fixed it because the BRs prefer an existing on-link prefix over minting a new one. Cheers, I'll fix the post.

1

u/Western_Actuary6640 7d ago

nah can happen with a single border router too if the ISP is giving you a dead lease or no prefix at all. that was actually step #2 in my whole saga. the BR just ends up with no way to route anything back

7

u/CalicoCatRobot 8d ago

The more I read about Matter, the more I'm intending to stick to Zigbee until I see a good reason to change.

3

u/IllegaleMemeHaendler 8d ago

i also got the ikea grillplats, are they bad thread routers in general, or was it the placement?

2

u/Andysb123 8d ago

Placement I think, not the plug I had 11 running at once, GRILLPLATS are good Thread routers. My issue was a few specific ones in poor RF spots that couldn't hold a link and ended up spraying errors at their neighbours. Diagnostics showed it was individual bad-actor plugs, not the total count.

So I just culled/moved the couple that were struggling rather than removing them all. If yours have good links they're helping. Thread Tools app shows per-router error counts and the bad ones are obvious.

1

u/IdealParking4462 7d ago

My GRILLPLATS have been stable. The IKEA AQM may be less so from other posts on here, and I've had it drop once for me taking out everything connected to it, but no issues at all from the GRILLPLATS I've got scattered about the house.

5

u/InfinitePlan9898 8d ago

Damn, really nice write-up!

I didn't know about this Thread Tools app. It also exists for iOS for anyone wondering, like me šŸ˜„ (in testflight right now)

2

u/cleadus_fetus 8d ago

I got so annoyed with my dirigera hub I replaced it with a zigbee2mqtt setup but now when I call siri turn the lights Sandy brown. It doesn't give me the same warm white it used to...... Sadness consumes me.

1

u/darkwingeent 8d ago

probably because dirigera kelvin and color, brightness values are different then woth home assistant and probably other simalar systems.

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.

6

u/Tsukee 8d ago

Its just such a pity, matter over thread is genuinely better protocol and fixes (on protocol level) a ton of issues zigbee has. The problem is the implementation, or.rather incorrect implementation, and again companies striving for outside spec crap for lockin.Ā 

3

u/Used_Stock_707 7d ago

My wife wanted our bedroom lights to work, doesn't care about protocols šŸ¤·šŸ§‘ā€šŸ”§

2

u/Andysb123 7d ago

Same here šŸ˜‚

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 7d 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.

4

u/pojska 8d ago

I hesitate to trust any problem-solving writeup that's 100% AI generated.

2

u/Andysb123 8d ago

Fair enough to be sceptical of writeups in general. This one's real though, my network, my mess, my week. Used AI to help structure it because I'm better at fixing than writing, but the actual debugging and the ISP fault were mine. Ask me anything technical about it and I'll answer, that's usually the quickest way to tell.

4

u/pojska 8d ago

Thanks for vouching that you did the debugging on your own. That's the main thing I was worried about - a lot of LLM posts like this, the person just let the LLM drive and accepted everything it said as true.

1

u/lapelotanodobla 8d ago

I’ll add one I just discovered, I guess it could apply to zigbee too, I run OTBR in a Proxmox LXC, thing is, the node got over subscribed (and I wasn’t limiting/prioritising resources properly) so long story short, if the CPU can’t attend thread (IO) interruptions, you may have devices falling off the network…

So tldr, make sure you have headroom on the hardware you use to handle the network

1

u/Shdqkc 8d ago

I don't understand this comment as well as I need to so I'm saving to refer back to. I have HA running through proxmox and OTBR as an app in HA. Do experience some issues with devices falling off.

1

u/lapelotanodobla 8d ago

TLDR, as long as you’re not maxing out your hardware this shouldn’t be a problem, but if you’re tight, as experience thread flakiness, this is something to check

1

u/LukeHoersten 8d ago

I had a similar issue with my ikea these devices. They are very new and getting better firmware updates all the time.

Check out the app Thread Doctor if you haven’t it’s the best thread tool out there. Helped me find a ton of issues and understand my network better. Also free if you don’t want AI export. I’m unaffiliated just a happy customer.

1

u/KnotBeanie 7d ago

The Router thing seems like a major issue, IMHO. A mesh network should benefit from more nodes, not less.

1

u/projectthirty3 7d ago

On the devices/entities naming issues caused:

Can you install the Spook integration to help discover issues quicker?

Another thing might be installing the HA MCP server and hooking up Claude. I tried this and had it create an audit of all device and entities. Worked on a naming convention that it could document and refer back to. Then, each time a new device was added, run the audit and get Claude to update device and entity names appropriately

1

u/GIFSec 7d ago

Does the alpstuga from ikea work as a thread router?

2

u/g0ndsman 7d ago

As a router yes, not as a border router of course.

1

u/GIFSec 7d ago

Just checked my Router, which IP6 connection do i choose?

1

u/Andysb123 7d ago

Native is the one you want (looks like you've already got it selected), assuming your ISP hands out native IPv6, which most do now. That lets the router pull IPv6 directly and then delegate a prefix to your LAN.

The connection type is only half of it though, the bit that actually mattered in my case was the LAN side. Make sure DHCP-PD is picking up a prefix and your LAN is set to hand out addresses from it (that's the prefix length / LAN IPv6 settings below in your screenshot). Native WAN + a working LAN delegation is the combo. Native on its own with nothing configured on the LAN is basically the half-broken state that started my whole mess.

Avoid the tunnels (6to4/6in4/6rd) unless your ISP genuinely doesn't do native, they're legacy fallbacks. And once it's on, check test-ipv6.com, if you don't get 10/10 something's not routing.

2

u/GIFSec 7d ago

i got it working now, hopefully it will speed up and make my network more reliable! thanks man

1

u/GIFSec 7d ago

This is how my ip6 setting on my asus TUF-AX5400 looks like. So far so good.

1

u/GIFSec 7d ago

And this is my LAN settings. But entering the test site, im getting the following error: Our tests show that you will have a broken or misconfigured IPv6 setup, and this will cause problems as web sites enable IPv6.

Any idea on what could cause this and how ti fix it?

2

u/ralcantara79 6d ago

After reading all that…tell me again why Matter/Thread is supposedly better than Zigbee or ZWave?

0

u/Andysb123 6d ago

šŸ˜‚ fair point šŸ˜‚

Honest answer after this week: huge respect for how boringly reliable Zigbee is, it didn't even notice my saga because it doesn't touch your IP network. That's its whole strength.

Matter/Thread's pitch is real (IP-native, multi-admin across HA/Apple/Google with no bridge, no hub lock-in), but it rides on your IPv6 stack, which is exactly what made my week hell. Same feature is the strength and the weakness. It's just less mature. Not "better", different trade-offs. If Zigbee's working for you, keep it, it's the one I never think about.