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


I’ll investigate. I’m curios if there are any others using this addon for openhab 3 that are experiencing the same problem?
Also there seems to be an issue with openhab 3 running out of memory:


I’ll post back once I have any findings.
What version of Openhab 3 are you using?

Regards, S

If it’s a matter of CPU load, actually I also had this problem. I do not know for sure whether it was “caused” by the UniFi Protect or the http binding (*) since those two covered the logs with tons of warnings.
At the end, I removed both bindings, cleared the cache and reinstalled everything. I guess clearing the cache was the bringer at the end, since I deleted / reinstalled the bindings several times before. Maybe you can try this @Tim2016?

(*) I am sure the problem was not caused by one of the bindings itself, especially since http binding is just a released one and now everything is working fine and the bindings did not change.

1 Like

Hi @wosch87, I had already cleared cache and rebooted several times. As soon as I removed the binding the errors went away. I do not currently use the http binding.

@Seaside - Openhab 3.1.0 Build 2212.

I have also noticed the following error in the log - org.apache.cxf.interceptor.Fault: unable to create native thread: possibly out of memory or process/resource limits reached.

Openhabian running on an RPI 4 B with 4GB RAM.

What other bindings are you using? Do you have any rules that are running?
I have not run UniFi Protect that much with OH3 since I’m developing some other bindings at the moment for OH3 and I try to keep each environment somewhat clean. I have now launched it in OH3 so waiting for results.

My impression so far is that there are OOM issues with OH3 in general, see the thread above I posted. The binding with exactly the same code has been running for more than 1 month in my OH 2.5 instance where I have 10+ cameras a lot of events and on top of that debug is enabled. And I have not seen any memory /cpu issues. If there is a OOM bug I suspect it then would be related to how the binding is utilizing the openhabcore and that something has changed there.

Regards S

Hi @Seaside,

I am using the following: Amazon Echo Control, Harmony Hub, Hue, iCloud, Milight, Modbus, MQTT, Neato, Nest, Netatmo, Pioneer AVR, Samsung TV, System Info, Telegram, Tradfri, Unifi and Z-Wave.

I have 15 rules running but they are only triggered infrequently.

I also started afresh with OH3. I did previously upgrade but could not get OH stable and based on reading a few posts I took the opportunity to build OH3 from scratch. So I have almost no textual config.

I’ve been running for 3 days now on an RPI3, where I have rules for motion dection on the cameras. Running 7 cameras and also periodically doing snapshots with rules.
The memory has increased from 29% to 30.4% in 3 days. Hard to tell if it is a memory leak or not.

Referencing to https://community.openhab.org/t/openhab-3-runs-out-of-memory-java-heap-space-errors-cpu-100-after-a-few-hours/

There is a bug with DSL GUI rules as well as DSL text rules which leads to OOM.
I think you have to re-evaluated once those bugs are fixed. I don’t think there is a specific memory leakage in this particular addon (could be wrong but that’s my feeling).

Regards, S

Thanks for looking @Seaside . I will attempt to re-install again. It could be well be linked to the java issue.

1 Like

Interesting binding. I got a UDM-Pro and am waiting for the G4 doorbell to be available in the EU.
As soon as it is available this binding might be a perfect addon to make full use of it.
Added this thread to the favorites :slight_smile:

1 Like

Just ordered a g4 doorbell in eu store, finally in stock, I plan on adding features for doorbell once I have it :+1:

1 Like

Allready sold out :frowning: i signed up to get a ‘back in stock’ notification.

1 Like

I have added a alpha10 build which handles reboots of the nvr (restarts the event listener) I have also removed a lot of the info logging (moved to debug)

Could you please explain how to update to alpha10? Is it simply replacing the file in the addons folder? Will the settings such as the things and items themselves be kept or is it necessary to setup them again?

Sorry for the stupid question, but I never worked with bindings which are not implemented in the official repo yet.

You can just replace the jar, a restart won’t hurt either to be on the safe side. You don’t have to recreate any items or change any existing configuration.

Regards S

1 Like

Breaking change and major update.

Added G3 Camera type, G4 Camera type and G4 Doorbell.
Possible to do smart detection, custom lcd message on doorbell and detect ringing events.
See first post for more info.
If you plan on upgrading, I would suggest to delete all cameras and the bridge and then readd them from scratch. Should be quick with discovery of the cameras.

The Camera thing type has been renamed from camera to g3camera, g4camera and g4doorbell.

1 Like

Added an ALPHA12 build which fixes an issue with downloading heatmaps.

@jshatch Did you solve your Alexa problems?

Basically I do this to invoke Alexa:

rule "doorBell"
     Item G4DBIsRinging changed to ON  
   logInfo(LOG, "First DoorBell is pushed! ") 
   AlexaKitchenDotTTS.sendCommand("Ding-dong! Someone is at the door!")

Alexa Kitchen Dot tts is set up using amazonecho control binding:

String AlexaKitchenDotTTS                   "Text to Speech"                        (AlexaKitchenDot) {channel="amazonechocontrol:echo:f502a697:ID:textToSpeech"}
1 Like

Yeah, that’s almost exactly what I did. At first I was trying to go the opposite direction and use the doorbell button to trigger a routine that sent an announcement, but you can’t do that. Then I saw the Amazon binding and that you can send text commands, and I linked all my echos together so they all say the same thing. I also send a command to the echo show to start viewing the camera using monocle.

1 Like


I’m new to OpenHAB. I have just installed this custom binding.

I got UDM Pro thing added and discovery worked. So I added my G4 Doorbell.

Now every points in G4 Doorbell are Null and even if I push doorbell, it won’t change. If I click snapshot image its blank. I have turned on anonymous snapshot on individual camera.

The fact all points are NULL, I wonder despite auto discovery, somehow my devices are not correctly communicating with OpenHAB. Where can I start?

What firmware version are you using? What version of unifi protect? What version of openhab? And what version of the binding?

Try restarting openhab and look at the openhablog, do you see anything that stands out?
Please post a sample of your items definition as well. Next step would be to enable debug logging.

The fact that you can discover devices tells me that the authentication is working.

Regards S

UDM Pro 1.9.3
Protect version 1.17.4
OpenHAB 3.0.1
Binding 3.0.0-ALPHA12

I am not sure how I can get code version of item.

As I try to get log viewer going, I noticed my LXC version of HABian do not open the log viewer while Rasberry Pi or VM version do. I might have to dig a bit more to see if my physical setup itself is an issue.

I will ask a bit more detailed question once I can figure out my issue is.

Thank you!