Intergrates UniFi Protect Camera System into openHAB. See UniFi Camera Security - Ubiquiti
This binding utilizes an undocumented json REST API that is present in the NVR.
Documentation / Installation / Download
Bugs
Any bug you find is good to report. Preferred way of reporting bugs is to create an issue on github: Issues · seaside1/unifiprotect · GitHub
I will look at failures in this thread as well.
Built a new ALPHA2 version which fixes NPEs when downloading snapshots and handles Event Timers a bit differently for dowloading heatmaps and thumbnails.
Would be great if someone would dare to try it out
The heatmap and motion event picture are captured automatically now, no need for a manual DSL rule. I’ve also added a score for the image, in order to be able to filter out false positives.
Good news, CloudKey Gen2 has a beta firmware with UniFiOS. I can implement the event based api over websockets now as well as supporting the other UniFi OS devices (UDMPro and Unifi NVR). Which means the binding won’t have to poll for events.
I’ll get back once it is done.
See here for more info: (You need to be logged in to access the page)
I’ve updated the binding to only support UniFi OS now.
If you have a Cloudkey Gen2+, update to firmware 2.0.18 or later.
UDMP and UNVR should work but have not been tested. Would be great if someone could try and test them.
Great work on this binding and documentation @Seaside
I have implemented binding org.openhab.binding.unifiprotect-2.5.x-ALPHA6.jar on Openhab version - 2.5.9-1
UniFi-CloudKey-Gen2-Plus - firmware version 2.0.22
From openhab I was able to add UniFi Protect NVR and configure. Was then able to add two Unifi Cameras (G3 & G4Doorbell) thru PaperUI. I am seeing all the expected Items and logged events but unable to trigger any rule using these events. Can anyone confirm successful rule trigger from this bindings ItemStateChange logs? I have several other working rules currently in place fyi.
2020-12-02 16:37:10.064 [vent.ItemStateChangedEvent] - unifiprotect_camera_3e2f3681_E063DAAF6BD1_is_motion_detected changed from OFF to ON
rule “Front of House Motion”
when
Item unifiprotect_camera_3e2f3681_E063DAAF6BD1_is_motion_detected changed to ON
then
//triggering light on event
//triggering logInfo
//triggering sendMail action
end
Hi James, could you please put some step-by-step instruction what to do to let the binding work with the cloud key. I have the cloud-key-gen2+ - the latest firmware I could find and which is installed is the 1.1.13. I downloaded the jar file and put it in the addon-folder - but I could not see any binding in the paper UI panel. Any tips or hints for me?
Is the camera that you are trying to motion detect the G4 Doorbell?
I have not added support for doorbell yet, but might still work. If it’s the G4 Doorbell, please try the other camera and see if that one works.
Looks good to me, OpenHab is registering it as an event.
Try changing the rule to something like this and when reloading the rule pay attention for error messages:
rule "Front of House Motion"
when
Item unifiprotect_camera_3e2f3681_E063DAAF6BD1_is_motion_detected changed to ON
then
logInfo("UniFiProtect","Motion detected ON by UniFiProtect Hello World!")
end
Then look in the openhab.log for the logInfo line.
That should be enough you will then be able to add a new Thing using the binding, I’ll attach some screen shots to the original post. You still need a newer firmware to be able to use the binding though. Please take a look in the openhab.log if you see any errors.
First - Thanks a lot seaside!
It seams, that the binding isn’t installed correctly - I do not the the expected binding while adding a thing.
Is there anything more to do than downloading the jar-file and put it in the addon-folder (/usr/share/openhab2/addons) / modifying rights or any other file or configuration?
Rights of the jar file is all fine. What I get in the karaf console is the already installed UniFi Binding but the Protect Binding is still missing…
265 x Active x 80 x 2.5.10 x openHAB Add-ons :: Bundles :: UniFi Binding
No you don’t have to uninstall the unifi binding, they run fine side by side.
Verify the file size on the jar file, and also restart openhab and look for any error messages in the log.
The size for me on an rpi4 with 32 bit openhabian is 124675 bytes.
I’m running the binding on openhab 2.5.10 and I have tested it on 2.5.7, 8, 9 and 10.