Ubiquiti Unifi Protect cameras

The screenshot below is a G3 Flex on a dashboard using snap.jpeg. Is there any way to get the image to completely fill the window. The other image is the device page. I have 5 of these windows on the dashboard and none of them are filling the window. I tried changing the snapshot height and width on the device page with no success. If I lower height on the dashboard tile editor the grey will go away, but I want the image to be bigger. If I increase the height on the edit tile page, the grey area gets bigger but the image doesn't. Any help will be appreciated.

Screen Shot 2022-06-14 at 8.08.55 AM


Probably can play around with the CSS to do it, but what happens if you set it as the background image instead of using the Image URL?

1 Like

You did it. That worked. Thanks so much.

1 Like

The snap.jpeg comes directly from the camera, not from my driver.

Just FYI -- the image size settings in my Hubitat driver don't affect the image size from snap.jpeg. They change the behavior when you use the take() command, which gives you more options to do things with the image data in Hubitat.

Putting the url in the background box solved the problem. Thanks for the info.

Yep, it was @thebearmay to the rescue! Just wanted to share the other info in case it was useful to you or others.

I just found out that putting the URL in the background box does not work. It will put the image in the background but it does not refresh therefore the image does not change. Unless I am missing something, I will have to try something else.

Thank you to @Rehpa for reporting an issue that they saw with the setRecordingMode command for cameras.

The "motion" settings was renamed "detections" at some point, so you will have to use whichever version is correct for your UniFi Protect controller version.

I checked in a change on GitHub to support both keywords. But I didn't bump the version in HPM, so just run a Repair in HPM to pick up the change.

Wondering if anyone else has run into this. Last night I noticed my rule engine rule for alerting for motion in my garage stopped working. I dug into it a bit today and it appears the "smartDetectType" is no longer updating in the hub. I removed and re-installed the protect controller (and child camera devices) but it never seems to update anymore - stuck on n/a as it's value.

My rule looks for it to be a value of "person" which was working fine as of yesterday morning. I had updated to 2.3.2.138 so I downgraded back to 2.3.2.136 because I knew it was working. It looks like protect might of gotten an update as well at some point over the past 24 hours.

Anyone else getting this behavior? Thanks.

It's working fine for me. Which version of all of the various software packages are you running?

I'm on 2.3.2.139 of Hubitat, 2.0.1 of UniFi Protect, and the latest version of my code (1.3.5) from this integration.

Does other functionality still work with the integration, aside from smart detect? Do you see anything out of the ordinary in the logs if you enable logging on the parent virtual device?

I'm on 2.3.2.136 of hubitat (I've tried 2.3.2.138 and .139 as well but I know for a fact it was working on .136), 2.1.1 of protect and am using 1.3.5 of your driver code. Yes, everything else works fine. I can take a snap, it detects normal generic motion fine. The hub just does not update on a smart motion detect (I get the people motion alert in the protect app fine). Stuck on "n/a".

The log on the g4 camera shows:
Debug unsupported recording mode (null)

Log on the controller is totally normal just websocket status messages.

My recording mode is set to "detections" in protect. Thanks for the help. Driver has been rock solid.

I updated to 2.1.1 and can reproduce the issue. I have a fix for the issue, so I'll PM you the code to make sure that it also works on your side.

I just released v1.3.6 on GitHub and HPM.

This has the fix for smart detect events on UniFi Protect 2.1.x, as well as some improvements that should make events more reliable and responsive.

Thanks for the bug report and for your quick testing help @wafox. Also thanks to @Bago for the inspiration and detail on how to improve events for cameras and doorbells.

3 Likes

I just released v1.3.7 on GitHub and HPM, which has support for the G4 Doorbell Pro.

I added a new feature on the UniFi Protect Camera child device called takePicture which allows you to capture snapshots from both the main and package cameras. All other camera and doorbell features should work the same as before with the G4 Doorbell.

Thanks to @ktj.hebert for testing help and suggestions on how to design the new commands.

5 Likes

@tomw You did all the hard work and it was so easy working with you. Thank you for taking time out your day(s) to get this to work.

3 Likes

Maybe a simple stupid question, but how do you get smartDetections to be usable in Hubitat? For instance, the "person" smartDetection is not available as a selection in motion or anything that I'm aware of. Are you guys somehow pulling that status and making virtual devices or something?

It's a custom string attribute (smartDetectType), so you can use a change and value check as a trigger in RM or whatever you use. I use it that way in node-red.

Just check that attribute on the "-motion" child device for your camera or doorbell.

1 Like

Amazing!! I was too busy thinking motion, then look for smartDetect. Thanks @tomw

1 Like

You can use both. Normal motion detections (dumb detections?) will show up as events on the built in motion attribute. If your camera isn't smart detect capable, that's the only event you'll get. Cameras with smart detect will get both types of events.

1 Like

Worked perfectly using the customer attribute. Thanks again!

1 Like