Tag Archives: mac

Real-time-ish Current Cost graphing

Since installing my Current Cost meter, I managed to get Dale‘s graphing app up and running fairly quickly. Since then, I’ve progressed a bit with my own Python.

The scripts are fairly thrown together as I’ve waded my way through various Python documentation, and the sqlite and Google Chart API modules, but I’ve managed to get some initial graphing up and running, which you can find on the Current Cost tab (or click here).

The graphs should update every couple of minutes, and so far show power usage & temperature readings for the last 15 minutes, and last hour. To get these working, I have a script which listens continually for the output from the CC128 and stores it into a sqlite database. There’s a second script which reads this database and makes calls to the Google charting API, generates PNG files and then pushes those up to my blog host.

I’d like to get 6-hourly, daily and weekly graphs, but these will require a bit more fiddling as the data needs aggregating before passing to the chart API. I suspect it’ll be a few weeks before I have the time to get that working… Likewise the graphs need a bit of tidying up (better axes, labels, etc).

In the unlikely event that anyone’s interested in the Python scripts to do this, either leave a comment in this post or drop me a mail.

My first electricity graph

…almost. I’ve mentioned before how I’ve been reading my electricity and gas meters every four weeks or so, which gives a rough approximation of how much we’re consuming in our house.

I’ve got my Current Cost meter up and running with Dale Lane‘s Python app. This was ever-so-slightly fiddly, so I thought I’d add my voice to those already out there with some step-by-step instructions for OS X users.

  1. Get a Current Cost meter
  2. Order the USB serial lead
  3. Install the drivers for said lead – this creates a new device
  4. Install the Apple Developer Tools
  5. Download the Python source for Dale’s app
  6. Follow the prerequisite list
  7. Install MacPorts
  8. Rebuild SQLite (run sudo port install sqlite3 +loadable_extensions from an XTerm)
  9. Export the DYLD_LIBRARY_PATH (for me this was export DYLD_LIBRARY_PATH=/opt/local/lib)
  10. Run the app – python currentcost.py

Not too bad, and you should get a nice pretty graph, like so:

Next up, I’m going to be taking the real-time data into a database and trying my own bit of graphing.

Spanning Sync

With a plethora of devices and services, it’s a challenge to keep everything in sync. Since long before having an iPhone, I’ve wanted to keep my calendar and contacts in line across my phone, my laptop and an online service for when I’m at work.

The iPhone is great for keeping my phone in sync – every time I plug it in, it all updates… But adding calendar events with notes, or changing a series of addresses can be a hassle, and I like to have my data backed up online, and also easily accessible on a computer when I’m at work or otherwise away from my laptop.

For quite a while now I’ve been using Spanning Sync. This syncs my calendars and contacts from my Mac to Google. It’s entirely seamless – to the point that I regularly forget it’s even there. I don’t remember ever having problems with it doing bad things to my calendar, which is no mean feat.

If you’ve got a Mac (or more than one), you want to get your calendar/contacts synchronised between them, and don’t want to pay for .MacMobile Me, I can’t recommend it enough. It costs $25 for the first year and $15 thereafter normally, but they also offer a programme called ‘Save 5, Make 5′, where referrals have a $5 discount, and I get $5 for the referal too. Everyone’s a winner!