If you’re already using a Smart Gateways device—whether it’s a water meter gateway, gas meter gateway, smart electricity meter, Kamst-IR Gateway, or Warmtelink—you might eventually want to monitor a second utility connection in Home Assistant. Maybe you’re managing a second home, a rental unit, or simply expanding your smart metering setup. In this guide, we’ll walk you through how to add a second gateway of the same type via MQTT in Home Assistant, ensuring seamless integration without conflicts or duplicated data.

Use MQTT prefixes to add multiple gateways of the same type

All Smart Gateways devices—whether it’s for water, gas, electricity, or heat—can be connected to Home Assistant via MQTT, allowing seamless integration of real-time utility data into your smart home dashboard. MQTT (Message Queuing Telemetry Transport) is a lightweight, efficient protocol ideal for sending small data packets between devices and your automation system. To support multiple gateways of the same type, MQTT allows the use of topic prefixes. These prefixes act as unique identifiers, helping Home Assistant distinguish between different devices. It’s essential to install your first gateway without any prefix, as the default installation guides and MQTT configuration are based on this setup. Once the first gateway is running, you can add additional gateways by assigning each one a unique prefix, ensuring all data remains separate and well-organized.

Requirements for Smart Gateways in Home Assistant

Before adding a second Smart Gateways device, make sure your first gateway is already working correctly with Home Assistant and the appropriate dashboard. It’s crucial that the first gateway is installed without a prefix, as the dashboards rely on this default MQTT topic structure. If you use a prefix for the first device, the dashboards will not function properly.

Refer to the following guides to set up your first gateway:

Once your first gateway is running smoothly, you can proceed with adding a second device using an MQTT prefix.

Using Prefixes for Additional Gateways

When adding a second or additional Smart Gateways device of the same type to Home Assistant, you must configure a unique MQTT prefix for each new gateway. This prefix ensures that each device publishes its data to a separate topic, allowing Home Assistant to distinguish between them and avoid conflicts.

The prefix should be a single word (no spaces or special characters) and no longer than 10 characters. A common and clear format is something like meter01, meter02, meter03, etc. This naming convention keeps your setup organized and scalable. Be consistent and choose prefixes that are easy to identify,

Verify the Setup with MQTT Explorer

After setting a prefix and saving the configuration on your second gateway, make sure everything is working by verifying the MQTT topics. You can do this easily using MQTT Explorer, a free desktop tool that provides a visual overview of your MQTT broker.

  1. Open MQTT Explorer and connect it to the same MQTT broker used by your Home Assistant setup.
  2. In the topic tree, look for your defined prefix (e.g., meter01). You should see a new branch under that name, containing subtopics wit the readings of the gateway.
  3. If the prefix appears and data is updating, your second gateway is successfully connected and publishing to the correct MQTT topics.

If you don’t see the prefix, double-check the gateway’s MQTT settings and ensure it’s connected to the broker.

Duplicating and Adapting the Configuration File

To integrate the second gateway into Home Assistant, you can simply copy the existing configuration file from the packages directory and rename it using your chosen prefix. For example, if you’re adding a second water meter gateway with the prefix meter01, rename the file from:

smartgateways_watermeter.yaml to smartgateways_watermeter_meter01.yaml

After renaming, open the new file and adjust only the sensors you need. For the water meter, you typically only need the total reading that can be added to the Energy Dashboard. Here’s how the MQTT sensor changes:

Original sensor:

mqtt:
  sensor:
    - name: "connectix_watermeter_totaal"
      unique_id: watermeter_smart_gateways_current_value
      state_topic: "watermeter/reading/current_value"
      unit_of_measurement: "L"
      icon: mdi:water
      force_update: true
      state_class: total_increasing
      device_class: water

Updated sensor for second gateway (prefix meter01):

### SmartGateways.nl Watermeter 01 Gateway - MQTT Connection
mqtt:
  sensor:
    - name: "connectix_watermeter_totaal_meter01"
      unique_id: watermeter_smart_gateways_current_value_meter01
      state_topic: "meter01/watermeter/reading/current_value"
      unit_of_measurement: "L"
      icon: mdi:water
      force_update: true
      state_class: total_increasing
      device_class: water

Save the file and restart Home Assistant. After the restart, the new sensor will be available and can be added to your Energy Dashboard or used in automations and statistics.

Adding the New Gateway with Prefix to Home Assistant

To display the data from your new Smart Gateways device in the Energy Dashboard of Home Assistant, you’ll need to manually add the newly created sensor:

  1. In Home Assistant, go to Settings → Dashboards → Energy.
  2. Scroll down to the section for water, gas, or electricity, depending on your gateway type.
  3. In the relevant section, click the dropdown menu and select the new sensor that includes your prefix—for example:
    sensor.connectix_watermeter_totaal_01
  4. Save the changes.

Home Assistant will now include the readings from your second gateway (with prefix meter01) in the Energy Dashboard, updating alongside your primary sensor for full insight into your utility usage.

