Unifiptotect G4 PTZ

The Unifi G4 PTZ supports position presets in the latest firmware.
It it very helpful if HA was able to set position points of the PTZ camera.

G4 PTZ support 11 positions 0…9 and a home Position.

If you get motion triggers from the alarm, it great if you can move the camera position to one of the presets that matches the zone.
This way you can use the PTZ camera with different detections methods.
And its usable to move the camera to positions with other triggers or time schedules.

Thanks for the info.

I don’t know if they have the option in the API to call a service for the presets.
I was more thinking of a services call to go to a preset, 10 individual Buttons is not manageable I agree.

So there is a Unifi Protect API, GitHub - hjdhjd/unifi-protect: A nearly complete implementation of the UniFi Protect API.. I haven’t played with it all yet, it’s all been reverse engineered through trial and error. Just looking at the documentation I’m not certain if we’d be able to control the presets through there. You can get events and such pretty easily, and take snapshots. The presets are currently called in the Unifi WebUI by hitting the number keys 0-9, or R for home. I guess the thing to do would be to try and snoop the conversation in the browser and see maybe what it is sending to the controller to do command these. I’d like to see this so we could implement a simple patrol route. You know, the basic PTZ feature this $1800 camera lacks out of the box for the last 3 years. lol

Yeah, I just picked up a G5 PTZ. I didn’t expect full PTZ control of it via HA, but was surprised there is not an action to PTZ to various presets.

+1, in particular it would be great to have a “star patrol” ability since it doesn’t seem possible from the Protect app.

Hi,
I have started to work on adding some functionality to PTZ camera through the integrations but progress is slow.
i have added an action to goto a preset


which is working well and i have an automation that triggers it.

I’m working to see how to add this visibility on the device menu as well. i did hit some snags with how to bring the preset names to the home assistant device UI.
Did anyone else try to do the same and want to collaborate?

Also, I have never submitted a pr to the homeassistant core repo so i dont know how fast i will be able to share it back to the community.

Any more info on how you managed to pull this off? I’d love to be able to have a motion detector move the camera to a different position.

I have added a service to the unifiprotect integration. found here:

Then I can use it in automation that trigger on a movement.
I will look into adding more functionality like a select option from the camera device page.

unfortunately it didnt pass review because the suggestion was to create a select entity. the select entity setup code is somewhat not build to handle this and it will take me time to do this from a select option.

Well that’s a huge bummer. Anything I can do to help?