[Discontinued] OH2 Ubiquiti Networks mPower binding

This lock parameter could be a socket property that prevents the user from changing the state of the outlet item that is linked to the respective channel.

On the other hand… maybe we are going into too much detail and this feature is not really needed… :slight_smile: Up to you.

By the way: Since OH2 Snapshot releases are now numbered 2.1.x, maybe you should update your mPower binding version number to 2.1.02 :sunglasses:

@magcode thanks a lot, your binding works great. I was looking for a Greenwave 6-node zwave power bar since some time for my network rack, but somehow it seems they canceled this product… Thanks to your binding I did not only find a perfect integration into openhab, but also a replacement product :slight_smile:

2 Likes

created PR https://github.com/openhab/openhab2-addons/pull/1901

1 Like

Pinging @magcode :slight_smile:
The binding works without any hiccups on my OH2 installation.
I saw that your PR has some comments :stuck_out_tongue:

Thanks. Working on the PR.

1 Like

Currently running org.openhab.binding.mpower 2.0.02.201701242116 on 3 systems (2 test and 1 prod) with openHAB2 (2.0.0 Stable, 2.1.0 Stable, 2.2.0 Snapshot #988)

Binding works as expected. No problems at all.

Thanks @Dim for testing the binding on recent OH versions. Very much appreciated. Unfortunately I need to stop my contribution. I consider making the binding available on my github account.

1 Like

For whoever wants to continue the great contribution of @magcode for this mPower binding:

Starting with openHAB 2.2 Snapshot #1002 (that included many ESH updates), I get the following warning in the log for this binding:

2017-08-04 22:36:08.350 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mPower.things'
2017-08-04 22:36:17.017 [WARN ] [.core.thing.binding.BaseThingHandler] - BaseThingHandler.initialize() will be removed soon, ThingStatus can be set manually via updateStatus(ThingStatus.ONLINE)

I think that it has to do with this part of the code: Line 26 (maybe I should have opened an issue on github)

Binding works fine by the way :slight_smile:

No worries, I will fix this latest once I’m on OH2.2. Currently I’m migrating to OH2.1.
I just don’t have the time to make this binding an official part of OH.

1 Like

Hi,

first of all, thx again for the binding… Almost works like a charm. Only issue I have is the following minor one:

Due to a hardware defect I had to replace my power bar - The new one was autodiscovered as I remember and works fine. However I still have the old things in openhab and cant remove them. When I select those things in paper UI and “remove” them they are shown as “removing”, but never disappear. Furthermore openhab log keeps displaying the following lines every 20 second (no matter if I tried to remove the things or not):

2017-08-22 19:01:01.952 [WARN ] [binding.mpower.handler.MpowerHandler] - Missing socket number. Ignoring.
2017-08-22 19:01:01.953 [WARN ] [binding.mpower.handler.MpowerHandler] - Missing socket number. Ignoring.
2017-08-22 19:01:01.953 [WARN ] [binding.mpower.handler.MpowerHandler] - Missing socket number. Ignoring.
2017-08-22 19:01:01.953 [WARN ] [binding.mpower.handler.MpowerHandler] - Missing socket number. Ignoring.
2017-08-22 19:01:01.953 [WARN ] [binding.mpower.handler.MpowerHandler] - Missing socket number. Ignoring.
2017-08-22 19:01:01.953 [WARN ] [binding.mpower.handler.MpowerHandler] - Missing socket number. Ignoring.

the “mpower:mpower” thing as such seems gone (perhaps I deleted them in the wrong sequence ?), but the ‘mpower:socket’ ones stay…

Any way to get rid of this old stuff ?

Thanks,
Max

How did you define them in the first place?
Using *.things and *.items files or via the PaperUI Simple Mode for Item Linking?

It seems that you used PaperUI, so you should have followed another sequence to clear your OH2 system from the old info.
First, you delete the links from the channels, then delete the Items, then delete the Things.

Since you removed the Thing first, you are left with orphan links and items in your system.
To remove those, you could use the openHAB console and:

smarthome:links list |grep -i mpower

This command will show you the links between the Items and the Channels of the Things.
You can delete the links with smarthome:links removeChannelLink <itemName> <thingUID>
Then, you can also delete the old Items with: smarthome:items remove <itemName>

Thanks @Dim for helping out. @Max1968 let me know if this solves your issue. If not I can try to reproduce. What is your Openhab version?

Btw seems that Amazon (Germany at least) has a great offer of MPOWER EU MINI https://www.amazon.de/dp/B00LNF53TY EUR 24,19 :open_mouth:

1 Like

Thanks - I did something very stupid and now my openhab doesnt start anymore, unfortunately I’m remote from home. I will check over the weekend, and provide feedback here.

thanks, this solved the issue with my orphaned things. I’m having an issue now that the replacement mpower device is not initializing anymore, but this seems to be another issue caused by some mistake I made as zwave and plugwise are not initializing correctly anymore as well. By chance I deleted my “runtime” folder and dont have a backup…

just as a note - i didnt create any things/items manually, just used autodiscover from paper UI… and I think i didnt even link the channels manually, this was done automatically.

Is there any way to make the binding scan a different subnet for devices? Currently it only scans the same subnet as the openhab server.

Is there any way to make the binding scan a different subnet for devices? Currently it only scans the same subnet as the openhab server.

No. I don’t think so. The implementation is just using a service provided by Openhab Core/Eclipse Smarthome/jupnp

Is this plugin dead now? Looks like the github repo has been removed?

Yes, the original repo is now closed.
The jar still works. I can provide a download link if you want.
Development has been frozen/stopped from @magcode
He made a big effort to get it merged into the distribution but it didn’t work out

check:

  1. https://github.com/openhab/openhab2-addons/pull/1901
  2. https://github.com/openhab/openhab2-addons/tree/d3e05ab9a674d1f19cb375bca91a20e9bd6293a5/addons/binding/org.openhab.binding.mpower

Indeed. It is dead/down/discontinued. I was not able to fulfill the quality requirements of this project.
I suggest to use https://github.com/magcode/mpower-tools/tree/master/mqtt/client as a replacement. This is what I use for my 7 mpower devices at home now.

My goal would be to make this solution compatible with Homie so that one can use this upcoming binding: https://github.com/homieiot/convention/issues/85

1 Like

It’s great!
Finally I got rid of that BaseThingHandler.initialize() will be removed soon log entry :slight_smile:

Switched over to mPower tools and it works fine :slight_smile:
Great stuff @magcode !

(the only thing that I am missing is the lastupdate… but to be honest… I never used it :stuck_out_tongue: )