Connecting multiple Gateways

Sometimes if you have a very large system or house you might have two or more independent EMS bus systems. So for instance one boiler in the main house and one boiler in the guest house or workshop, garage etc.

In this case if you want to read and control all independent systems you need one Gateway per independent system.

You can connect all Gateways to the same MQTT broker and the same home automation system like Home Assistant and Domoticz.

Gateway configuration

Connect each Gateway to its own system as described in Connecting the Gateway to the boiler. It might be a good idea to install the first Gateway and set it up before installing the next one as they will broadcast the same access point network. Then set it up to connect to your home network as described in Connecting the Gateway to your home network.

Each Gateway has the exact same factory default settings. To have your home automation system and the MQTT broker being able to distinguish each Gateway, you have to change the MQTT Client ID to a unique value and change the network host name to a unique value. You can choose to change the names on all of the Gateways or leave the first Gateway at default and just rename them on the other one(s).

Procedure for each Gateway:

Go to ‘MQTT-> MQTT Settings-> Client ID’ and change the Client ID. Go to ‘WiFi Connection -> WiFi Settings -> Hostname’ and change the host name (no spaces).

Reboot the Gateway.

Home automation configuration

After changing the setting in the Gateway web interface you can continue normal integration for each Gateway in your home automation system.

Home Assistant with auto discovery

For Home Assistant with the auto discovery it will find all parameters of all Gateways by itself. See Configuration for Home Assistant (MQTT Discovery).

Domoticz

For Domoticz you install the plugin just once as described in Configuration for Domoticz.

Then in Domoticz go to ‘Setup -> Hardware’ and add a hardware of the type ‘EMS bus Wi-Fi Gateway’ for each Gateway you have. For each instance of the plugin you need to change the Topic base to the host name of each Gateway. The MQTT Server address will be the same for all.

Other MQTT systems

Because all Gateways now have a unique host name, this is also a unique prefix of the MQTT topic structure. Therefore all Gateways publish to the same MQTT broker, but the topic names will be different for each.

For instance:

Gateway number

Client ID

Host name

MQTT prefix

default

ems-esp

ems-esp

ems-esp/

1

ems-esp-1

ems-esp-house

ems-esp-house/

2

ems-esp-2

ems-esp-garage

ems-esp-garage/

3

ems-esp-3

ems-esp-guesthouse

ems-esp-guesthouse/

Connecting multiple Gateways to the same EMS system

Although this should never be needed as one Gateway can see all devices on the same bus, you can connect multiple Gateways to the same bus.

The only change you need to make is to change the Bus ID in ‘Settings -> EMS Bus -> Bus ID’, so each Gateway behaves as an independent device.