Taking Advantage of the Open APIs

Visible Energy more than makes up for the absence of an Android app by fully opening up access to the unit and gathered statistics over HTTP. The APIs are simple to use, with the data being presented in either HTML or JSON format. For example, to determine the current status of the sockets, one could just send a HTTP request to the UFO Power Center of the form: http://{IP}/{SOCKET}/status.[xml|js] ; A XML request returns data in the XML format, and a JS request in the JSON format. The exact format and fields can be found in the developer documentation.

The APIs can be used to create custom apps / scripts / programs which display or change the following information:

  1. Device status, inclusive of network configuration
    1. Device type, name and firmware version
    2. Device uptime
    3. Current time and GMT offset
    4. Ethernet MAC address, DHCP state, IP configuration details
    5. Wi-FI signal strength
    6. Number of device restarts by type
    7. Software threads and memory status
  2. Real-Time-Clock status
  3. LED light status and control (brightness as well as power consumption level corresponding to the yellow and red colours which are set to 50W and 100W by default)
  4. Device and socket names
  5. Socket control
    1. State and status information
    2. Relay activation
    3. One shot / weekly schedule timer setup
    4. Timer overriding
    5. Role status
  6. Instantaneous power reading on a device as well as per-socket basis
  7. Total energy consumption (recorded at 5-minute intervals) for a pre-defined time period on a device as well as per-socket basis (Records are guaranteed to be available for each socket at least for two months, sometimes more)
  8. Life-time meter (device as well as per-socket)
  9. Memory log of raw consumption data

The purpose of this section is to not simply list out the various aspects accessible to developers through the open APIs. In the remainder of this section, I will discuss how the open APIs have been put to practical use by me and my colleagues at AnandTech.

As tech reviewers, power consumption of various devices is one aspect on which we spend a lot of time and effort. In the initial days, I used a Kill A Watt meter for this purpose. While it could deliver a rough idea of the power consumption, it wasn’t possible to record the values over a given time interval. In order to overcome this shortcoming, I shifted to using a Watts Up? Pro meter. By connecting it through USB to a PC and using the bundled software, it became possible to gather the instantaneous power consumption values over a particular time interval. Anand used to utilize the Extech True RMS Power Analyzer Datalogger for power measurement purposes. All the above devices provide power measurement with a 0.1 W resolution only. In addition, the Extech meter has a RS232 interface to the PC and the Watts Up? Pro has a USB interface, and both of them use custom software to track and download data from them.

Given the above aspects, all of us at AnandTech were looking for a power meter which could provide more accurate power measurement and also be easier to use / automate. One of my first tasks after putting the UFO Power Center through the paces was to use the provided power measurement APIs to solve this problem. I developed a custom Perl script to interact with the UFO Power Center (the script can actually interact with any Visible Energy device in the local network) and record the power consumed by a selected socket.

The power consumption recording is started and stopped by the user from within the program (this makes it useful to record the power consumed by a device, say, when it is running some particular sequence) and exported as a CSV file. After I developed this script, Anand went out and purchased a UFO Power Center of his own and started using the script for his reviews too. For example, all the power consumption graphs in the Vishera review were generated using Microsoft Excel and the CSV files exported by the Perl script.

Sample Graph Created using Values Exported from the UFO Power Center using the Open APIs

The power numbers reported by the UFO Power Center have a 0.01W resolution. In addition, it is possible to track the power consumed by all the four sockets simultaneously. In effect, the device can replace 4 Kill A Watts or 4 Watts Up? Pro meters and can be polled wirelessly for power measurement purposes. Similar to the script I created above, developers can utilize the provided APIs to come up with other interesting applications.

Functionality and Cloud Back-End Concluding Remarks - Unbeatable Value
Comments Locked

35 Comments

View All Comments

  • OCedHrt - Friday, October 26, 2012 - link

    It does look like it would fit then?
  • ssddaydream - Friday, October 26, 2012 - link

    I actually would enjoy having a device like this if it were in the common surge suppressor form factor. I think the lamp-like UFO appearance detracts from the product. I usually mount stuff like this behind the desk where it is still accessible, but out of view. I'm sure I could find a way to get this thing mounted and tucked away, but it takes up valuable extra space needlessly.
  • ZETAPIERRE - Friday, October 26, 2012 - link

    We have one made that is WiFi. It has only a duplex receptacle, but each half is individually controlled. It too uses 16A relays, the same type. We use them to collect power information and to control equipment at work. We power the compressors, printers, solderbench, etc... We also have a control in the system tray that allows employees to turn on the equipment. If they forget to turn it off, it goes off under a timer. It's software, so you can make it do anything, even send out emails.
  • Flunk - Friday, October 26, 2012 - link

    "There is no way to change the HTTP access port. This might be useful in the case where the user cooks up a custom script to control / query the unit, but wants to use it from an external network. It is possible to set up port forwarding to access the unit via the default HTTP port. However, in the case that this port already forwards to another machine in the local network, the user has no way to access the UFO over the Internet without modifying the HTTP port of the other machine."

    A lot of routers, even cheap ones, support routing with different external and internal ports. E.G. mapping port 3333 to port 80 on 192.168.1.1 so this isn't that big of a deal.
  • IKeelU - Friday, October 26, 2012 - link

    So many of my power cables are longer than they need to be (for my needs), so setting up my home theater or adding a new component always involves some form of cable management to ensure I don't have spaghetti back there. This design, while a bit cumbersome, would alleviate that.
  • nathanddrews - Friday, October 26, 2012 - link

    This is odd for an eco-driven device. Why would I want to buy something that consumes that much power on its own (WiFi/bulb) in order to monitor and regulate power? Seems counterintuitive, but I suppose there are many people that don't have wired connections in their homes (sad). The option would be nice. The fact that it is completely fugly as a lamp is also confusing. That last bit is subjective, I realize...

    Looking foward to future revisions, though! I'd love to have a wired rackmount version for my server rack, my home theater, and then conventional looking power strips for other power-hungry areas (washer/dryer, office devices, other entertainment areas, powertools in workshop, etc.).
  • NeBlackCat - Friday, October 26, 2012 - link

    +1 for rackmount version

    As an eco fascist I'd be tempted to have my house electrics rewired from the standard multiple "multidrop" circuits, to a single star configuration where every power outlet/device goes to a UFO port.

    The things I could then do...
  • DanNeely - Friday, October 26, 2012 - link

    The reason most outlets are wired in a multiloop fashion is to minimize copper use. Replacing an N outlet loop with N outlets wired in a star pattern will use approximately N times more copper.

    After being convicted by the court in eco Nuremberg for wasteful use of resources extracted by destructive mining you wouldn't be able to do much beyond pushing up daisies.
  • taltamir - Friday, October 26, 2012 - link

    By law, businesses must be wired in a star configuration rather than multidrop.
    Multidrop is used because its cheaper, but its less safe as multiple outlets share a single line.
  • ironargonaut - Sunday, November 4, 2012 - link

    In what country? I can overload a single 20A receptacle by creating a short just as easy as a 10 receptacles on the same loop. The only thing that matters is you keep the breaker small enough to trip before the wire insulation fails. I.E. don't use 14guage wire with a 20A breaker...etc.

    Technically all homes/businesses use a star config as you have multiple breakers, but you also have multiple lights/outlets per breaker. Or am I defining "star" config differently then you?

Log in

Don't have an account? Sign up now