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

I’ll give it a go and let you know. Removed Doorbell, Binding, and reinstalled new one in addons and inbox instantly noiticed G4 Pro as a doorbell. I’ll test channels and let you know if i have any problems!

1 Like

So I tried a binch of things and these were my findings… most things seem to work, some do not and throw errors when trying to change them from the OpenHAB side of things.


name						R (working)
type						R (working)
host						R (working)
state						R (working)
up-since					R (working)
last-seen					R (working)
connected-since				R (working)
last-motion					R (working)
mic-volume					R (working)
is-mic-enabled				R (didnt try)
is-dark						R (working)
is-recording				R (working)       
is-motion-detected			R (working)
status-light				R/W (didnt try)
reboot						R/W (did not work)
hdr-mode					R/W (didnt try)
high-fps-mode				R/W (didnt try)
ir-mode						R/W ( read works, write does not)
recording-mode				R/W ( read works, write does not)
a-snapshot					R/W (didnt try)
a-snapshot-img				R (didnt try)
snapshot					R/W (didnt try)
snapshot-img				R (didnt try)
motion-thumbnail			R (working)
motion-heatmap				R (working)
motion-score				R (working)
lcd-leave-package			R/W (read works, write does not)
lcd-do-not-disturb			R/W (read works, write does not)
?? lcd-custom 				(No Longer Supported?)
lcd-custom-text				R/W(not working)
is-ringing					R/W (read works)
last-ring					R/W (read works)
ring-thumbnail				R/W (working)
smart-detect-package		R/W (did not work, did not see on documentation but is in thing channel)
smart-detect-person			R/W (read works, write does not)
smart-detect-vehicle		R/W (read works, write does not)
smart-detect-motion			R (not working)
smart-detect-thumbnail		R (working)
smart-detect-score			R (working)
smart-detect-type			R (working)
smart-detect-last			R (not working)

Here were the errors from a couple things that I tried, one was “reboot”, another was trying to set the custom text “lcd-custom-text”



2023-03-14 17:24:09.068 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_CustomMessageText' changed from Test 1 to Hello
2023-03-14 17:24:09.069 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.unifiprotect.internal.thing.UniFiProtectG4DoorbellThingHandler@16e784fb': Unresolved compilation problem: 
	The method handleSmartDetectPackage(UniFiProtectCamera, ChannelUID, Command) is undefined for the type UniFiProtectG4DoorbellThingHandler
	The method handleSmartDetectPackage(UniFiProtectCamera, ChannelUID, Command) is undefined for the type UniFiProtectG4DoorbellThingHandler
	at org.openhab.binding.unifiprotect.internal.thing.UniFiProtectG4DoorbellThingHandler.handleCommand(UniFiProtectG4DoorbellThingHandler.java:122) ~[?:?]
	
	
	2023-03-14 17:11:17.266 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_Reboot' changed from OFF to ON
2023-03-14 17:11:17.267 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.unifiprotect.internal.thing.UniFiProtectG4DoorbellThingHandler@16e784fb': Unresolved compilation problem: 
	The method handleSmartDetectPackage(UniFiProtectCamera, ChannelUID, Command) is undefined for the type UniFiProtectG4DoorbellThingHandler
	The method handleSmartDetectPackage(UniFiProtectCamera, ChannelUID, Command) is undefined for the type UniFiProtectG4DoorbellThingHandler
	at org.openhab.binding.unifiprotect.internal.thing.UniFiProtectG4DoorbellThingHandler.handleCommand(UniFiProtectG4DoorbellThingHandler.java:122) ~[?:?]

Thanks for all you’re doing on this binding!

When I saved my items file, a bunch of errors came up. about the G4 Doorbell

G4 Doorbell errors.txt (162.4 KB)

I’ve fixed smart-detect-package (or I hope I have)

You will have to remove and readd the thing. Some of the error above should be gone as well.
The leave package and lcd-custom I can test out myself, it might be that the api has been changed in the latest versions.

BR S

