So for Christmas my lovely wife got me the only present I really wanted.
What is it?
It’s a “whole house” energy monitor. Basically, one part of it hooks into a breaker in your electrical panel and clamps onto the power lines that come into your house. (Not nearly as scary as it sounds, but if you’re not familiar with your breaker box, get a friend who is). The other part is a little box that plugs into any wall socket and you end up with a reading for how much power your house is drawing at that moment.
It’s like having a digital version of your hydro meter inside your house, and readable!
Of course, that wasn’t enough for me. And what really attracted me to this device was its ability to save data on a computer. TED provides software for Windows. It’s nice and all. But I hate Windows, and I don’t want to have to go to only one computer to be able to see the information. I want it on the web (like I have done with my Vantage Pro weather station at www.alberniweather.ca).
So… what you see at the top of the blog is the fruits of my labour.
I found a wonderful little “python” script called “ted.py” on the Internet. You can google it and it will come up. It got me started.
I added the ability for it to talk to mySQL and sqlite databases.
And now it archives to both, locally on my Mac Mini and remotely to my database online.
This could be run on Linux, Unix, and I believe Windows supports the needed python libs as well).
Feel free to download the two scripts and modify at will:
The “TED.PY” script reads from TED and stores into a database. It is stand-alone as it need not rely on network connectivity so hopefully you get as much data as possible archived since TED itself doesn’t archive any data (aside from monthly highs and things)
http://www.murkyview.com/ted.py (start with: sudo python ted.py /dev/tty.usbserial-A7007fWm &)
The TEDmySQL.PY script lives in the same directory. You only need to run this if you want to archive your TED data to a mySQL database. mySQL is more commonly used by webhosts than sqlite, so this is why this script is provided…
http://www.murkyview.com/tedmysql.py
I also obtained the Serial API specification from the makers of TED. This helped me to get to know where to get the data.
Unfortunately, I’m not entirely sure how to get all the data off of it, specifically the “Totals”. If anyone sees this blog and might have any ideas how I can go about retrieving these bits from the serial stream I’d greatly appreciate it. You’ll notice my Totals above just don’t look right. I will keep trying to figure them out.
In the meantime. I hope this script is useful to others. If you have any questions feel free to ask. I however will not be held responsible you happen to do to your house, your computer, or your sanity by using that script.
Enjoy!
Chris