Simple Household Energy Monitoring

I was inspired by Alan Abbott’s excellent article about his home setup. https://alanabbott.me/posts/2024/07/my-diy-data-center-how-i-built-enterprise-it-skills-at-home/

When the power company put in smart meters, I wanted to see the data too. I wanted to know

  • Which appliances are running?
  • How much does it cost to run any specific appliance - particularly the air conditioner and the pool filter pump?
  • Would it save me money if I replaced one or more with more efficient ones?
  • When I do run the A/C, what’s the power source? (solar, wind, hydro, natural gas, etc)

I started looking at how I could get the data.

I’ll describe my first failed attempt at getting data. Then, how I successfully got the electricity usage and power source data. I’ll talk about the database and visualization software that I used and the scripts I wrote to capture the data.

Finally, I’ll talk about the current project to automatically store and graph which appliances are running and what power they are using.

House Layout

My house is a typical mid-century California ranch house. It was built in the 1950s and expanded/updated in the 1980s. As was typical at the time, there is no central heat or air. It has natural gas wall heaters in two rooms and a gas fireplace. 

When the house was remodeled and expanded in the 1980s they put in a swimming pool and wall unit air conditioner. In the early 2000s when I moved in, I replaced the single pane aluminum windows and the tar and gravel roof with modern dual pane windows and a polyurethane foam roof. With our climate, it’s comfortable. 

Our gas and electricity utility is PG&E. They installed smart gas and electricity meters about 10 years ago.

False Start

My original plan was to do it all myself. I had this idea that I could use a Software Defined Radio (SDR) dongle to snoop on the wireless signals that PG&E was sending from the smart meter, decode, and store them. I was interested in trying out SDR anyway.

The frequencies that PG&E use are published. However, the electricity data is encrypted and it’s not really feasible. (Zigbee protocols). 

I was able to get Gas Meter data though it was not terribly useful. Unlike the electricity meters that report data multiple times a minute, the gas meter was once a day or more. It wouldn’t be useful for analytics purposes. I abandoned the idea of getting gas meter data and concentrated on getting the electricity data

Good Data

I found a reasonably affordable (US$100) device that PG&E supports that will capture the data from their smart meters. I bought a Rainforest Eagle-3 https://www.rainforestautomation.com/rfa-z114-eagle-200-2/ 

It is a little box that connects wirelessly to the smart meter and communicates with it via the Zigbee interface. You have to give the details of the device to PG&E via their web site to connect it. It was eventually pretty straight-forward.

I say eventually because my first attempt to connect it did not work, even with PG&E’s tech support. I got busy with other projects for a while and didn’t try again for several months. In the second go around, it worked without any hassles. 

I wasn’t planning on using the Rainforest site for storing and visualizing my data, but it was nice to see that it was operational.

Data Storage and Visualization Overview

There’s a bunch of ways this could be done. I’ve been using Raspberry PIs for my home weather station and it was logical to just expand on it. I have this Raspberry PI set up as a headless server and I connect into it via SSH, but mostly I connect via the Grafana web interface.

I use InfluxDB to store the time series data with Grafana for charts and graphs. These are both well supported solutions that have free, open source versions that run well on PI. I have them both running on a Raspberry PI 4.

I’ve considered moving this to containers/Kuberetes or virtualized solutions, but haven’t had the need yet.

Electricity...

Read more »