Same issue here - Things get no updates, even though there are updates for my G4DB

Frame: {“action”:“update”,“newUpdateId”:“b1d66a17-b66d-4313-9cf1-97aa48130f1d”,“modelKey”:“camera”,“id”:“63456af402eed10387002ccc”,“mac”:“68D79XXXXXX”,“token”:null}

Triple checked the MAC, but that’s not it.
OH 3.2.0
Unifi Protect 2.2.11
UDM Pro 2.4.27

You should check your item definitions for lcd-custom-text as it was recently refactored. For me with a regular g4door bell (non pro) it works.

lcd-custom-text 	String 	Channel for setting custom lcd messages 	Read/Write

Description
The LCD message displayed by the doorbell will either be the configured message in the thing configuration or the set message in the lcd-custom-text channel. Use the thing config if you want a static custom message to be displayed. Use the lcd-custom-text channel if you want to dynamically set the message.

In case that is not working, you would have to supply error logs with the latest binding I supplied above.

BR S

I’m running
UniFi OS 3.0.17
UniFi Protect 2.7.33
Openhab 3.4.0

I would try to upgrade to latest stable UniFi OS and Protect app, and then OpenHAB 3.4 (at least to test).
Are you also sure you have linked correct items to channels? Otherwise you have to run latest version of binding and enable debug logging. Send a PM with the logs to me and I can take a close look.

BR S

That updated binding, fixed those errors. It made the lcd commands work, made the person and vehicle smart detects work properly too.

It appears the smart-detect-package still is not working.

When changing using person or vehicle, it works how it should.


2023-03-16 16:33:26.514 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'DoorbellPro_SmartDetectVehicle' received command ON
2023-03-16 16:33:26.515 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'DoorbellPro_SmartDetectVehicle' predicted to become ON
2023-03-16 16:33:26.516 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'DoorbellPro_SmartDetectVehicle' changed from OFF to ON
==> /var/log/openhab/openhab.log <==
2023-03-16 16:33:26.518 [INFO ] [ing.UniFiProtectG4CameraThingHandler] - Sending turn on/off SmatDetect Settings: VEHICLE camera: Doorbell, ip: 192.168.5.29
==> /var/log/openhab/events.log <==
2023-03-16 16:33:28.170 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'DoorbellPro_SmartDetectPerson' received command ON
2023-03-16 16:33:28.171 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'DoorbellPro_SmartDetectPerson' predicted to become ON
2023-03-16 16:33:28.173 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'DoorbellPro_SmartDetectPerson' changed from OFF to ON
==> /var/log/openhab/openhab.log <==
2023-03-16 16:33:28.174 [INFO ] [ing.UniFiProtectG4CameraThingHandler] - Sending turn on/off SmatDetect Settings: PERSON_AND_VEHICLE camera: Doorbell, ip: 192.168.5.29

When doing package, it does not do anything like the above working commands…

2023-03-16 16:35:58.990 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'DoorbellPro_SmartDetectPackage' received command ON
2023-03-16 16:35:58.991 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'DoorbellPro_SmartDetectPackage' predicted to become OFF

One small thing that I noticed was that the binding auto discover thought it was a g4camera again, and not a g4 doorbell. I just manually added it as a doorbell and everything seems to be working properly,

Thanks for the quick updates and work !

Updating to Openhab 3.4.2 did the trick! Thanks, @Seaside !

1 Like

I’ll have another look at that.

That’s strange. That code has not been changed. Would you mind sending me the bootrap.json and I could verify against that? You get it by enabling debug log and it will store it to a file (The location of the file is printed in the debug log). Send as PM in that case.

BR S

You can try a pre-release for g5:

  • Remove any old binding
  • Drop jar in addons folder
  • Readd any cameras

BR S

When I did a manual discovery scan in the UniFi Protect binding, the g4camera turned into the g4doorbell.

Seems to be working now. I did restart OpenHAB when I removed and re-installed the new biding. Maybe something was not lining up when updating to the new binding without a restart.

1 Like