Ubiquiti Unifi Binding Feature Discussion

The above WARN message is not unique to this binding. I’ve seen it before with other bindings in the addons folder after a clean install and/or upgrade. It seems that the bindings in the addons folder get activated before all the dependencies are available.

Once the binding is merged into the build, and can be installed using Paper UI or added to conf/services/addons.cfg, I believe the above WARN message should go away.

1 Like

@mgbowman I’m still having the jackson.core dependency issue. I tried wgetting them in the addons folder but it doesn’t help.

I guess everyone has an addon installed which also installs the jackson.core library, but I don’t have it.
It should be easily reproducible using a clean OpenHAB 2.1 install and trying to add the Unifi Binding.

just fyi: I just uped the Unifi controller from 5.4.16 to 5.4.18 and all is good
Running on OH 2.2.0 Snapshot #978 with 2.1.0.201706081307 org.openhab.binding.unifi (shouldn’t this go to 2.2.0.x snapshot versioning also? :slight_smile:)

Another data point: with Unifi 5.5.11 and OH 2.2.0 Build #977, the binding works fine too.

But yes, the binding should be rebased against the master (and then force pushed), then we will get a 2.2.0-compliant version. Not that there are many changes in the core since the 2.1.0-RELEASE…

1 Like

The 5.5 series is now the officially released version
https://community.ubnt.com/t5/UniFi-Updates-Blog/UniFi-5-5-19-Stable-has-been-released/ba-p/1980967

2 Likes

Nice, time to upgrade then… Maybe now I can set up a proper VPN to my home :smile:

IMHO this would also be the perfect opportunity to change the Online channel from a switch item to a contact item.

I managed to fix the dependency thing using the console by going through the following steps:

bundle:install https://jenkins.otr.mx/job/openhab2-unifi-binding/lastSuccessfulBuild/artifact/addons/binding/org.openhab.binding.unifi/target/org.openhab.binding.unifi-2.1.0-SNAPSHOT.jar
bundle:install http://central.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.8.8/jackson-core-2.8.8.jar
bundle:install http://central.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.8.8/jackson-annotations-2.8.8.jar
bundle:install http://central.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.8.8.1/jackson-databind-2.8.8.1.jar
bundle:start "UniFi Binding"

But now I added the controller but I get communication errors:
When it calls: https://myunificontroller:8443/api/s/null/stat/device
I see it logs in fine, and discovers that I have a default site, but that the path is null and then calls the above adres which gives this if I call it using my own browser:

{ "data" : [ ] , "meta" : { "msg" : "api.err.NoSiteContext" , "rc" : "error"}}

Looking at what the controller’s web interface does, I see that it calls https://myunificontroller:8443/api/s/default/stat/device which does work.

I used to have a 5.4.11 controller, but also after an update to 5.5.19 I keep getting the same message.

Anybody else had this? It looks like it mixes up the variables that make up the url.

I have to double check but I don’t think that I see this error.

By the way, on OH 2.2.0 Snapshot # 985, the jackson stuff version included/used are:

openhab> list -s |grep -i jac
181 | Active   |  80 | 2.4.5                  | Jackson-annotations                                    | com.fasterxml.jackson.core.jackson-annotations
182 | Active   |  80 | 2.4.5                  | Jackson-core                                           | com.fasterxml.jackson.core.jackson-core
183 | Active   |  80 | 2.4.5                  | jackson-databind                                       | com.fasterxml.jackson.core.jackson-databind
184 | Active   |  80 | 2.4.5                  | Jackson-dataformat-YAML                                | com.fasterxml.jackson.dataformat.jackson-dataformat-yaml

I got the versions from a post in a bug report (the thread is in the related section of this thread)

I’ve being going through the code of the binding. And it looks like the path property of a site is never set. The response to get the sites doesn’t contain a path element in the json either. So the weird thing is, how does this binding work for anybody? This this path property is used to make up the url’s to get devices.

Are you guys using the latest build (from the url in my previous post)? Or the pre-release from github?

I use the same as you (build #29 = lastSuccessfulBuild):

openhab> list -s |grep -i unifi
176 | Active   |  80 | 2.1.0.201706081307     | UniFi Binding                                          | org.openhab.binding.unifi

I downloaded it from:

https://jenkins.otr.mx/job/openhab2-unifi-binding/29/artifact/addons/binding/org.openhab.binding.unifi/target/org.openhab.binding.unifi-2.1.0-SNAPSHOT.jar

My controller is still on 5.4.18 (I will upgrade soon to 5.5.x)

I think that this reminds me of something that I saw in the past… I will put the binding in TRACE, look at the logs and report back.

Any update to this binding? *I’m on the 2.1-SNAPSHOT.jar. I was hoping to use it. I notice it’s still trying to access https://mycontroller:8443/api/s/null/stat/device

Hello @mgbowman thanks for your work! Is there progress on wrapping up and starting the PR process it would be great to include it.

Hi @martinvw, I’ve been away for the last month now I’m finally back home. I will try and find some free time this coming week. There’s 2 things I want to do before I squash and rebase:

  1. Look into the **null** issue @psyciknz is experiencing
  2. Change the online channel to a Contact (instead of a Switch as it’s read-only)

I will make these changes and post a new build (with a 2.2.0-SNAPSHOT version) to see if we can get this in OH 2.2.

Will keep everybody posted.

4 Likes

I’m interested in testing this. How do I proceed?

Download the latest *.jar file from: https://jenkins.otr.mx/job/openhab2-unifi-binding/
Place it in your $OPENHAB_RUNTIME/addons folder (in Linux apt: /usr/share/openhab2/addons/)
Use discovery in PaperUI or manually define your things and items (see this thread for example configs)

edit: forgot the link to the UniFi Binding Readme for config info :slight_smile:

4 Likes

Thanks for the quick response. I’ll be on it tonight!

1 Like

Just got this setup and it is working for me with openhab 2.1.0 stable and unifi controller 5.4.9

Thanks for creating this binding!

Installed, though manually, got it working. Binding works like a charm.

My next goal is to use the Things in the Experimental Rule engine in Paper UI. Can someone pass me a sample or a link to a sample.

1 Like

Just installed and configured this binding - so far so good. Thanks Matthew for putting it together!