Cleaned up my OH2 Snapshot 743 system from the old 1.x mPower binding
performed in Karaf console: config:delete org.openhab.mpower
removed the old org.openhab.binding.mpower-1.9.0-SNAPSHOT.jar file from /usr/share/openhab2/addons/
removed all mPower related items from my setup
Downloaded the org.openhab.binding.mpower-2.0.01-SNAPSHOT.jar file to /usr/share/openhab2/addons/ (changed also file ownership to openhab:openhab)
Startup OH2 and check Karaf console for the new Binding:
openhab> bundle:list | grep mPower
207 | Active | 80 | 2.0.01.201701202009 | mPower Binding
openhab > feature:list | grep mPower
no result :)
openhab > log:set TRACE org.openhab.binding.mpower
And TADA !!!
2017-01-20 22:56:45.950 [DEBUG] [rnal.discovery.MpowerBridgeDiscovery] - Manufacturer matched: search: Ubiquiti Networks, device value: Ubiquiti Networks.
2017-01-20 22:56:45.952 [InboxAddedEvent ] - Discovery Result with UID 'mpower:mpower:24_A4_3C_87_61_EA' has been added.
2017-01-20 22:56:45.955 [InboxAddedEvent ] - Discovery Result with UID 'mpower:mpower:04_18_D6_54_1B_B7' has been added.
2017-01-20 22:56:45.956 [InboxAddedEvent ] - Discovery Result with UID 'mpower:mpower:24_A4_3C_87_61_D3' has been added.
2017-01-20 22:56:45.957 [InboxAddedEvent ] - Discovery Result with UID 'mpower:mpower:04_18_D6_59_FD_EA' has been added.
Optimized for a good balance: Don’t spam OH with too many updates. vs. Don’t bother the mPower with too many value reading requests.
If you switch a socket, after 3 seconds an update will be forced. This gives a nice feedback in the UI.
If a socket is turned off, basically no updates are pushed to Openhab. (you can see this by watching the “Last Update” channel.)
If a socket is turned on, its updated every x seconds (as configured in the bridge/mPower). Even here there might be an older “Last Update” value e.g. your device consumes a steady “Power” of 3 Watts, the “Voltage” stays steady at 230V, the “Energy Consumption” is climbing slowly only.
The minimum refresh is 10.000 ms. Default is 20.000 ms.
sockets are now marked offline as soon as the mpower gets offline.
If I define my things via Paper UI, all works ok (if I remember well… i will double check). This is not important, since if you are working with manual definitions, you won’t be able to modify the thing config parameters from the UIs anyway, so it’s ok.
Thanks much for your work!
In my case I found that my devices wouldn’t work with logs showing "auth failed"
After some tinkering it turned out that an exclamation mark (!) in my password prevented it from working.
I changed my password to a-z 9-0 password and it works well now.
I tried but I could not reproduce the issue with the “!” in a password.
I tried both: manually defined in things file but also discovered mPower. I used the password “ubnt!123”. Works fine. Can you give more details/screenshots please?
I think I spoke too soon, I’m still tinkering and the only combination that worked for me was ubnt:ubnt
I then changed my login to admin and password to alphanumeric string and still had “Auth Failed” show up in logs. I will try to reproduce it today and send you logs with screenshots. I will also try login ubnt with a changed password and see if it’s a login name problem.
Tested the new mPower binding version 2.0.02 on 3 different systems:
Main System 1: Laptop with Debian Jessie (my main system) running OH2 Snapshot #752
Test System 2: Laptop with Windows 10 x64 PC running OH2 2.0.0 Stable Release
Test System 3: Raspberry Pi 3 with Raspbian Jessie running OH2 2.0.0 Stable Release
All systems work perfectly and multiple tests were run with successful results.
I also like that if I lock one of the outlets in the mfi controller suite (put it in monitoring mode only), I cannot switch it off from OH2 (this works as I expected)
so the idea would be to configure the “socket” thing with an additional property: lock = true/false.
At some point (maybe once I first try to switch it OFF) the “lock” will be actively set by the binding.