Are you Energy-Efficient? Sense it the Web Way!

Just felt like sharing with you one of our latest prototype which we created for a private foundation working in the field of energy awareness and sustainability in Switzerland called Cudrefin02.

I think that a major burden for people, who want to save energy at home, is for them to identify how much energy is consumed by different appliances. How much does my computer consume in operation / when it is powered off? Is the consumption of my energy-saving lamp significantly lower in the long run than the normal lamp I’ve got there? Such questions are key to understand where energy can be saved without too much effort. Currently available solutions, such as pluggable power monitors, are helpful, but do not fully fit the needs of individuals. They lack demonstrating power such as being able to compare consumption on a centralized screen, in an appealing manner.
In this project we implement a system that’s very simple to set up and that can be used in everyday life. As a first step each device to be monitored is coupled to a Plogg . These cool sensor nodes are a combination of an electricity meter plug and a data logger. They offer a Bluetooth interface to retrieve the current or logged consumption, making them great for appliance-level monitoring.

In order to automatically acquire the logged data, we extended the basic functionality of the Ploggs to feature continuous measurements on a fine, granular, time basis. In addition, we developed an integration of the Ploggs’ measurements to a web-based user interface which allows for attractive visualization and control as well as integration of the data on the web.
Thanks to the good cooperation with Energy Optimizers, makers of the Ploggs, we got access to a C-language API that enables us to connect to the core functionalities of the Ploggs. Our first component is a C++ gateway that discovers and manages the Ploggs. In order to enable interoperability with other applications, the gateway embeds a web server (SHTTPD) and offers access to the sensors’ functionality through simple and structured URLs, the web way!

As an example the monitoring data of all the available Ploggs, can be retrieved by accessing the following URL:
http://webofthings.net/energymonitor/ploggs/*
The gateway then discovers the devices and returns the results in the form of a JSON document:
[{
"deviceName": "ComputerAndScreen",
"currentWatts": 50.52,
"KWh": 5.835,
"maxWattage": 100.56
}, {…}]

The approach, that makes an application’s functionality accessible through a simple and well-defined web interface is often referred as RESTful, and has several advantages over more traditional interoperability approaches such as classic WS-* Web Services. First of all it is quite straightforward to use and integrate: any application that can access the web can consume RESTful services and any sensor that has an embedded web server can directly push content onto the web. Secondly, the use of JSON instead of XML reduces the need for complex parsers and requires very little bandwidth.

The second part of our software architecture is in charge of presenting the monitoring data to the end-user. We needed the interface to be attractive, easily-accessible (no additional software to learn or install) and to display real-time data rather than snapshots. Thus, we decided to use a web interface. The implementation is based on the Google Web Toolkit (GWT), a toolkit for building AJAX applications, as well as the OFCGWT toolkit which offers a set of customizable graphs. Using GWT, our application is written in Java and then automatically translated into client-side javascript. This javascript initiates a connection to the gateway every few seconds and directly translates the JSON Ploggs’ results into graphs.
The attached screenshot is what the app looks like in action.

We are now trying to polish the whole application so that someone owning Ploggs could install it and run it within a few minutes. We’ll keep you updated about the advances and publish the code here as soon as we’ll release it!

screenshot_english_correct

