Ubiquiti Unifi Binding Feature Discussion

Tags: #<Tag:0x00007f5c84caa048> #<Tag:0x00007f5c84ca9f08>

(Martin Eskildsen) #222

You can download the jar and just put it in your addon folder, then it will load. Whenever it becomes part of openHAB it can be installed via PaperUI - at that time you should remove it form addons folder :slight_smile:

(Rohnny Swennen) #223

I tried installing through addons folder but get following error

2017-09-10 10:25:51.416 [ERROR] [org.openhab.binding.unifi ] - FrameworkEvent ERROR - org.openhab.binding.unifi
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.unifi [236]
Unresolved requirement: Import-Package: com.fasterxml.jackson.annotation
at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

(Martin Eskildsen) #224

Is it only one ir everytime you start openHAB ? It should install prerequisites by it self. But it can tale some time. Is the computer attached to internet?
Eventually you could start oh from commandline eg. Karaf console

(Kim Andersen) #225

Hej Martin.
Thats exactly what I have done. But yet the binding is not showen in PaperUI. That why I asked :slight_smile:

(Rohnny Swennen) #226

Kim, you need to add unifi to your addons config file as well (also check your log files, in my case it didn’t work because of errors). Will do additional checks as Martin suggested later but you might have same issue.

(Martin Eskildsen) #227

The Binding won’t show up in PaperUI in the list of insatllable bindings, before it is part of openHAB.
To me it looks like one prerequisite isn’t installed as expected:

Unresolved requirement: Import-Package: com.fasterxml.jackson.annotation
at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

I don’t see this in my setup, so I expect i got the jar installed by some other binding. Which bindings do you have installed else?

(Kim Andersen) #228

I have the Hue binding, z-wave binding and the IHC binding installed. Thats it.

rswennen - I dont know what addons config you´re talking about? In the installations there wasn´t even an addons folder at all. I had to create it myself.

(marcel_erkel) #229

If the binding can’t resolve the com.faster.xml.jackson.* jars then you will need to manually copy them into the /usr/share/openhab2/addons directory (the same directory where you copied the org.openhab.binding.unifi-2.1.0-SNAPSHOT.jar to). You will need the following three jars:


I am using version 2.4.5 of these jars. You can do a find on your system, they may already be on there. If not, then you can download them from the Maven repository.

(Kim Andersen) #230

I think you´re correct, Marcel… For the first time I get an respons in the log file, (I just did a system update and upgrade)… This is what it looks like:

2017-09-11 21:20:52.746 [ERROR] [org.openhab.binding.unifi ] - FrameworkEvent ERROR - org.openhab.binding.unifi
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.unifi [204]
Unresolved requirement: Import-Package: com.fasterxml.jackson.annotation

I´m no good at this openhab/openhabian/linux-like stuff. But I´ll give it a try.

(Kim Andersen) #231

downloaded the above jar´s Marcel mentioned. Placed them in the addons folder… Rebooted the Rpi.
Still no go. Can´t even tell if the jackson jar´s have been resolved. Log doesn´t show anything about this part as well as nothing about the unifi binding :frowning:

(Kim Andersen) #232

For some reason it´s working now… I think… I See the unifi binding in Paper Ui, under configurations/bindings…
Now I need to know how the heck to configure it… Can´t seem to do anything with it… I´ll keep on trying.

(Martin Eskildsen) #233

Seems as you have some kind of success.

Go to Inbox and select ‘+’ to manually add Unifi Controller, I don’t remeber if the WifiClients is discovered automatically, but I gues they are…

(Kim Andersen) #234

I am in a somekind of success… I did the config manually with items, sitemap… Everything seems to work, except, it wont tell my mobile online status…
I do get the site, AP, ESSID and RSSI. But thats all. It also discover, when I change ESSID (I have two ESSID´s here, one for 5ghz and one for 2.4ghz).

I used the default examples from to docs (mgbowman´s examples). I get errors in the MAP, probably because it´s not responding with an OPEN or CLOSE, but insted an “-” which the MAP can´t translate, ofcouse.

This is the log:
2017-09-11 23:51:53.385 [WARN ] [rm.AbstractFileTransformationService] - Could not transform ‘-’ with the file ‘unifi.map’ : Target value not found in map for ‘-’

(Martin Eskildsen) #235

Please notice that the ONLINE status channel recently has changed from Switch to Contact (Seems that you are aware of this.
Also check to log file event.log to see if any events is logged from the binding

(Kim Andersen) #236

This is from the event log
2017-09-12 00:03:30.721 [ItemStateChangedEvent ] - kimsPhoneRSSI changed from 18 to 15
2017-09-12 00:03:40.693 [ItemStateChangedEvent ] - kimsPhoneRSSI changed from 15 to 16
2017-09-12 00:04:00.690 [ItemStateChangedEvent ] - kimsPhoneESSID changed from kepler 5ghz to Kepler
2017-09-12 00:04:00.697 [ItemStateChangedEvent ] - kimsPhoneRSSI changed from 16 to 22
2017-09-12 00:04:10.703 [ItemStateChangedEvent ] - kimsPhoneRSSI changed from 22 to 24
2017-09-12 00:04:40.716 [ItemStateChangedEvent ] - kimsPhoneRSSI changed from 26 to 28
2017-09-12 00:04:50.723 [ItemStateChangedEvent ] - kimsPhoneRSSI changed from 28 to 29
2017-09-12 00:05:20.695 [ItemStateChangedEvent ] - kimsPhoneESSID changed from Kepler to kepler 5ghz
2017-09-12 00:05:20.702 [ItemStateChangedEvent ] - kimsPhoneRSSI changed from 29 to 27

But going offline/online make no entry in the log.

(Kim Andersen) #237

This is from the BasicUi

(Kim Andersen) #238

Seems to be working now… I just had to update to the latest version :face_with_raised_eyebrow:

(Kim Andersen) #239

How long does it take from I turn off wifi on my mobile, until the binding discover it? I tried several minutes (3-4 minutes) last night, but I were still at “Home”. Even tried to switch off the mobile. Still the same…
In short - I have not seen it “Away” yet.

(Matthew) #240

Hi Kim,

Glad to see you managed to get everything working. The issue with a client going offline is a “feature” of the UniFi controller - I’ve seen it take anywhere from 2 minutes up to 10 minutes - there’s really no pattern.

If you read some of the previous discussion here, I’m working on implementing a timeout to “fix” this such that we have more granular control of when the binding marks a client as away.

Haven’t had much free time lately but my schedule is open these next few nights. Hopefully I’ll have something soon.

Stay tuned!

(Kim Andersen) #241

Yeah, I did read something about the time before marked as “away”, but I didn´t notice that close enough cause I was struggling getting the binding to work. When I finally got it to work, I had forgotten all about the “away” time :wink:

This is a challenged missing “feature” with WiFi in general, as there is no obvious “check-out” feature. “Check-in” shouldn´t be a problem. You just have to come up with a new WiFi standard, with build-in “check-out” feature, and it will solve everything :grin:

As for an “fix”. Maybe you could use the “Last seen” ? If the “last seen” has not been updated within an minute or two, thats probably because the item is “away” in some way? Or perhaps the “uptime”? One or two minutes is stil alot of time not knowing if an item is connected or not, specially if anyone thinking about combine this present state with other things, such as switching on/off house alarm etc… But it´s better than <10 minutes, and give a fixed pattern.