If you have an SDR (softwared-defined radio) dongle and are interesting in sniffing your utility meters (electric, gas, water), you an use the open source rtl_tcp
and rtl_amr
programs to see the consumption messages regularly sent out by your meters [or if you are nosy, also your neighbors’ meters :)]
Ben Johnson published a python script called amridm2mqtt
(GitHub - ragingcomputer/amridm2mqtt: runs rtlamr to read IDM power meter data and send to MQTT broker) that automatically reads the ‘csv’ output of rtlamr
for IDM messages and then republishes the messages to an MQTT broker which the HA MQTT integration can then use to suck in the data.
I substantially re-wrote and extended the code to be more flexible and customizable across a wider range of message types and meters.
KEY ADDITIONS include ability to:
- Mix and match all the message types supported by ‘rtlamr’ from multiple meters
- Specify MQTT_TOPIC_PREFIX
- Specify or use default field for reading or any given meter and message type
- Specify user-friendly name for the meter topic (in addition to the number)
- Specify multiplier on a per meter basis (and to set a default)
- Specify percentage and absolute deviations to identify and reject outliers
- Specify whether to publish unchanged (i.e., duplicate messages)
- Publish additional fields beyond just the core ‘consumption’ reading
- Specify whether to ‘retain’ messages by meter (and to set a default)
- Specify ‘rtlamr’ center frequency
- Set debug level for more debug details and granularity
The core script is titled amr2mqtt.py
All the user settings are set in settings.py
See:
Again thanks to Ben Johnson for the inspiration and the starting code!