You may also like...

  • Yury Strashnoy

    Hello,
    Would it be possible to get your system prototype project – so I can install at my place and may be extend some features (e.g. monitoring of many gateways, collect temperature information, etc).

    What is the platform you use for the gateway (hardware and O/S):
    Is it a standard Wintel PC with Windows XP or is it PloggZgb EAP gateway ?

    Thank you
    Yury

  • Hi Yury,

    Actually we are going to release the gateway and interface software on this website soon so stay tuned.

    As for the details the gateway software is currently written in C++ and has a very small footprint but it uses a Windows DLL for bluetooth communication which means it has to be installed on a Wintel PC with BT capabilities.

  • SpaceTimeContinuum

    Dominique & Vlad,

    do you know this product?
    http://visiblenergy.com/index.html

    Thanks
    Edouard

    • oops, didn’t hear about it! Thanks a lot for the tip Edouard!

      Dom, you should have bought the domain before that guy got it, grrr!!

      I wonder how much of the flashy stuff shown there works, and is really being sold… Looks like google energy thingie, be there fast with a nice design, but makes me wonder what’s behind the façade…

  • Salut Edouard!

    Sounds indeed like a promising project, slick and design! Rather crazy that their project has the same name…

    Just wonder how open their system is, I’d like to have something open in my home for monitoring energy (e.g. based on the RESTful approach) rather than a close system working on my iPhone app only.

    But it sounds like the competition is getting tough 😉
    Thanks a bunch for your comment!

  • Jose

    Hello Dominique,

    I was wondering if you already published the prototype?

    Thanks,
    Jose

    • Dear Jose,

      We are still working on it and should be able to publish the code in about two month from now. Stay tuned on this blog for more info.

  • Pingback: Tim O’Reilly: “The next stage of Web 2.0 is going to be driven by sensors” | Web of Things()

  • Massimo Dore

    Hi Dominique,
    I am implementing a solution to measure the home consumptions using Plogg devices but Zigbee instead of bluetooth. I developed a java interface to get the Plogg data so I am able to run it both on linux and windows server.
    I push data to a queue microbroker using the format you suggested (Json). So I can decouple the monitor from the client programs (to produce live data, chars, etc…)
    The following link is the (prototype page) of my work:
    http://digilander.libero.it/maxdodo/consumi.htm

    Ciao
    Massimo

  • That sounds excellent Massimo, great project to turn your house into an Energy Aware one!

    The Linux version is actually what we are working on right now, since our current version of the Ploggs Gateway is Windows only (we use a DLL provided by the Energy Optimizers crew…).
    What did you actually use if I may ask? I mean what kind of wrapper do you use in Java for connecting to the Zigbee Ploggs. For the BT version we currently use an virtual serial port (rfcomm): http://www.guinard.org/~misterdom/2009/03/18/connecting-to-the-ploggs-using-bt/

    Would be interested to know what you solution looks like because we ordered a bunch of Zigbee Ploggs a few days ago…

  • Massimo Dore

    Hi Dominique,
    following is a short description of software I wrote.
    1) First I investigated how “Plogg Manager” program works. I use telegesis usb zigbee interface. The driver installs a com: port on windows, or a /dev/ttyxx on Linux and mac os (both supported). Reading the telegesis manual I have seen that you can talk to Plogg devices using ATxx commands. So I installed a port monitor to capture the message handshaking between the program and the Plogg.

    Example:

    AT+SN
    OK
    FFD:000D6F0000224328
    FFD:000D6F0000262B19
    AT+UCAST:000d6f0000224328=v
    +UCAST:00
    OK
    ACK:00
    UCAST:000D6F0000224328=~~SW Version 1.70~~Unit friendly name = Scaldabagno~~PCB Build R
    UCAST:000D6F0000224328=esistors DIO9=1 , DIO10=0 , DIO11=0 ~~Unit is Zigbee Enabled~~
    UCAST:000D6F0000224328=- Unit is a configured as a router~~ – Current Pan = 31F4 unit
    UCAST:000D6F0000224328= is router~~Zigbee echo is on!!!~~TickCount = 9741087 ~~~~~~>

    2) I wrote a java program to monitor the installed devices. It is based on opensource java:

    – rxtxcomm package, for serial port management
    – jtopas-08 is a library to do lexical analysis and parsing of the strings received by devices
    it performs the following steps:
    a) scan for zigbee devices and build a class element for each
    b) get the name of devices
    c) get the measurements
    d) send a JSON formatted message to a queue
    e) sleep for xx secs
    d) repeat step c->e forever

    I decided to push the message to a queue to loosely decouple the monitor from the two clients used to produce data for web and graphical pictures.
    Using a broker I can send one message to many indipendent client programs at the same time.
    I used the free message broker that you can download by http://www.mqtt.org/
    It has a small footprint (50k) and runs also on small low power consuming devices (NSLU2-unix).
    I am improving the code and correcting some bugs, especially on the parsing side in the work spare time.
    I can share the code with you without problems if you like.
    Actually I installed the application on an artigo pc (http://www.via.com.tw/en/products/embedded/artigo/) that I choose because it’s powerful, low consuming (15W running, 5W standby) equipped with a 32 Gb SSD disk.

    Ciao
    Massimo

  • In your March 5 post you talked about Polggs and Bluetooth. Will your application support the Zigbee Ploggs?

  • Hi Roy,

    Not yet but we are currenlty doing that and still hoping to be able to opensource the whole in a while. We’ll post more about it here.

  • Khutsafalo

    Hi Massimo

    Did you at some point encounter problems with detecting Plogg devices using Plogg Manager? I’m currently trying to setup a Zigbee network using Ploggs and Telegesis USB stick to monitor electricity usage on a bunch of computers. I followed all the instructions from the Plogg website to setup the USB stick as coordinator and Ploggs as routers, however the Plogg Manager cannot detect any Plogg devices. Any advice on that?

    Thanks.

    Khutsafalo

  • Not really no, we did not encounter that problem, but I would suggest you contact the Energy Optimizers team, they are usually quite helpful and kind!

  • Hi. I spoke to someone here about Ploggs that spit out binary. We don’t have the Windows SDK. I written some code in Perl that interprets the binary Plogg protocol and released it on Sourceforge. I hope someone finds it useful. It’s called plogger.

  • Gary

    Hi Massimo Dore,

    I am also developing a java interface for the Telegeis modules, Have just started and saw your post that you would be willing to share your code for performing.

    a) scan for zigbee devices and build a class element for each
    b) get the name of devices
    c) get the measurements
    d) send a JSON formatted message to a queue
    e) sleep for xx secs
    d) repeat step c->e forever

    I was wondering is the offer still available as this would save me a lot of time?

    thanks
    Gary

  • Dear Gary,

    We actually now also have a full Java stack for interacting with the Zigbee Ploggs using a RESTful API. I does pretty much what you need in this case.
    We want to opensource it soon but if you drop me a mail ( you can find my mail on http://www.guinard.org/ ) I’ll be happy to send you the source code alongside with instructions!

    Dominique

  • Gary

    Hi Dominique,

    got the code, a big thanks. I will be look at the code this weekend and hopefully make use of it.

    Gary

  • Pingback: 3 medidores de consumo de electricidad para construir tu mismo « enerzuul()

  • Anonymous

    Hello guys,,

    i am experimenting on a plogg project..

    i have an arduino that gets the results from the plogg

    but i have problem to decode them..

    does anybody knows how i can do it??

    thanks..