UniFi binding beta [3.2.0;3.6.0]

@DrRSatzteil Is it possible to have e.g. Jetty 12 in parallel to Jetty 9 and check if it is then working?

I don’t think so since it is a dependency from core. See also here: Upgrade Karaf to 4.4.7, Xtext/Xtend 2.37.0 by holgerfriedrich Ā· Pull Request #4406 Ā· openhab/openhab-core Ā· GitHub

Yeah same issue, also saw some discussion in HA forum.
Status updates are working, control only works for a while then ā€œtimes outā€.
Enable/disable controller restore the function for me.

Hello.
In which file to change?

It’s in

bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiController.java

Thank you for your help, but unfortunately I can’t find it in Openhabian 4.2.1

No you can’t just change this file on your running system. You need to change the binding code and compile the binding yourself. If you are not a developer yourself this might be a bit complicated although there exists some excellent documentation on how to setup your development environment.

Thank you for your answer, but I’m not a programmer. Regards.

What ever happened with this bug?
I am running an UCG Ultra and the command part constantly stops working, disable/enable solves the problem temporarily.

As of now it is still there in OH5 unfortunately :pensive_face:

Was thinking of running your code periodically.
However, I can’t really make out how long it takes for the binding to ā€˜fail’.
Do you know what interval the disable / enable cycle should be triggered at?

For me it has always been exactly two hours on a UDM SE. Might be different on another appliance but this should be a good starting point.

1 Like

The token expires after 2 hours. With the help (or maybe rather as an instrument :sweat_smile:) of @Nadahar, I’ve been working on a similar problem for the Unifi Protect binding. Here’s where the progress is at for the moment: GitHub - ErikDB87/unifiprotect at http-auth-error-fix.

1 Like

Are you aware of this PR? After reading the discussion there I guess it might make more sense to join forces there than to fix issues in the seaside repo.

I think @ErikDB is mostly satisfied with how the tweaked seaside binding works now, because I haven’t heard anything about it in quite a while. But, yeah, I understand where @digitaldan is coming from when he’s starting from scratch. I think we’ve managed to get it mostly working, but there are some ā€œstructural issuesā€ that would take a lot of rewriting to deal with. It’s probably easier to just start from scratch, because it can be hard to figure out the consequences of changing some of the things that need to be changed.

When it comes to handling the token expiration and the HTTP authentication error, I think we’ve found working solutions, so if the ā€œregular UniFi bindingā€ has issues with this, a peek at @ErikDB’s fork could save some time.

It’s still on my radar, but busier times have approached… :grimacing:

But undoubtedly a fresh attempt by a much more experienced coder than myself will yield a better result.

I didn’t know this new binding was in the works.

1 Like

So yeah, i hate usurping a binding like this, i know people put a lot of time into their versions and creating a competing binding is not a good look for our community, but i really did try to make it work, but after two days, i realized most of the binding would be rewritten, which was actually more work and also would not be as clean as a new version (would always have the old structure in some ways). Before this new version, I had a number of ā€œSolutionsā€ i used for managing my unifi cameras (go2rtc, rtsptoweb, scrypted), this replaces those and adds a whole lot more… plus i am going all in on the Unifi access product line (there’s a PR for that too), where cameras are a important part for fully automated control. Plus as I mentioned in the PR, the market place version has not been touch in a very long time.

I have not been following this thread, so if there’s anything missing or concerns, i would be happy to address, just let me know. I will probably start a new topic in that case.

1 Like

FWIW, I tried looking at this elaborated project for inspiration/insight, but it went over my head, unfortunately: GitHub - hjdhjd/unifi-protect: A nearly complete implementation of the UniFi Protect API.

Maybe it might be of some use for you, @digitaldan. Or it might not add anything :wink: But I now see you’re using an official API, and not the reverse-engineerded unofficial API, which that project uses. I didn’t even know there was an official API. (I thought that only existed for other ā€˜parts’ of Unifi.)

I’d gladly act as guinea pig for your new binding.

1 Like