Monitor Your Water Levels with Home Assistant

Keeping track of water levels in tanks, rain barrels, or ponds is essential for efficient water management. With the Distancemeter WiFi Gateway, you can easily monitor the water level at a glance. This gateway seamlessly integrates with popular home automation platforms like Home Assistant, Domoticz, Homey, and other domotica products. It comes equipped with a waterproof sensor that can be mounted at the top of a reservoir, providing accurate readings. By utilizing this gateway, you can automate the process of refilling your pond and ensure it never runs dry.


  1. Gateway and Waterproof Sensor: The Distancemeter WiFi Gateway comes with a 2-meter cable and a water-resistant sensor. It is designed to measure water levels in tanks and various other surfaces, making it versatile for different applications.
  2. Compatibility: It is compatible with popular home automation platforms such as Home Assistant, Domoticz, and Homey.
  3. Full MQTT Support: The gateway offers complete MQTT support, making it suitable for vendors who want to monitor their customers’ water usage through their own cloud services.
  4. REST API: All measurements can be accessed via a JSON web server, allowing easy integration with other applications.
  5. User-Friendly Dashboard: The gateway provides a clear and concise dashboard for Home Assistant, enabling you to view water level data and track changes over time.
  6. Automatic Firmware Updates: The gateway ensures you stay up to date with the latest features and improvements by providing automatic firmware updates through the dashboard.
  7. Wide Measurement Range: The sensor has a range of 20 to 450 cm and a resolution of 1 cm, offering accurate readings for various water level scenarios.
  8. Customizable Maximum Level: You can set the maximum level of the water based on your specific requirements using the web server interface.
  9. Sensor Offset Adjustment: The sensor offset can be modified to virtually place the sensor higher or lower to the measured surface.
  10. Energy Efficiency: The gateway has a low energy consumption of 50mA, ensuring efficient operation.
  11. Extension cables available: The cable can be extended with the optionally available extension cables.
  12. Web Server with Real-Time Water Level Display: The gateway’s internal web server displays the water level in real-time, allowing you to monitor it even without using home automation software. By entering the maximum level and any offset for the sensor, the web server calculates and displays the water level accurately.
  13. Home Assistant Integration: The Distancemeter WiFi Gateway seamlessly integrates with Home Assistant, providing a comprehensive dashboard for monitoring and automation. The dashboard displays the distance in centimeters from the water surface. By inputting the total distance from the sensor to the tank bottom, Home Assistant calculates the tank’s fill level and presents it as a percentage.
  14. Preventing Fluctuations: To ensure stable readings, the gateway measures the distance to the water surface at a rate of 10 measurements per second. Occasionally, slight variations may occur due to external factors. To mitigate these fluctuations, the gateway calculates the average distance from a set of measurements. Both the average distance and real-time distance are transmitted via MQTT and the REST API, ensuring stable representation in your chosen home automation software.
Water Level Sensor – Internal Webserver

Home Assistant Water Level Dashboard

In this post I am going to guide you through the process of integrating your water level meter into Home Assistant. After going through this guide you are able to track the water level with the Home Assistant Distance Meter Gateway Dashboard.

The Water Level dashboard from Smart Gateways shown below:

If you are not sure if this Distance Meter Gateway is the right solution for you, just send a message to Smart Gateways and they will advice you about this solution. You can use the contact form on their website for this.

Pre-requirements to setup the Water Level Dashboard

Setting up the dashboard can be done in a few easy steps. Complete each step one by one and verify if the step is completed before proceeding with the next step.

  1. First install Mosquitto MQTT Broker on Home Assistant using this manual
  2. Connect the Distance Meter WiFi Gateway using the Installation Manual found on the Smart Gateways Support page
  3. Enter the MQTT settings on the internal webpage of the Distance Meter WiFi Gateway
  4. Install HACS (Home Assistant Community Store) using this manual

Install the Apexcharts-card plugin into Home Assistant

When you completed all the above steps it’s time to add the apexcharts-card repository to Home Assistant. You have to do this using HACS.

  1. Click HACS on the sidebar of Home Assistant
  2. Click Frontend
  3. Click EXPLORE & DOWNLOAD REPOSITORIES in the lower right corner
  4. Type apexcharts-card in the Search for repository box
  5. Click DOWNLOAD in the lower right corner
  6. Select the latest version and Click DOWNLOAD
  7. RELOAD the browser to activate the apexcharts-card plugin

Add additional MQTT Configuration for diagnostical data

*Send a copy of your order or the invoice (not the shipment information) to to receive the password for the configuration files.

The Water Level Dashboard for Home Assistant will show some diagnostical data from the Distance Meter WiFi Gateway. This data is sent by the gateway through MQTT. You can add this to Home Assistant by adding a mqtt file. You first have to install the File editor Add-on.

  1. Within your Home Assistant frontend/home navigate to the Settings menu
  2. Click Add-ons
  3. Click ADD-ON STORE in the lower right corner
  4. Go to the Search add-ons box
  5. Type File editor
  6. Click on File editor from the list
  7. Click INSTALL and wait for the File editor to be installed
  8. Enable Start on boot, Show in sidebar and Watchdog
  9. Click START to start the broker

Add the Packages directory to Home Assistant and place some configuration files

When using the packages directory for all your .yaml configuration files, you are able to sort all configuration in specific files for each integration. You have to edit the configuration.yaml file first for Home Assistant to use the packages directory.

  1. The file editor is shown in the sidebar. Click on the File editor icon
  2. Click on the configuration.yaml file
  3. The contents of the configuration.yaml file are shown
  4. Insert the following configuration into the file:
    • homeassistant:
        packages: !include_dir_named packages
  5. Click the save button (Floppy Disk Icon) on the upper right corner to save the configuration.yaml
  6. Click on the Browse File System Icon on the upper bar
  7. Click on the New Folder icon (second icon)
  8. name the new folder packages
  9. Click OK
  10. Download the following file (disable pop-up blockers)
  11. Unpack the zip file
  12. Place the file smartgateways_distancemeter.yaml in the packages folder by using the Upload File button within the File editor Add-on
  13. Save the file
  14. Restart Home Assistant

Add the Water Level Dashboard to Home Assistant

When you completed all the above steps it’s time to add the Water Level Dashboard to Home Assistant.

  1. Enable Advanced Mode for your user account
    • Within your Home Assistant frontend/home navigate your user profile (in the lower left corner)
    • Enable Advanced Mode to unlock advanced features
  2. Open the file distancemeter_dashboard.txt from the downloaded zip file and copy the contents of this file to the clipboard
  3. Click the three dots in the upper right corner of the dashboard in Home Assistant
  4. Click on the 3 dots again
  5. Click Raw configuration editor
  6. Scroll till the end and start a new line
  7. Paste the contents of the Dashboard panels file into the editor
  8. Click SAVE in the upper right corner
  9. Close the editor by clicking the cross on the upper left corner
  10. Restart Home Assistant
  11. Notice the new Water Level Dashboard.

2 thoughts on “Water Level Dashboard for Home Assistant”
  1. Hi Roel,
    very interesting article.
    What is the power necessary for this device ?
    I need to install such a device but I would like to power it with my solar panel so I need a 12V device.
    Is this distance meter compatible with such power ?

    1. Hi Candido,

      The gateway uses 40mA power and has a micro usb connector. You can use a small solar panel with usb connector to feed the gateway. There are multiple users using this. Just use enough batteries in the solar panel to get along the dark days in winter. Also you can use the extension cables (optionally available when you place the gateway in your cart) to place the gateway near a power supply.

Leave a Reply

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