UniFi Protect Binding (Cloudkey gen2+, Dream Machine Pro, NVR)

The channels for smart detections has been reworked.
See GitHub - seaside1/unifiprotect: OpenHAB UniFi Protect Addon

I would suggest you remove the camera and readd it, then update the items to use the correct channels (also use the latest version of the binidng)

Best Regards, S

Change official version to openHAB 4.x.x
Market place version is updated as well.

I am using OpenHab 4.0.2 and installed the binding from the marketplace. When trying to add a new thing the page remains empty:

Restarting OpenHab and re-installing the addon did not help. Still the same. The logs are not showing any issues. Did anyone encounter that and knows what to do?

1 Like

I have the same problem

Not sure why installing the addon via marketplace is not working.
I have submitted a bug on openHAB Core. Installing the binding manually (same jar as provided by marketplace), is working.

Addon is fixed for marketplace now by renaming the jar-file.

2 Likes

For those who has experienced disconnects of events from time to time.
I have built a pre-release with a watch dog that will restart the binding if it does not receive events
after a certain time. Would be helpful if you can help me and test it.

I never had any issues and I use the motion channel and the type of detection. The only time I had problems was when I switched to 4.0 and compiled your prelease but after you released an official one Wich works great since.

1 Like

I have added an option now in the pre release. You can on the nvr (bridge/controller) disable download of heatmaps or thumbnails. This will affect all cameras.

Commit: Added options to enable / disable download of heatmap and thumbnail o… · seaside1/unifiprotect@bdf10a4 · GitHub

Pre-release:

New stable version is out

  • Added Privazy Zone Support, toggle privacy zone from any camera on or off
  • Added chime channel for G4DB/PRO to easily enable / disable chime. Using chimeDuration configuration.
  • Add enable / disable of thumbnail download
1 Like

Thx for your fix!
Now it is working and i can add my NVR and the cameras!

1 Like

I do get the following events every 15 minutes:

2023-09-26 23:38:51.431 [INFO ] [ernal.event.UniFiProtectEventManager] - Watch dog Detected no events recieved, reinitializing!
2023-09-26 23:39:01.434 [INFO ] [ernal.event.UniFiProtectEventManager] - Socket failed, reinitializing!

Seems that this does not have any functional impact.

It means that no events are recieved through the websocket in 15 minutes and the binding is restarting. Do you use motion detection in any of your cameras, or ring on doorbell?
Otherwise you can turn the watchdog off in settings for the nvr/bridge

I do see now some OutOfMemory issues. Did not had them before and the only change is the activation of the Protect binding. When looking at netstat of my Raspberry i do see that currently there are 438 open network connections to my Unifi Dream Machine. When restarting the binding are all resources cleared?

To me it sounds like the watchdog is initiating a new connection on your system each 15 minutes, indicating that: The connection to the UniFiProtect websocket event api is not working on your system.
I would: Upgrade to latest version / firmware and UniFiProtect and see if you have the same issue.
Go over your network setup (is the UDM running on the same subnet etc)
You probably get memory issues to do all those connections not being terminated.

If you don’t use motion detection or doorbell ring trigger, you can safely disable the watch dog and your problems should disappear.

/S

Could possibly be related to this:

No i am not using the NEEO binding. Also my DreamMachine as well as the Protect application is up-2-date.

I do checked the code and if I am not misunderstanding anything than you simply create a new WebSocket client all the time when the old fails. That also means that you are not calling stop on the old client and that could explain the resource leaks. I can prepare a pull-request and fix that if you are OK with that?

PR:s are always welcomed.
I have added a dispose in the reinit you can see the commit here:

As far as the memory leak in oh4 goes, it might be tied to multiple bindings, not just neeo.

I still see that it is a problem that the socket get reinitialized in your system, indicating that the event api is broken for you.

BR S

Hi!

Is there any chance to implement geofencing with the binding? That would be a nice additional presence detection feature. On the unifi side the app works quite robust it would eliminate the iPhone sleep issues, etc. It would also require some sort of user management so it might be a huge task to code it down.

Thank you for this great piece of work. I use this since the first version.

What are the “iPhone sleep issues”?