Ubiquiti Unifi Binding Feature Discussion

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:

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:]

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

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

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.

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?

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.

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:

jackson-annotations-<version>.jar
jackson-core-<version>.jar
jackson-databind-<version>.jar

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.

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.

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:

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.

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ā€¦

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 ā€˜-ā€™

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

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.

This is from the BasicUi

Seems to be working nowā€¦ I just had to update to the latest version :face_with_raised_eyebrow:

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.

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!

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.