Since I built my own IR-based pulse meter to monitor my whole-house power usage, I started looking around for a cloud-based solution for storing and analyzing the data. I specifically wanted something with disaggregation, so that it can identify my appliances and devices. A friend of mine uses Bidgely, but that looked like it was going to be difficult to integrate with Vera. Then I stumbled across PlotWatt
. It's free for residential users, is based around their disaggregation algorithms, and offers a straightforward API.
So, here's the script that I'm using to upload to PlotWatt. I don't know how to write plugins, so it isn't one. Also, a lot of credit goes to guessed for his SEG code
, on which this is very heavily based.
I haven't tested this with multiple meters, but it should work.The Directions
- Register for an account at PlotWatt
- After registering, it should ask you to add a meter. Select the "PlotWatt API" option
- Their next instructions will take you to the PlotWatt API documentation. The documentation will have your new API key listed at the top
- SSH into your Vera or another Linux box. Run the command from the API for adding meters, but change the number_of_new_meters to 1:
curl -X POST -d "number_of_new_meters=1" http://YOUR_API_KEY:@plotwatt.com/api/v2/new_meters
- Record the generated Meter ID
- Download the attached PlotWatt.lua
- Edit the file, entering your PlotWatt API key, Meter ID, and the Vera Device ID for your whole-house meter device
- In the Vera UI, go to Apps -> Develop Apps -> Luup Files
- On the right, click "Choose File". Browse to and select your edited PlotWatt.lua file, and click "Go"
- On the left, click "Edit Startup Lua"
- Add the following line:
- Click "Go"
- Click "Save"
- Enjoy your data flowing to PlotWatt
PlotWatt can handle data resolution of up to one read per second. They can accept data in batches, and don't want data to be uploaded any more frequently than once per minute. This script keeps track of each value from the Vera meter device every time it changes, and only uploads all of the values and times to PlotWatt if it's been more than 60 seconds since the last upload.