Zigbee2MqttAssistant icon indicating copy to clipboard operation
Zigbee2MqttAssistant copied to clipboard

how to support for multiple gateways?

Open YinHangCode opened this issue 4 years ago • 8 comments

first thank you for your project. I have multiple zigbee2mqtt gateways, and topic with "/z2m/1" and "/z2m/2". I set BaseTopic with "/z2m/#" is not work and "/z2m/1,/z2m/2" is not work too.

YinHangCode avatar Feb 23 '20 16:02 YinHangCode

It's not designed to support multiple instances of Z2M at the same time. Could be a cool feature, but currently you'll need 2 instances of Z2MA to support them.

carldebilly avatar Feb 24 '20 15:02 carldebilly

this would be an awesome feature! I have 3 raspberry Pi zero with cc2530 devices on different floors and Mosquitto broker on HA

merocle avatar Feb 27 '20 22:02 merocle

this would be an great feature and I need it too.

ZHonry avatar Mar 09 '20 07:03 ZHonry

I think the current architecture of the Z2MA code makes it difficult to implement multiple gateways and it would be a high risk/reward ratio, probably not worth it.

However, what would be less difficult is to implement a dropdown where you could select different gateways. Like, unless changes, Z2MA listens to the zigbee2mqtt topic. You can change it to something else. What if you could supply a list of zigbee2mqtt topics, like [ "zigbee2mqtt", "zigbee2mqtt2" ] The items could be presented in a list, that way you could toggle gateway by selecting a different gateway/mqtt topic.

Thoughts?

magpern avatar Mar 09 '20 08:03 magpern

I think it would not be that difficult to do... Obviously you'll need to specify many topics for Z2M...

And since it would be possible to have the same friendly name on 2 networks, a kind of network id will be required as a key for all calls. But as I said, it's doable.

It was in my plans to support that in the first design, by I decided to wait for requests before making that feature.

carldebilly avatar Mar 09 '20 13:03 carldebilly

@carldebilly Issue #132 needs to be fixed first, then this would be not that complicated. I have an idea I will try.

magpern avatar Mar 09 '20 13:03 magpern

Yep... encountered same problem with multiple networks. I live in a flat and have basement that is spearated by 2 floors. Therefore running 2 separate networks with separate topics. Count my vote for supporting multiple networks please :)

Or is it possible to run 2 instances of ha addon with different configs?

aphex008 avatar Jun 15 '20 10:06 aphex008

Hi guys! Just has searching something like this question... and finally found it :) I just want to say that I join the question/request about support for more than 1 gateway/stick. It would be great to be able to manage all gateways from one instance of z2m assistant :) Hopefully the author will have time to implement this feature. @carldebilly thanks in advance for z2ma! ;)

SAOPP avatar Aug 28 '20 18:08 SAOPP