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

Have you also recreated your things? Deleting them and readding them?
I have not missed any events, but have not run it f

Nice work! Thanks for your Binding.
Iā€™m pretty new to OH3.2, while I am running OH2 for several years productive (and clustered).
My protect implementation for OH2 was a python daemon on protect os itself, pushing events to MQTT. Your binding ist much nicer!
I do have some issuesā€¦

  1. as described by Wirrkopf above ā€œFailed to get event, ignoring: UniFiProtectAction [action=update, modelKey=event, id=XYXYXYXYXYXXY]ā€ )
  2. In debug log I can see a full bootstrap refresh every 5 secondsā€¦ Is this a correct behaviour. Looks like ALOT of traffic and spam.
    Greetings, Patrick

Hi!

Thank you for the feedback!

  1. Some events are missing not sure why, you get this message when you get an event on the websocket, but when querying the NVR, it returns nothing about the event, since you then donā€™t know anything about the event it is ignored.
  2. Bootstrap refresh is configurable in the NVR (bridge controller) default should be 60 seconds
    It can however refresh bootstrap if it receives events on the websocket that it needs to know about. So for instance if you trigger a motion it will do a refresh of the bootstrap even if the time is set to 60 seconds.

Regards, S

Iā€™ve already played around with bootstrap refresh parameter (no effect). I do have no events, while bootstrap is always looping with 5 seconds. I think the missing event ā€œUniFiProtectAction action=updateā€ is leading to the loop.

Greetings

This is what it looks like for me:

2022-01-02 17:45:30.137 [DEBUG] [al.model.request.UniFiProtectRequest] - Created new request host: xxxxx, scheme: https, path: /proxy/protect/api/bootstrap
2022-01-02 17:45:30.141 [DEBUG] [al.model.request.UniFiProtectRequest] - New request: HttpRequest[GET /proxy/protect/api/bootstrap HTTP/1.1]@e79df8
2022-01-02 17:45:30.144 [DEBUG] [al.model.request.UniFiProtectRequest] - >> GET https://xxxx/proxy/protect/api/bootstrap
2022-01-02 17:45:30.286 [DEBUG] [otect.internal.model.UniFiProtectNvr] - Successfully refreshed bootstrap
2022-01-02 17:46:31.723 [DEBUG] [al.model.request.UniFiProtectRequest] - Created new request host: xxx, scheme: https, path: /proxy/protect/api/bootstrap
2022-01-02 17:46:31.726 [DEBUG] [al.model.request.UniFiProtectRequest] - New request: HttpRequest[GET /proxy/protect/api/bootstrap HTTP/1.1]@16f0e6
2022-01-02 17:46:31.729 [DEBUG] [al.model.request.UniFiProtectRequest] - >> GET https:/xxx/proxy/protect/api/bootstrap
2022-01-02 17:46:31.877 [DEBUG] [otect.internal.model.UniFiProtectNvr] - Successfully refreshed bootstrap
2022-01-02 17:47:33.260 [DEBUG] [al.model.request.UniFiProtectRequest] - Created new request host: xxxx, scheme: https, path: /proxy/protect/api/bootstrap
2022-01-02 17:47:33.263 [DEBUG] [al.model.request.UniFiProtectRequest] - New request: HttpRequest[GET /proxy/protect/api/bootstrap HTTP/1.1]@1ff77f4
2022-01-02 17:47:33.265 [DEBUG] [al.model.request.UniFiProtectRequest] - >> GET https://10xxxx/proxy/protect/api/bootstrap
2022-01-02 17:47:33.412 [DEBUG] [otect.internal.model.UniFiProtectNvr] - Successfully refreshed bootstrap

How often are you getting ā€œFailed to get event, ignoring: xxxxxxā€ ?

