Power Monitoring with rtl-sdr
Inspired by a blog post, I decided to set up power monitoring for myself too. I however like the simple look of rrdtool so I am using that to store the data.
This uses rtlamr to process the radio broadcasts by the meter.
I live in a less dense location than the blog author so only picked up three meters using the
My meter included a serial number on its face that directly matched one of those three meters so it was very easy to get the right reading.
Install rtl-sdr on the system that has the rtl-sdr device. Install rtlamr rrdtool and its Python bindings on the system that will do the processing. For me, I have it all on the same computer.
power/rtl_tcp_cron script will run a tmux session with
rtl_tcp in it.
Use one of two scripts to get the data into the rrdtool database.
power/meter_reading.pyscript will use
rtlamr's one-shot mode to connect and wait for a broadcast. I tried this for a while but had issues with
rtl_tcpnot working after some number of connections. This method works better if you need to use the rtl-sdr device for other things.
power/rtlamr_samplescript maintains a single connection to
rtl_tcpand writes each reading to a file. Use the
power/meter_reading.pyscript with the
--inputoption and that file to add the consumption amount from that reading to the database.
power/graph_usage script will create four graphs:
- Today's usage.
- Yesterday's usage.
- This week's usage.
- This month's usage.
- Last month's usage (soon).
Each graph will contain the kWh consumed over that time period.