Note: After adding the new sensor to the Energy Dashboard, it may take up to an hour before the measurements start appearing. The Energy Dashboard processes data on an hourly basis, so some delay is normal. Please check back after some time to see if the sensor is showing current values correctly.

FAQ: Adding Multiple Smart Gateways Devices to Home Assistant via MQTT

Q1: Can I add multiple Smart Gateways devices of the same type to Home Assistant?
Yes, you can add multiple gateways of the same type by using MQTT topic prefixes to distinguish each device.

Q2: Why should the first gateway be installed without a prefix?
The first gateway must be installed without a prefix because the official dashboards and configuration files are based on the default MQTT topic structure without prefixes. Using a prefix for the first device may cause dashboards not to work properly.

Q3: How long can it take before new sensor data appears in the Energy Dashboard?
It can take up to an hour for the Energy Dashboard to show data from a newly added sensor because it processes data on an hourly basis.

Q4: What are the rules for MQTT prefixes?
MQTT prefixes should be a single word without spaces or special characters and no longer than 10 characters. Examples include meter01, meter02, or house2.

Q5: How do I verify that the second gateway is publishing data correctly?
You can verify MQTT messages using tools like MQTT Explorer. After connecting to your MQTT broker, look for the prefix you assigned (e.g., meter01) to confirm the gateway is publishing data under that topic.

Q6: Can I reuse the existing YAML config files for the second gateway?
Yes, you can copy the existing configuration file from the packages directory, rename it with your prefix (e.g., smartgateways_watermeter_meter01.yaml), and adjust the sensor topics to include the prefix.

Q7: How do I add the new sensor to the Home Assistant Energy Dashboard?
Go to Settings → Dashboards → Energy in Home Assistant, then select the new sensor with the prefix (e.g., sensor.connectix_watermeter_totaal_01) from the dropdown menu under the relevant utility section.

Q8: What if I use a prefix for the first gateway by mistake?
If you configure the first gateway with a prefix, the dashboards may not work correctly. It’s recommended to reset and reinstall the first gateway without a prefix to ensure compatibility.

Q9: Does the included Smart Gateways Energy Dashboard support multiple gateways with prefixes?
The included Smart Gateways Energy Dashboard is officially supported only for the first gateway installed without a prefix. Creating individual dashboards for additional gateways of the same type using prefixes is outside the scope of official support. However, you are welcome to create your own custom dashboards for additional gateways if you wish—just keep in mind this is at your own risk and may require some advanced configuration. We’re happy to help with general guidance but cannot guarantee support for custom setups.

Conclusion

Adding multiple Smart Gateways devices of the same type to Home Assistant via MQTT is straightforward when using unique topic prefixes for each additional gateway. Always install the first gateway without a prefix to ensure full compatibility with the official Smart Gateways dashboards and Home Assistant integrations. By carefully duplicating and adjusting your configuration files, and verifying MQTT topics with tools like MQTT Explorer, you can successfully monitor multiple water, gas, electricity, or heat meters within a single Home Assistant setup. Remember to add new sensors to the Energy Dashboard to track your usage over time, keeping in mind it may take up to an hour for data to appear. While the official Smart Gateways Energy Dashboard supports only the first gateway, you can create custom dashboards for additional devices at your own discretion. Following these best practices will help you build a scalable and reliable smart metering system that meets your home automation needs.

Track Water consumption in Home Assistant with the Watermeter Gateway

The Water Meter Gateway from Smart Gateways upgrades your traditional water meter into a smart device, offering real-time data on your water usage. You’ll be able to monitor your water consumption during various activities like showers, baths, handwashing, or garden irrigation via an intuitive dashboard. This clear overview helps you track usage and spot areas where you might reduce costs.

Installation is straightforward, and the gateway is designed to work with most analog water meters, including those from brands such as Itron, Actaris, Elster, and Honeywell. It integrates seamlessly with popular home automation platforms like Home Assistant, Domoticz, and Homey. For additional functionality, you can leverage open standards such as REST-API and MQTT for secure data transfer.

If you prefer not to use home automation software, you can opt for the Online Energy Dashboard subscription. With the provided installation guide, you can set up the gateway on your own. The sensor has an extendable range of up to 15 meters and is compatible with both version A and B water meters, depending on your model.

For more details, click here .

Monitor energy consumption with Home Assistant by connecting your Smart Meter with P1 port

In this guide, I’ll explain how you can connect your smart meter with Home Assistant. Home Assistant offers several options for adding a smart meter and monitoring energy consumption in real-time and by hour, day, week, month, and year. Recently, Home Assistant introduced the Energy Dashboard, which displays the energy consumption of the Smart Meter, Gas consumption, and water consumption in beautiful overviews. The beauty of smart meters in the Netherlands and Belgium is that they also provide gas consumption data. So, you can immediately display both gas and electricity consumption in Home Assistant using a single smart reader or P1 meter.

P1 Meter DSMR Smart Meter

Leave a Reply

Your email address will not be published. Required fields are marked *