Every few seconds (3-5 seconds). Each request looks like this (with a lot moreā€¦

17:20:12.314 [DEBUG] [nal.model.request.UniFiProtectRequest] - Created new request host: 10.x.x.x, scheme: https, path: /proxy/protect/api/bootstrap
17:20:12.314 [DEBUG] [nal.model.request.UniFiProtectRequest] - New request: HttpRequest[GET /proxy/protect/api/bootstrap HTTP/1.1]@16492826
17:20:12.314 [DEBUG] [nal.model.request.UniFiProtectRequest] - >> GET https://10.x.x.x/proxy/protect/api/bootstrap
17:20:12.426 [DEBUG] [rotect.internal.model.UniFiProtectNvr] - Successfullt sent request
17:20:12.426 [DEBUG] [rotect.internal.model.UniFiProtectNvr] - Request is ok, parsing cameras

Each camera is loaded an parsed again and again (big json result with all parameters for each device).
Note: I do have some offline devices (PIR floodlight, ā€¦). Could this be a problem?

Not sure why you get missed events that often, I could add some back off or similar for frequently missed events. Maybe you could try and reduce your system I.e only one camra and the bridge to see if you have the same frequency of missing events. And then slowly add things back.

The bootstrap.json itself is the size it is, and itā€™s the only known approach of fetching system information and event info. Possibly there could be other parts of the undocumented api, but that is.unknown to me at least.

Ubiquity has announced a Protect door lock

I have been generally disappointed with my smart lock forays with a Schlage Sense and Zigbee Yale Assure SL. Their reliability and slow response are frustrating although their outdoor keypads are excellent.

Is there much chance of the binding supporting this lock?

Iā€™d have to find an alternative keypad as this is just a interior motorized door lock designed for US single-cylinder deadbolts. Also the fact that itā€™s a battery operated device that communicates with the BTLE protocol leaves me feeling it will not perform any more reliably or quickly than my current Yale locks.

My network is Ubiquity a UDMP, POE USW and Ubiquity 6 Access Points. Currently I have no cameras, but Iā€™m seriously considering the Protect G4 Pro doorbell.

How about integrationg the UP-Sense???

It seems the up sense is not connected to unifi protect, it requires a unifi ap (wifi 6) to function. Seems more related to the unifi wireless binding.
I donā€™t own any unifi aps anymore, so I wonā€™t be getting the up sense. It looks quite nice though I have to say.

Hi!

Is it possible to use two way audio of unifi G4 doorbell somehow? The homebridge version has this functionality. I donā€™t know much of internal openhab audio possibilities but it would be nice to get some communication though a tablet or a google mini.

Thank you,
Zsolt.

How come I can no longer find the is-motion-detected channel? The camera thing is initialized as earlier, but Iā€™m now confused why it has stopped working altogether. Iā€™ve also removed everything from the .things file and attempt configure it via UI only, but still nothing. Iā€™m just probably missing some little detail, but it ā€œused to workā€, but hasnā€™t in last 6 months, and finally got into investigating the problem but cannot really understand what is going on. All tips highly appreciated!

Bridge unifiprotect:nvr:uck "UniFi Protect" [host="192.168.1.40", username="adsdas", password="adsdsa", refresh="3600"] { 
   Thing camera Etuovi "Etuovi" [name="Etuovi", mac="F09FC2142F4D"] {
        Channels:
            Type is-motion-detected: is-motion-detected
   }
}

It is still named is-motion-detected. One refactoring that has been done is to separate g3-cameras from g4-cameras.

I think you need to change ā€œThing cameraā€ to ā€œThing g3cameraā€
If you donā€™t get it to work, I would temporarily remove all manual configuration and
and the things in the UI to see if it works.

Best Regards, S

1 Like

Probably possible but would require a lot of work. I donā€™t have any plans for it atm, I welcome PRs.

Regards s

1 Like

Excellent, g3camera did the trick, thank you so much!:tada:

1 Like

Just installed this very promising looking binding on OH 3.2.0 from the marketplace.

My UDM-Pro seems to be working correctly. I can see for example values for the channels storage size and CPU temp.

Then I added my G3 Instant camera and it also is shown as ONLINE.

However, I tried various channels and none of them is working. No errors in openhab.log. I tried Status Light, State, Recording Mode, Last Motion, Camera Type, Name.
All are NULL or they are OFF, when they should be ON.

The name of the camera in Protect has a SPACE (ā€œG3 Instantā€), I hope this is not a problem.

Any hints? Thanks!

Edit: When I delete the Camera thing and SCAN, it does not find the camera.

Edit 2:
I have enabled debug logging, deleted the camera thing and added it again. This is the only log output:

2022-03-22 16:18:33.094 [DEBUG] [ing.UniFiProtectG3CameraThingHandler] - Initializing the UniFiProtect Client Handler with config = UniFiProtectG3CameraThingConfig [mac=xx:xx:xx:xx:xx:xx]

(I have masked the mac)

Hi!

Have you tested any other g3 or g4 camera? Did it find the camera the first time you did a scan?

BR S

I only have this camera.
For the first 2 tries, I added the camera manually each time.
Then I tried scan, after deleting it first, if course.

If you canā€™t detect the camera with scan, itā€™s very likely it wonā€™t work adding it manually.
So you need to set up the NVR manually and then scan for cameras. Once the NVR is setup the binding will query the NVR for a bootstrap.json which contains a lot of information, including attached cameras.

What you can do next is to enable debug logging the binding and then PM me the content of the bootrap.json which will be printed in the log.

Like this: "Json response: ā€¦ " (a lot of data)

I can then try to parse that json manually to see why the camera is not detected.

BR S

I deleted the NVR thing, added it again and saw in the log that it does see a camera.
Tried again scanning and it found the camera this time.
I donā€™t know what I did different. Do you still want the log?