Ubiquiti Unifi Binding Feature Discussion

Maybe my bundle update procedure is wrong. Try stopping and uninstalling the existing bundle and restart OH. Then do a bundle:install [url] followed by a bundle:start "UniFi Binding" and see if that helps.

What version of the controller are you running?

Actually, I believe your update procedure is fine. I can see a difference betwenn the version yesterday and the one from today. The previous one would kill the complete ā€œControlā€ tab in the Paper UI, with the one from today, I just get a broken line for the ā€œapā€ item. And, of course, the NPE stays :slight_smile:

5.4.11, running in a docker image from GitHub - goofball222/unifi: UniFi Docker Container

The docker part should have no impact on you, though, as you just fetch the json stream, right?

Also, I have a specific user configured in unifi which has only read-only permissions.

Iā€™m running the same version in Docker using the linuxserver/unifi image

2 for 2 - I do the same thing and thatā€™s the user Iā€™ve been developing / testing with.

I added more TRACE logging to dump the raw JSON content coming back from the controller. Please update to the latest and configure your userdata/etc/org.ops4j.pax.logging.cfg like so:

# UniFi logger
log4j.logger.org.openhab.binding.unifi = TRACE, unifi
log4j.additivity.org.openhab.binding.unifi = false

# File appender - unifi.log
log4j.appender.unifi=org.apache.log4j.RollingFileAppender
log4j.appender.unifi.layout=org.apache.log4j.PatternLayout
log4j.appender.unifi.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%-26.26c{1}] - %m%n
log4j.appender.unifi.file=${openhab.logdir}/unifi.log
log4j.appender.unifi.append=true
log4j.appender.unifi.maxFileSize=10MB
log4j.appender.unifi.maxBackupIndex=10

@hakan if you donā€™t mind, please send me your unifi.log file via PM - itā€™s really bugging me why this is not working for you.


Binding URL: org.openhab.binding.unifi-2.1.0-SNAPSHOT.jar
Latest Version: 2.1.0.201704091438

Should this work with the Cloud Key or does it only work with the controller software?

@roryd I donā€™t see why it wouldnā€™t as the cloud key is just an embedded platform running what I believe is the same controller software. Are you having issues getting the latest binding working?

Hi Matthew,

I havenā€™t been able to get the things to show as online. Iā€™ve set up the things, items and sitemap files and also set up the unifi.log but although the items appear in the log file, none of them seem to be seen as attached to the network. Iā€™m using the 1438 binding version from today, but I still canā€™t get it to work.

@roryd Did you enable TRACE level logging as shown here? If so, do you see JSON output in the unifi.log file? If you donā€™t mind sharing, Iā€™d be happy to look through your log. You can send it via PM and please include your unifi.things and unifi.items definitions.

Without seeing the log file Iā€™m afraid thereā€™s not much more I can do to help you.

@mgbowman yes, I can see the JSON data alright. Iā€™ll PM you the others.

@hakan Update and try again - I think weā€™ve solved your issue.


Binding URL: org.openhab.binding.unifi-2.1.0-SNAPSHOT.jar
Latest Version: 2.1.0.201704101035

Works much better now :smile:

I have one device without a host name in my network (ā€œnetatmoā€) which shows the MAC of my AP as ā€œAccess Pointā€ information, and the NullPointerException from the mqtt log is fixed too.

My other device (my phone) is not in the network right now, and all data for it is shown as ā€œ-ā€ in the Paper UI. I will see what happens when I get home tonight.

1 Like

After updating to todays version Iā€™m getting JSON data aswel, and I get 20 clients found (I also have a unifi switch).
But the mac addresses I configured as things are not found, even though I can see them in the /sta JSON output.

I tried to specify the site, or leave it empty, but the result stays the same.

A cool addition would be to add the found clients to the inbox on the paperui?

This would be the ā€œDiscoveryā€ functionality :wink:

I could always try and discover https://ubnt:ubnt@unifi:8443 since thatā€™s the default :smile:
I highly doubt anyone using OH would ever leave it open like that ā€¦ but you never know.

No, donā€™t try to discover the controller, we should configure that using the configure button on the binding ;), but after that discover the wired and wireless clients.

Yeah @roryd is having the same problem and Iā€™m trying to help him figure it out.

With DEBUG logging on, do you get any output on the lines after Found x UniFi Client(s) like so:

2017-04-10 20:30:27.101 [DEBUG] [unifi.internal.UniFiController:231  ] - Found 10 UniFi Client(s):
2017-04-10 20:30:27.102 [DEBUG] [unifi.internal.UniFiController:234  ] -   hostname = ..., mac = ..., essid = ..., rssi = ..., ap = ...
2017-04-10 20:30:27.102 [DEBUG] [unifi.internal.UniFiController:234  ] -   hostname = ..., mac = ..., essid = ..., rssi = ..., ap = ...
2017-04-10 20:30:27.102 [DEBUG] [unifi.internal.UniFiController:234  ] -   hostname = ..., mac = ..., essid = ..., rssi = ..., ap = ...
<...snip...>

Binding URL: org.openhab.binding.unifi-2.1.0-SNAPSHOT.jar
Latest Version: 2.1.0.201704101542

This could work.

For now, letā€™s figure out why you and @roryd arenā€™t seeing any updates while @hakan and I are :confused:

@roryd and @l_grave please update and try again.

I believe it comes down to you two having wired clients and all my work has been under the assumption of wireless clients. Iā€™m getting a USW-8 at the office soon so Iā€™ll be able to better support both wired and wireless clients in the future.


UniFi Binding v2.1.0.201704101808 : org.openhab.binding.unifi-2.1.0-SNAPSHOT.jar

Hi Matthew,

Success! I can now see all the item data for each thing! Thanks @mgbowman :grinning:

I can DM you my JSON output, would it help?

@l_grave have you tried version 2.1.0.201704101808 yet? I think it will fix your issue.

If it doesnā€™t, Iā€™ll PM you the easiest way to share your JSON log with me.