Got my Ubiquiti mPower plug today. First i was a bit disapointed because i couldn't access any webpage on the plug like they showed in blogs, but it turned out it had a really old firmware (1.2.6)
I upgraded the firmware over SSH, with this tutorial:
http://www.fhemwiki.de/wiki/Ubiquit_mFi ... r_Firmware
Be careful to take the time for it, i waited around 5 minutes. You don't want to brick the device. When done, it has firmware 2.18 and after logging in (ubnt/ubnt) i could see the power consumption of the load on the internal webserver + turn it on/off
Now i can see the usage in the webinterface (https://IP_OF_PLUG/power)
and also access the JSON output at: https://IP_OF_PLUG/sensors
Code: Select all
{
"sensors": [
{
"port": 1,
"output": 1,
"power": 45.691894292,
"enabled": 0,
"current": 0.199029862,
"voltage": 230.170126676,
"powerfactor": 0.997405968,
"relay": 1,
"lock": 0,
"thismonth": 0
}
],
"status": "success"
}
(Valid JSON according to
http://jsonlint.com/)
I also need a way to kill the watchdog, the plug does a kind of restart or so every few minutes, because it can't reach the controller software. You can see this when having a ping running constantly to the device.
There was some way to work around this, i thought it was something like connecting to the controller, then shutting down controller software. Will take a look at this later.
But the measurements seems very promising, look at that accuracy behind the comma!
I used the code from here:
http://piatwork.blogspot.nl/2015/07/blog-post.html and adapted it, so it sends its data to Domoticz:
You can find my code here:
http://pastebin.com/9pNShAeg
I will later have a look on how to add the consumption data (kWh) to Domoticz, i'm not sure how to do that, ideas are welcome. The JSON only contains a 'thismonth' value, i'm not sure how to translate that to a Domoticz understandable reading.