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.
Features:
- 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.
- Compatibility: It is compatible with popular home automation platforms such as Home Assistant, Domoticz, and Homey.
- 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.
- REST API: All measurements can be accessed via a JSON web server, allowing easy integration with other applications.
- 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.
- 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.
- 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.
- Customizable Maximum Level: You can set the maximum level of the water based on your specific requirements using the web server interface.
- Sensor Offset Adjustment: The sensor offset can be modified to virtually place the sensor higher or lower to the measured surface.
- Energy Efficiency: The gateway has a low energy consumption of 50mA, ensuring efficient operation.
- Extension cables available: The cable can be extended with the optionally available extension cables.
- 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.
- 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.
- 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.

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.
- First install Mosquitto MQTT Broker on Home Assistant using this manual
- Connect the Distance Meter WiFi Gateway using the Installation Manual found on the Smart Gateways Support page
- Enter the MQTT settings on the internal webpage of the Distance Meter WiFi Gateway
- 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.
- Click HACS on the sidebar of Home Assistant
- Click Frontend
- Click EXPLORE & DOWNLOAD REPOSITORIES in the lower right corner
- Type apexcharts-card in the Search for repository box
- Click DOWNLOAD in the lower right corner
- Select the latest version and Click DOWNLOAD
- 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 support@smartgateways.nl 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.
- Within your Home Assistant frontend/home navigate to the Settings menu
- Click Add-ons
- Click ADD-ON STORE in the lower right corner
- Go to the Search add-ons box
- Type File editor
- Click on File editor from the list
- Click INSTALL and wait for the File editor to be installed
- Enable Start on boot, Show in sidebar and Watchdog
- 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.
- The file editor is shown in the sidebar. Click on the File editor icon
- Click on the configuration.yaml file
- The contents of the configuration.yaml file are shown
- Insert the following configuration into the file:
homeassistant: packages: !include_dir_named packages
- Click the save button (Floppy Disk Icon) on the upper right corner to save the configuration.yaml
- Click on the Browse File System Icon on the upper bar
- Click on the New Folder icon (second icon)
- name the new folder packages
- Click OK
- Download the following file (disable pop-up blockers)
- Enter Password to Download:
- Unpack the zip file
- Place the file smartgateways_distancemeter.yaml in the packages folder by using the Upload File button within the File editor Add-on
- Save the file
- 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.
- 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
- Open the file distancemeter_dashboard.txt from the downloaded zip file and copy the contents of this file to the clipboard
- Click the three dots in the upper right corner of the dashboard in Home Assistant
Click on the 3 dots again
- Click Raw configuration editor
- Scroll till the end and start a new line
- Paste the contents of the Dashboard panels file into the editor
- Click SAVE in the upper right corner
- Close the editor by clicking the cross on the upper left corner
- Restart Home Assistant
- Notice the new Water Level Dashboard.