I needed a break from work tonight, so went back to playing with the CurrentCost meter – a chance to try a few new things.
The objective
I want to make a start on identifying how much electricity different things in my house use. To begin, I’m going to start with a very manual user-driven approach:
Subscribe to updates from the CurrentCost meter, and when a significant change in usage occurs, ask me what I’ve just switched on or off, and collect that information to build up a record of how much electricity different devices use.
How?
It’s already quite late, so I just wanted to hack a quick first version together. I decided to write it as a small Java app.
As I’ve mentioned before, I’m publishing the CurrentCost readings to a small broker running on my home server. The plan was to write a Java application that uses MQTT to subscribe to updates from the broker.
Why? Because I’ve not used Java on the Slug before, or with MQTT. (Is that not a good enough reason? 🙂 )
I’ve written it as a command-line app, because it’s a quick way to run it from different devices around the house. (That is, by cheating 🙂 I’m actually running the app on the home server, using PuTTY / PocketPuTTY / SSH etc. to run it from my ThinkPad, PDAs, mobile, EEE PC, etc.).