Ubiquiti Unifi Protect cameras

Ok so I just removed everything and started over, added the app code, and the 3 driver codes in, Added user app - Unifi Controller Manager, Enter in the info, Added controller, created child devices, I can see the links to create the dashboard links, but if I move away from the page, there is not way to get it back without deleting everything and recreating it. The app dose not ever appear as an installed app

I have not installed the other user's app before, but it is possible that you need to click Done or similar. If you want to try out my app I will be happy to assist: Ubiquiti Unifi Protect cameras - #127 by tomw

I will check it out

Got you code added and it works somewhat, added 2 cameras, one with cloud link and other with local. both showed up and updated, but only for a bit and then no more updates. It is set to refresh ever 5 seconds, yet nothing. updates anymore. I can manully update the pic in device, but the dash does not do it auto anymore (its like the image server stopped poling for updates)

Update: Removed and re added everything (Just your stuff this time) and still will not update and will not show now at all in dashboard. (Local or cloud)

OK, a couple of theories:

The image refreshes based on what is stored in the device attributes, but it doesn't actually take a new photo. You need to have something to execute the take command, like a rule that executes that when motion is detected or just does it on some time interval. That could explain the lack of updates.

On it not showing at all, you should note that the URL will change if you reinstall or use a different version of the app, since the app ID is embedded in the URL. So, you might need to check and make sure that the URL in the app configuration page for imageServer is the same one you are using in your dashboard tile. Just a hunch that those may be mismatched.

Ya I removed everything devices and child devices. App (image server) removed dashboard and started fresh. Still no poc shows when all reinstalled. Odd it worked before. I will look into it.

Did find a easy way to see it local only though and that might be all I need and then your drivers for motion. :slight_smile:

Did you do take at least once after you re-created the devices? If you open a camera device page, is the image displayed there?

You can link to camera jpeg and refresh every second. No muss, no fuss.

@tomw Can you share an example of a rule that uses the take command? For example, motion at my front door, camera takes a picture and sends it via text.
I went looking through Rule Machine and couldn't find anything easily.


Here it is in Rule Machine 4.1.

The actions page:

And the full rule:

Thank you @tomw, I got that rule to work. Please be patient with me. How do I get the image that was taken to show up on a dashboard link or sent in a text, lets say?

This is a little bit more complicated.

There is a limitation on Hubitat dashboards that makes it not possible to display the image directly. Other dashboards may not have this issue, and the two attributes (image is raw base64 encoded, and displayImage is decoded and embedded within HTML <img> tags) may be able to be used directly.

If you want to use it on a Hubitat dashboard, you can try out this app that I created. Note that this will only work inside your local network.

As for text messaging or emailing, I'm assuming you could use the attributes I mentioned before and send them with the notification to those devices. It would depend on what the specific notification system supports.

I posted a new version in this thread, which adds a command to configure the recording mode for a camera: Recording UniFi Cameras When HSM Mode is Away - #5 by tomw

@jsfinn, please feel free to use this thread for reference and any discussion on getting things up and running.

1 Like

Just wanted to note that I have wanted this for a while, just never thought to ask!

Looks to be working well from what I can tell. My only .02 would be maybe store the current recording state into an attribute for the device. I’m doing that manually with RM and a hub variable so that I don’t unnecessarily change the setting. Although pretty minor, there’s probably no negative effect from sending duplicate commands.

@tomw , I was able to get it up and running without trouble and created Rule Machines to switch recording on or off based on HSM status.

I'll do more testing later but so far, so good.

I'm so happy! Thank you for the driver and support!

1 Like

Thanks, glad it is working for you.

I agree, it seems pretty innocuous to send a command to change it to the same/current setting. Honestly, I'd expect the overhead of checking the attribute on Hubitat to be more impactful to overall performance than it would for an unnecessary command on the UniFi Protect side.

I'll keep it in mind and consider adding an attribute when I next edit the driver. Do any other useful attributes come to mind?

Nothing immediately comes to mind data attribute wise.

If you want a feature request that maybe wouldn’t be super easy to implement cleanly.. right now I translate person and car smart detect changes into virtual motion devices using RM so that I can more easily use some of the built in apps (motion = person seen, inactive = no person).

Could be nice to have a separate child device that represents the smart detect events. I’m just not sure how you’d do that and not en up with a long list of children devices for each camera.

I got it connected once I updated the system to 2.11 Now to figure out how to get the doorbell to work over HE so I can play a file over my chromecast speakers :slight_smile:


For the doorbell, you should have gotten a child device of type UniFi Protect Doorbell.

You can use events with Rule Machine from the button being pushed on that device. It gives an event when the doorbell button is pushed. You can also send text to the LCD screen by sending a notification to the device from Hubitat.

I have the child for my cameras and for the doorbell. Do I need the python script to run? When I press the doorbell button I get no status change.