Taking Advantage of the Open Platform

Some of the interesting aspects that can be controlled via SSH are outlined in this blog post by a UK reseller. The examples seem to be based on a older version of the firmware, and, other than the relay control, deal more with cosmetic aspects such as the LED flashing rate and colour. In the latest version (2.0.7) of the firmware, we also have tags for the outlets. The power consumption values are also updated on a more frequent basis (once per second for each outlet, compared to one outlet each second in the earlier versions). This allows for development of a real-time power consumption analyzer using the mPower units.

While reviewing the UFO Power Center, I had talked about a custom Perl script that was developed for real-time power measurement. I have been making improvements to the script (to be leaner on resources, and adding more features) over the last year. It has now been pushed out to the open source community. A similar script has been developed for the mPower units too. The source is available here. Readers should feel free to check out the scripts, add / suggest features and report / fix bugs. In our limited testing, it has worked fine on Windows 7 / Cygwin, but other platforms haven't been tested.

One feature that I would like to add to the script above is auto-discovery of mPower units in the network. Currently, the script expects the IP of the mPower unit as well as the login credentials to be supplied as command line arguments. Another interesting feature would be a configurable polling rate. The script currently polls for the power consumption values once every second.

It should be noted that the above script works only with mPower units running firmware version 2.0.7. Later versions should also work, unless Ubiquiti does away with some of the used features. Version 2.0.7 added labels for each outlet, and these are stored in /var/etc/persistent/cfg/config_file. Relay status and active power for outlet X are available in /proc/power/relayX and /proc/power/active_pwrX. relayX is writable, with a write of 1 to turn the outlet on, and 0 to turn it off. active_pwrX (as well as v_rmsX, i_rmsX and pfX under /proc/power) report values accurate up to 9 decimal places.

One of the downside of the mPower is the fact that any power consumption below 1W is reported as 0. Unfortunately, this is the intent of the design. Ubiquiti indicates that they found too many issues with AC power systems (noise, inductive loads etc.) to provide enough accuracy at power levels below 1W. Pulling down sub-1W power values to 0 also simplifies rules (particularly, to ensure that rules based on non-zero power don't trigger when nothing is connected and there is leakage current).

Inside the mPower Concluding Remarks
Comments Locked

61 Comments

View All Comments

  • dac7nco - Friday, November 22, 2013 - link

    Oh; these UPS systems manage a fair job of power consumation; it's why they sell so well. 2,500+ 4/5/9U UPS had better be measuring it's own power! Most of these will tell you re: power-draw from their peripheral AC ports. Things like printers should be on non-UPS AC ports; I have a (small) 12U rack, with a 4U desktop, a 2U Co-processor for offline jobs, a 4U storage/NAS system and a 2U cyberpower 1,650-Watt UPS. This Cyberpower UPS will run these things for about 2-hours.
  • ganeshts - Friday, November 22, 2013 - link

    Can you link me to this exact Cyberpower model which can tell the power draw on the peripheral AC ports ?
  • dac7nco - Friday, November 22, 2013 - link

    http://www.cyberpowersystems.com/products/ups-syst...
  • dac7nco - Friday, November 22, 2013 - link

    http://cdn4.tinkertry.com/wp-content/uploads/2012/...
  • Jaybus - Tuesday, November 26, 2013 - link

    These UPSs monitor individual outlets and can be controlled via Ethernet, serial, or USB, but afaik they cannot switch individual outlets. They power on or off all outlets simultaneously. To get individually switched outlets requires a switched PDU, which is substantially more cost. The mPower can work as a much cheaper PDU.
  • processinfo - Friday, November 22, 2013 - link

    How much power it is using by itself?
  • ganeshts - Sunday, November 24, 2013 - link

    Around 1 W with things at idle, but the network interface up.
  • CBRworm - Friday, November 22, 2013 - link

    I think devices like this are great, certainly an emerging market which I appreciate being reviewed. I have been using ubiquiti devices for many years and have found them to be mostly solid hardware with software that may be lacking.

    I would like to get my hands on a few of these to play with, currently I also use Kill-A-Watts to measure power consumption and the only power control devices are things I hacked together being driven through a parallel port. These devices would be great for me to turn off devices in other areas of the house - like the upstairs TV and/or Xbox at dinner/bed time. Christmas lights and other lights around the house would also be good. I love being able to turn the thermostats up and down from my phone - this would be a great extension of that.

    As for the UPS's. The batteries for my UPS's are in line with the cost of the Pro device. While the UPS is useful for helping with some management features on computer hardware, 90% of the uses for this device would not be well suited by a UPS with management packages.
  • mhammett - Friday, November 22, 2013 - link

    A couple things...

    1) UBNT's history has not been the enterprise space, but in the service provider market. The bulk of their revenue still comes from service providers.

    2) The mFi line is targeted towards building automation, not standard consumer home automation.

    3) mFi is a whole line of products, not just this device. That said, they still don't have the devices that I am looking for.

    4) I don't know if you can run the devices without the controller software, but why would you want to? The software is the best part of the whole thing. You have dozens of these devices and have scripts on the server that read the data that the system collects and can make decisions based upon them.

    5) I was a beta tester for mFi, though I don't have a history with building automation systems. In my testing, it has been a good system. It will be a great system when they release the deices I asked for. ;-)
  • ganeshts - Friday, November 22, 2013 - link

    Thanks for your thoughts. Can you let me know what devices you are looking for? I am pretty sure a mFi Thermostat would be well received.. Just wondering what else people want out there.

    Yes, you can run the devices without the controller software. For our usecase, we don't want the hassle of running a VM or server hosting the mFi controller -- just need the ability to turn on and off an outlet and do real-time power measurement on the outlets. Yes, if you need the rules, you should use the mFi controller -- but, if they are simple, they could be handled by scripts running on a PC or even on the mPower itself (in certain cases).

Log in

Don't have an account? Sign up now