Ubiquiti Unifi Binding Feature Discussion

Hello again,

now that I have the presence part working, I’m already starting with a feature request :slight_smile:
It would be great if one could not only read info about clients, but also do changes in the controller. I would like to enable and disable the guest network.

Cheers
Alex

See post above yours: the binding cannot reach the controller.

  • Is the IP and port set up correctly?
  • Can you reach that IP:port from the system where Openhab is installed (use telnet, netcat, or socat from the command line)
1 Like

Hi :slight_smile:

I’ve just installed my first Ubiquiti access point, and would like to start playing with the binding. I’m running 2.4.0 build 1314 and can’t find it in the list of bindings. What do I need to do to get it installed and start playing?

Cheers!

download the jar from here: https://jenkins.otr.mx/job/openhab2-unifi-binding-v2/
and deploy it in the addons folder

1 Like

Thanks - copied it to my addons folder and within a couple of minutes had all my mobile devices set up - and presence detection working the best it ever has! No more network binding for me!

1 Like

@mgbowman

Several times I’ve seen this in my logs.

2018-07-24 13:48:12.671 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler UniFiControllerThingHandler tried updating the thing status although the handler was already disposed.
2018-07-24 13:48:23.672 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler UniFiControllerThingHandler tried updating the thing status although the handler was already disposed.
2018-07-24 13:48:34.672 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler UniFiControllerThingHandler tried updating the thing status although the handler was already disposed.
2018-07-24 13:48:45.673 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler UniFiControllerThingHandler tried updating the thing status although the handler was already disposed.

These messages begin whan openHAB is started, and continue every Refresh Interval even after stopping the binding. The only way I’ve found to resolve this is to restart openHAB.

I’m running this version of the binding, which admittedly is not the most current version. Let me know if you think this might be resolved in a more recent version.

2.3.0.201804210948

Edit: It’s coming from here in BaseThingHandler.

Same problem here with the weatherunderground binding, after the last update

@Bert Hmm. That’s interesting that you also see it with the weatherunderground binding. Did you try to stop/start the binding? Did you get the same result as I did?

@lolodomo See my post above. Have you ever seen this occur in the weatherunderground binding?

What’s really odd is that the Unifi controller handler’s dispose method is being called when OH is starting up. So, the binding must be initializing, then disposing, (then maybe initializing again?).

But the scheduled refresh job is not being canceled when the handler is disposed. Then, when the refresh job runs, it tries to update the controller Thing’s status, which generates the warning that it’s trying to update the status after the handler has been disposed.

Strange.

I wonder if there’s a race condition in the scenario where the handler is rapidly initialized, disposed, and initialized.

Hey Mark,

I’ll do my best to look into this and see if there’s anything I can do - unfortunately I’m still super busy with my own house so I can’t make any promises of when I’ll get around to this.

Will keep you posted.

Matthew

Thanks. I know you’re busy with your remodel. Hopefully, it’s going well.

In the meantime, I think I’ll put the binding into debug mode and log to it’s own file. That way if the problem happens again I’ll have better forensics about what happened.

I also should migrate to the latest version of the binding. I’ve been delinquent in switching because I’ve been too lazy to make the switch from Switch to Contact… :roll_eyes:

@mhilbush

Yes, uninstalled the binding, restarted openhab, installed the binding again.
At first I saw the right values ​​in the basic UI, but 5 minutes later nothing there??

@mgbowman A couple things I wanted to mention for when you get a minute to look at this.

  • I originally thought I might be on an older version of the binding. But after looking at my environment, I think I’m running a pretty current version. Since the version I’m running uses Switch instead of Contact, it must’ve been built against a pretty current source tree.

  • In ControllerHandler, I see that cancelRefreshJob and scheduleRefreshJob are called in initialize, and that cancelRefreshJob is called in dispose. If in fact the framework is rapidly calling initialize-dispose-initialize (just a theory on my part), is there a potential to lose the reference to refreshJob? This possibly might explain why a refresh job continues to run even after the binding is stopped.

  • The problem doesn’t always occur at startup, which would argue in favor of a timing and/or race condition.

  • I’ve enabled debug logging with the logs going to a dedicated log file. Hopefully at some point, if this happens again, I’ll have more info on what’s actually happening.

Hope this helps.

I just installed this binding after I finally got my Unifi controller up and running. I must say it works very well so far. I think it will be much better presence detection than the network binding.

Is it possibly to get the status of my AP on OH2, i tried to link the online status of the ap but it seems not to work.

Is there a way of pulling the alerts off the unifi controller using this binding?

@Peter_van_hanegem,@psyciknz - unfortunately the answer to both of your questions is no :frowning:

I’m still busy with my house, but I promise after it’s all done, I’m going to give this binding some polishing using all your suggestions as possible improvements.

There are PoE improvements that I have to implement for my own personal WAF.

I promise I haven’t disappeared and I have every intention on picking back up where I left off when I can.

Happy Automating!

Matthew

2 Likes

I did look at dipping my toes into the homekit binding, but that might be above me…but this one inmight be able to sink my teeth into…

Thanks for answering, its not really a big thing, if it works cool, if it does not, also cool.

The strangest thing is, i had a crash 2 weeks ago and had to install all again, before i could add an AP as an item and it openhab could read the status.

Well, let us now if you have figured something out to make it work. Good luck on the house

@mgbowman How are things going with your house?

It’s going… should be moved in by November. The “finishings” stage is by far the most stressful.

As for the automation, I’ve finished 1 panel and have 2 more to go.

Some stats on the first panel / floor (each electrical circuit is wired directly to the panel - speakers, network, alarm and echo dots are wired to a central room in the basement):

20 Lights ON / OFF
4 Lights 0-100% Dimmable
20 Outlets ON / OFF
4 Outlets ON / OFF with current monitoring
8 Exterior Shutters
8 Sets of RGBW LED Strips / Spots
11 Exterior Door / Window Sensors (every sensor is its own alarm zone)
8 Interior Door Sensors
8 Interior Motion Sensors (every sensor is its own alarm zone)
3 Temp / Humidity Sensors (bathrooms to automate the ventilation)
8 Underfloor Heating Zones
4 AC Zones
8 Thermostats (supports Heating + Cooling in rooms with both)
5 In-Ceiling Audio Zones (probably will be Sonos)
4 In-Ceiling PoE powered Echo Dots (which are fed into the In-Ceiling speakers using a ducking mixer - I don’t use the built-in speaker)

Wife says I went overboard… I disagree :smile:

I have 2 more panels to wire, but they’re not nearly as complicated at this one was (I started with the hardest one first).

Matthew

5 Likes