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

  • Tros - Friday, October 26, 2012 - link

    I don't see how choosing a 16A relay for each socket is "playing it safe". Maybe a >21A relay would be considered "playing it safe" (for the small-uninformed-population running a MIG-welder from a wall-socket).

    A 15A relay would mean that the manufacturer has to do some additional QA to handle the statistics in which relays actually fall short of that rating (and consequently, that 15A rating which is the basic standard for wall outlets here in the U.S.).

    This is playing it according to specification.
  • jb510 - Sunday, October 28, 2012 - link

    Is it possible to remotely tell it to power cycle a device? ...and specifically the wifi router it's relying on for control? Just to be painfully clear manually turning that plug back on after turning it off would be impossible since there'd be no wifi at that moment, so im wondering if you can just send a single command to power cycle a outlet off and back on?
  • ganeshts - Monday, October 29, 2012 - link

    Power cycle is not possible with the current firmware, and I would also advise against using one of the outlets for the Wi-Fi router itself. For such purposes, PDUs from Digital Loggers can be used because some of the outlets in their devices are left unswitched (i.e, they are on all the time as long as the PDU gets power) / they offer power cycle functionality.
  • rangerdavid - Sunday, October 28, 2012 - link

    "I am actually doing a bit of disservice to the unit by not reviewing the iOS app, as I have never been a fan of (nor do I ever plan on being one) Apple’s restrictive ecosystem."

    Who gives a ---- about this - review the app, or don't. The app is the app. Don't penalize it for being available on an iOS device just because you don't like Apple's "restrictive ecosystem." So restrictive that 200,000+ apps just appeared out of thin air?

    I'd say this is a cheap shot and lame excuse not to post a page about the app.

    Otherwise, this is a great article. I'm just calling you on this one issue. So there.
  • valkator - Thursday, November 1, 2012 - link

    Sweet, I can hook up all my devices to this unit and it can be my dogs water bowl. :)

    ^ Joke

Log in

Don't have an account? Sign up now