Ubiquiti Unifi Binding Feature Discussion

That item should be a Switch not a Contact :wink:

Edit: Please see the latest README

Thanks, Matthew, that did it!

I figured it out!

For all of you stuck on 2.4, you can run the latest binding code (minus the 2.5 specific “trust” bits) by installing build #10 of the 2.4 specific branch.

openhab> bundle:list |  grep -i unifi
235 | Active   |  80 | 2.5.0.201904201456     | UniFi Binding

Don’t worry that the file name and binding version contain 2.5.0 - I’ve successfully tested this in a clean instance of 2.4.

Edit: see my post below

1 Like

Hey Matthew,
I get this error on 2.4 on syno with build #10:

2019-04-21 09:22:10.842 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/volume1/public/openHAB/addons/org.openhab.binding.unifi-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.unifi [282]
  Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="2.4.0"; osgi.identity="org.openhab.binding.unifi"; singleton:="true"

	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [10:org.apache.felix.fileinstall:3.6.4]

I seem to recall that this means there’s already a binding installed. Are you certain you uninstalled the one that was running? You can confirm if there’s already one installed by running this in the console.

list -s | grep unifi

Ok guys so I did a little reorganization on the commit history to help make maintaining two branches easier.

Now I have two builds setup in Jenkins:

openhab2-unifi-binding          - compatible with 2.4.0+
openhab2-unifi-binding-2.5      - compatible with 2.5.0.M1+

The 2.5 branch uses the OH2 internal HttpClientFactory and ExtensibleTrustManager to communicate with the UniFi controller. @Kai requested this some time ago and this will be the default after 2.5 is released.

Moving forward, I will work on the 2.4 branch and do a rebase of the 2.5 branch each time I push a new build (effectively creating two builds for each commit).

Additionally, I force incremented the build number on the 2.5 build in Jenkins so the build numbers are synchronized.

Take the last build #102 for example:

2.4.0+ (openhab2-unifi-binding in Jenkins)
org.openhab.binding.unifi-2.5.0-SNAPSHOT.jar

2.5.0.M1+ (openhab2-unifi-binding-2.5 in Jenkins)
org.openhab.binding.unifi-2.5.0-SNAPSHOT.jar

If you’re running 2.5.0.M1+, please use the 2.5 specific version to help discover any potential issues with using the OH2 internal bits for communication.

Cheers!

1 Like

Thanks Matthew!

Can the binding also handle/display the wired UnifiDevices? the Unifi Switches?
I tried to put them under wiredClient, and they do not show up

Unfortunately not yet. It’s a “device” and not a “client” as far as the controller is concerned. I’m about to setup my new UniFi network at home and will be adding support for switches soon!

2 Likes

Is there a way to detect current and “available” firmware versions? I have just logged in into my unifi web page and got the notification there that the cloud key has minor updates to its firmware.

If we have this information, I could integrate that into the nightly “please update systems X, Y and Z” notification that I send from my openHAB instance…

Hi Matt

Does your binding work on a USG Pro 4?

Cheers
Kris

Hi, I found this binding and want to use it to block and unblock clients.
But It is not working I only see the blocked and reconnect via the openhab android app
and in the log I see:

2019-04-14 21:49:10.688 [ome.event.ItemCommandEvent] - Item ‘MatthewsPhoneBlocked’ received command ON
2019-04-14 21:49:10.691 [nt.ItemStatePredictedEvent] - MatthewsPhoneBlocked predicted to become NULL

Unifi controller is version 5.10.20

Hi Nick! Welcome to the community!

What version of the binding are you running?

I think it was the last version because I installed it just now

Hi Matt

Ive been using your binding with great success but i believe its quite old now


191 x Active   x  80 x 2.3.0.201804122004     x UniFi Binding

My only complain is the Iphones take ages to display online or offline, the Android is fast so I guess its not a binding issue but more a phone issue. Has recent changes to the binding improved this by any chance?

Thanks! And great work!

I’m having the same issue : cannot block clients and status is not seen in Habpanel
OH 2.4 with binding which is available through paper UI
Unifi Controller 5.10.24-11676-1

How can I debug? :slight_smile:

Which binding version do I have to use for OH 2.3?

I tried 2.5 latest snapshot, in Paper UI I can see my “site” and a configured device as “online”:

But all items do not have any values.

Thanks & regards
John

WiFi Experience,

Has anybody wrote a rule to do a “reconnect” on devices that have a low Wifi experience on the network?

I’d like to do this maybe at night when there is a client struggling based on their value being below 40%.

Thoughts?

Best, Jay

here same issue, i’m able to connect to the controller create a Things (smartphone connected on the wifi) but in the channels i do not have the blocked / reconnect channel.

any advice in troubleshooting this?

Can the current UNIFI Binding capture device mac addresses for unknown devices? After my 2nd porch theft this week, I am wondering if I can leverage my UNIFI controller to capture strangers cell phone mac addresses when they are in range of my UNIFI WAP? This way the next time a theft happens, I can correlate the theft with my home security camera + front porch motion sensor + Openhab to send me a notification a photo, date/time and a MAC address…

I am in the progress of learning OpenHAB and have been watching tutorial videos for OpenHAB all this weekend.

I am working on setting up my UNIFI controller and OpenHAB to detect home presence of my wife and I, but this is when we are connecting to a secured network. I suppose I would need to create an OPEN wifi SSID with no routes to anywhere to get a mobile device to attempt to connect and therefore capture the MAC.

Would the UNIFI Binding be capable of doing this?

Not unless they try to log onto the Wi-Fi.

What would/could you work on for your is this.

You’d monitor for new devices, log that to m1tt and based on that, OH/other could start recording

Think it should work