**************************** 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. Or you have a hybrid Nefit Enviline heat pump and a Nefit boiler. Those EMS systems are independent and cannot be coupled. In these 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 :ref:`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 name. Then set it up to connect to your home network as described in :ref:`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 base name (and client id) to a unique name for each Gateway. 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-> Base' and change the base. Next change the entity ID format to 'Multiple instances, short name' .. image:: ../images/firmware/multiple-instances.png :width: 300 :alt: setting for multiple instances Keep in mind the MQTT Discovery will now change all the entity prefixes as well. If you renamed the base ID of an already working Gateway that is coupled to Home Assistant, you need to uncheck the tick mark of 'Enable MQTT Discovery', press save. En then enable it again and press save. This action will have the Gateway clean up all messages in the MQTT broker and start new. 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 :ref:`Configuration for Home Assistant (MQTT Discovery) `. Domoticz -------- Domoticz should see the difference between both Gateways as well, but it is not throrougly tested. 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: .. list-table:: :header-rows: 1 * - 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. Also change the name of the access point of each Gateway so that they do not broadcast the same WiFi network name. Connecting multiple Gateways to a hybrid system =============================================== A hybrid system consisting of an EMS gas boiler and an EMS heat pump has two bus masters. This means that if you connect a Gateway to the boiler, you cannot see the heat pump and vice versa. If you want to monitor both the boiler and the heat pump, you need to connect a seperate Gateway to both heat sources. **This is a technical limitation of the EMS bus and this cannot be solved in software.** Bosch/Buderus has a unit the HM200 hybrid manager which does couple both systems. If you have a HM200 you only need one Gateway. In case you need two Gateways send me an email via the contact form for a discount on the second Gateway.