One of the most interesting things I’ve done recently is integrating my residential city water meter into Home Assistant using a USB Software Defined Radio (SDR). I’ve been exploring ways to import utility meter data, like gas, water, and electricity into Home Assistant, and I discovered many of these meters emit signals over radio frequency.

Using RTL-SDR and rtl_433 for Water Meter Home Assistant Integration

After reading success stories online, I picked up the Nooelec RTL-SDR v5 Bundle from Amazon. This little USB SDR dongle can tune from 100kHz to 1.75GHz, which is perfect for picking up utility meter signals.

My first attempt was to plug the SDR into my Raspberry Pi 4 running Home Assistant and use the rtl_433 addon. Unfortunately, I ran into some power issues and weird addon errors, likely due to the antenna drawing too much power with everything else I already had plugged in.

Setting Up a Dedicated SDR Host for Home Assistant

To fix this, I decided to run the SDR on a dedicated Raspberry Pi. I had an old, original Pi 1 Model B lying around. With a decent 2A power supply and a wireless N dongle for network connectivity, I installed Raspbian Lite and the rtl_433 tool.

I experimented with both 433 MHz and 915 MHz frequencies, using the coiled antennas included in the kit. The 900 MHz antenna ended up being the winner. On the 915 MHz band, I finally started seeing data in the logs:

An example of the data I was seeing in the rtl_433 logs

Identifying My Water Meter in Home Assistant Logs

One key data point stood out: a field called Consumption Data showing a value around 168000. After comparing this with the value on my actual Neptune T-10 water meter (used by the City of Ottawa), I realized I was picking up my own water meter’s signal!

I also saw signals from neighboring meters, but by monitoring the data for a few hours, I confirmed which one was mine. The value updated every 15 to 30 minutes.

Fixing USB Stability for Water Meter Data Collection

One hiccup: after several hours, rtl_433 would crash with libusb errors. Unplugging and replugging fixed it temporarily, but the long-term solution was to use a powered USB hub (4A supply) to give the SDR the juice it needed. I also ditched the USB extension cable from the kit and plugged the SDR directly into the hub. That seemed to fix the issue.

The nice thing with this hub is also that I can use it to power the Pi; so I have 1 power cable for the hub, with 1 USB cable running from the hub to the Pi. I have a microUSB cable going from the hub to the Pi for power, and I have the RTL-SDR and Wi-Fi dongle plugged into the USB hub. You can see the final setup up close in the picture below:

My final setup showing the USB hub, radio, Wi-Fi dongle and Pi all connected

Publishing Water Meter Data to Home Assistant via MQTT

With the setup stable, I configured rtl_433 to output data to MQTT. Since I already had the Mosquitto addon running in Home Assistant, I pointed rtl_433 to it and monitored the output using MQTT Explorer. I found the data for my meter which matched up to the logs I was seeing directly on the Pi:

Seeing water meter consumption data in mqtt home assistant

Creating a Systemd Service for Water Meter Integration

To make everything persistent, I created a systemd service at /etc/systemd/system/ha-sdr-915M.service:

[Unit]
Description=rtl_433 on 915M SDR
After=network.target

[Service]
ExecStart=/usr/local/bin/ha-sdr-915M.sh
Restart=unless-stopped
WorkingDirectory=/usr/local/bin

[Install]
WantedBy=multi-user.target

The script at /usr/local/bin/ha-sdr-915M.sh:

#!/bin/bash

source /etc/ha-sdr.env

LOGFILE="/var/log/ha-sdr/ha-sdr-915M.log"

/usr/bin/rtl_433 -f 915M -F mqtt://homeassistant.domain.com:1883,user=$MQTT_USER,pass=$MQTT_PASS -F kv 2>&1 | while IFS= read -r line
do
    echo "$(date '+%Y-%m-%d %H:%M:%S') $line"
done >> "$LOGFILE"

I enabled the service by running systemctl daemon-reload and systemctl enable ha-sdr-915M.service.

Adding a Water Meter MQTT Sensor in Home Assistant

In Home Assistant YAML configuration:

sensor:
  - name: "Water Meter Consumption Data"
    object_id: water_meter_consumption_data
    state_topic: "rtl_433/pisdrfrontoh/devices/ERT-SCM/33391039/consumption_data"
    unit_of_measurement: "gal"
    state_class: total_increasing
    device_class: water

I noticed the values from my meter were in gallons, even though I’m in Canada where cubic meters or litres are common. To convert to litres, I added a template sensor:

sensor:
  - name: "Water Meter Consumption (Litres)"
    state: >
      {{ states('sensor.water_meter_consumption_data') | float * 3.78541178 | round(2) }}
    unit_of_measurement: "L"
    device_class: water

Setting Up a Utility Meter for Daily Water Tracking

Finally, I created a utility meter entity to track daily water usage:

utility_meter:
  daily_water:
    source: sensor.water_meter_consumption_litres
    cycle: daily

This entity allowed me to graph and display daily water usage data directly from my water meter in Home Assistant:

Water meter home assistant usage graph in litres

Final Thoughts on Monitoring My Water Meter with Home Assistant

This project took a few days of tuning and monitoring, but I’m thrilled with the results. For now, I’m only picking up water meter data, but I’m hopeful I’ll find more signals soon.

If you’re thinking about tracking your water meter in Home Assistant, using an SDR like the Nooelec RTL-SDR v5 and rtl_433 software is a great DIY approach. The insight into water usage is already super useful!

Leave a Reply

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

Trending