Collecting Power and Gas Meter Data for Home Assistant using Raspberry Pi and SDR

Home Assistant Mosquitto MQTT Broker Setup with MQTT Explorer:

Raspberry Pi Zero 2w (Amazon Affiliate)

Nooelec NESDR Mini USB RTL-SDR & ADS-B Receiver Set, RTL2832U & R820T Tuner, MCX Input. Low-Cost Software Defined Radio Compatible with Many SDR Software Packages. R820T Tuner & ESD-Safe Antenna Input (Amazon Affiliate)

Home Assistant Playlist:

Upgrade Raspberry Pi
sudo apt update && sudo apt full-upgrade
Install rtl-433 package
sudo apt install rtl-433
Listen for Devices at 912Mhz
sudo rtl_433 -f 912M
Remove rtl-433 package (if you need to compile it from scratch)
sudo apt remove rtl-433
Install Support Packages for Compiling rtl-433
sudo apt install git libtool libusb-1.0-0-dev librtlsdr-dev rtl-sdr build-essential make pkg-config
Download rtl-433 source
git clone
Compile rtl-433
cd rtl_433
mkdir build
cd build/
cmake ..
sudo make install
Send Data to Home Assistant
sudo rtl_433 -f 912M -F "mqtt://,user=mqtt_temp_user,pass=mqtt_temp_password,events=pipower[/model][/id]"
Create Service
sudo nano /etc/systemd/system/rtl433_to_mqtt.service
Description=RTL 433 to MQTT
ExecStart=sudo /usr/local/bin/rtl_433 -f 912M -F "mqtt://,user=mqtt_temp_user,pass=mqtt_temp_password,events=pipower[/model][/id]"
Enable Service and Start
sudo systemctl enable rtl433_to_mqtt
sudo systemctl start rtl433_to_mqtt
sudo systemctl status rtl433_to_mqtt
YAML for Home Assistant (/config/mqtt.yaml)
  - name: "Kilowatt Hours"
    state_topic: "pipower/ERT-SCM/<meterid>"
    unit_of_measurement: 'kWh'
    force_update: true
    value_template: "{{ value_json.consumption_data }}"
    unique_id: "kilowatt_hours_sensor"
    device_class: energy
    state_class: total

  - name: "Cubic Feet"
    state_topic: "pipower/SCMplus/<meterid>"
    unit_of_measurement: 'ft³'
    force_update: true
    value_template: "{{ value_json.Consumption }}"
    unique_id: "cubic_feet_sensor"
    device_class: gas
    state_class: total

Leave a comment

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