Why is Z2M so... bad

First of all, hello everyone.

Do you think Z2M is kinda low quality as a software? For example today I tried to add an another zigbee network to HA, but found out that Z2M can handle only one coordinator. Then there were suggested hacks to add an another instance with different URL and whatnot, yikes.

Now I understand the Zigbee protocol only supports one instance, but me coming from software engineering perspective, what were they thinking in the first place leaving the coordinator as some sort of singleton instance? Now they are unable to fix the issue without complete overhaul of the codebase…

Of course it’s volunteer work of obscure use-case but still, so painful.

1 Like

If you want a protocol that uses more than one coordinator try Thread.

No… Zigbee can handle only one coordinator. This is spec level. Try again.

5 Likes

Just wow!

You actually took the time to find out it is a zigbee protocol limitation and still posted as if it is a Z2M issue.

7 Likes

I can’t be sure, but I think I smell slop.

1 Like

Looks like spam to me.

Yes, that’s what I wrote, zigbee supports only one coordinator. There’s no reason why Z2M should only support one though. MQTT does not care about zigbee limitations, and so does not HA.

It’s a Z2M issue, as I explained in my post. Bear in mind Z2M addon is Zigbee in, MQTT out. There’s no reason why Z2M addon shouldn’t be able to support multiple zigbee networks / coordinators.

Do you wanna see me to hack the Z2M addon to support multiple coordinators? I will do it if we bet on it a large enough sum.

Your words. Not mine.

But, the real question is why you would want to do that? Zigbee is a mesh network that works better in a single mesh. Once you start splitting it up, you make both meshes worse.

Take your money and hire a psychiatrist to help you find out why you like to talk out both sides and also break your mesh.

1 Like

Assume the house has two floors, a basement and a garage. For each separate area, a separate coordinator network makes the most sense, (in this case 4 coordinators each agglomerated into single HA server, but currently Z2M does not support it (without hacking)).

I’m not sure why you are trying to argue against obvious facts, do you like arguing just for the sake of it?

Maybe THIS reading can help you to achive your goals? :thinking:

Nope. Makes no sense.

There will be overlap. Use extenders!

In the discussion you linked, there was one good explanation of the situation:

I don’t see a problem with running multiple RPis, each running a Z2M docker container with a Zigbee dongle connected to it, and using a different mqtt base topic & different channel, assuming they all publish to the same homeassistant integration topic. Moreover, far-away coordinators can probably reuse the same channel without disturbances.

For example:

  1. Basement coordinator: base topic z2m-basement, HA topic homeassistant, channel 20
  2. Ground coordinator: base topic z2m-ground, HA topic homeassistant, channel 11
  3. TopFloor coordinator: base topic z2m-top, HA topic homeassistant, channel 20
  4. Shed coordinator: base topic z2m-shed, HA topic homeassistant, channel 15

Since the basement and top floor are farthest away, they can reuse the same channel safely.

Yes, four RPis running Z2M each would solve the problem, however that’s quite an ugly solution since the Zigbee to MQTT translation could be done on the server side just as well, with PoE Zigbee adapters just acting as gateways for the Zigbee traffic. Which brings me back to my original point, Z2M is kinda bad…

1 Like

Imagine if we had to add RPI for each device in our home WLAN because the WLAN box cannot do IP to TCP translation for multiple clients! One RPI for my phone, one for my laptop, add one RPI for the wife’s multicooker… that would be insanity.

1 Like

I dont know what kind of premises you have in mind to achieve full Zigbee coverage.

As for me we are living in a two floors 600 sqm steel enforced concrete house. Using only one SLZB-MR2 coordinator around the center of the first floor connected to the HA server through ethernet and strategically placed routers all over the two floors gives us a stable mesh without much issues even on the roof top. Alltogether 162 Zigbee devices working here were 71 are also routers and the other 91 devices just simple end devices.

If in your case the distance is a problem consider to add “real” routers (not just some smart plugs with router capabilities). These should be good enough to cover greater distances while keeping your whole setup simple by just using one coordinator.

2 Likes

Way to give back to an open source project, it’s not like you’re obliged to contribute your free time to others floks who freely contributed their time to get you this in the first place… I mean by creating a PR when you’re seemingly perfectly capable of it.

Tamsy, don’t feed the trolls.

4 Likes

Go on, I’ll bite.

You can already do this without requiring additional Pis. Grab a few ethernet or PoE coordinators, hook them up in each floor and spin up multiple instances of Z2M.
You don’t need the url “hack” if you only need 2 networks - you can simply spin up Z2M Edge (the dev version that’s as stable & easy to set up as the main branch) and have it handle the second network. Hell, you could spin up ZHA and add a third network too.
The url “hack” is only required if you need more networks than that.

It absolutely does not make more sense.
As mentioned above, this defeats the point of having a zigbee mesh, and a decent coordinator with strategically-placed routers will easily cover multiple floors. Mine is on the first floor and easily manages to cover one floor above and one below in a brick & concrete building.

2 Likes

Yes, four RPis running Z2M each would solve the problem, however that’s quite an ugly solution since the Zigbee to MQTT translation could be done on the server side just as well, with PoE Zigbee adapters just acting as gateways for the Zigbee traffic. Which brings me back to my original point, Z2M is kinda bad…

You do know that you can just run multiple z2m containers on the same RPi, right? :man_facepalming:

Not exactly true. Multiple coordinators in Z2M will work (personally tested it), but in my opinion it’s counter intuitive to the core principles of a mesh network.

You’re catching a lot of flak from folks that are misunderstanding your point :sweat_smile:. Probably because you’re taking a jab at software that works reliably when you fit in its use case, and people (especially people in the Home Assistant community) don’t like when you take jabs at software that “works for them.” The zigbee2mqtt-windfront frontend (the new default frontend) supports part of what you’re suggesting, so it’s humorous to me that so many people are against what you’re saying. But that’s kind of what happens when people jump to conclusions instead of fully understanding someone’s point.

This is only the UI side of things, so you still have to run multiple Zigbee2MQTT instances to make it work. But zigbee2mqtt-windfront supporting this at all is a step in the right direction. Maybe at some point in the future someone can smooth that rough edge over, and convince Zigbee2MQTT to allow more than one coordinator per Zigbee2MQTT instance.

In any case, you’re apparently not the only person to think that Zigbee2MQTT could have a different UX that more clearly separates implementation from interface. Maybe you’ll feel some vindication in that.