UniFi Protect expanded support for PTZ cameras

With the addition of the G5 PTZ camera, the UniFi Protect lineup now has two PTZ cameras including a much more affordable option. More Home Assistant users will need advanced PTZ functionality from this integration to fully integrate and automate these cameras.

This feature request is intended to collect input and hopefully upvotes to expand UniFi Protect integration support for PTZ cameras. Here is a list of functions that I’m requesting for consideration:

  • Action calls to pan, tilt, zoom to a preset
  • Buttons and actions for discrete pan, tilt, zoom commands which could be mapped to a UI if desired (e.g. pan 1 deg, zoom 1.1x, etc.)

Feel free to add anything else you want below and please remember to vote.

Would like to add:

  • toggle tracking on/off

Right now, if you move the camera manually, you have to re-enable tracking from the original viewer. Looking to automate it after a certain timeout.

1 Like

Here’s more:

  • toggle the integrated spotlight on/off (G5)

Hmm, there is a switch for that already (switch.<cameraname>_tracking_person) and it works as intended. If it is set to on, it moves the camera to “home” position and starts automatic tracking again.

Hi, i have posted in another thread (Unifiptotect G4 PTZ - #9 by ofer8). i am trying to work on adding goto preset select entity to ptz cameras and wonder if anyone trying to do the same. my code:
add ptz preset select to unifi camera · home-assistant/core@10e17c0 · GitHub.
the code is working but i have hard time to add tests on it since the dataclass is frozen and i can’t mock the functions.
Also I had to use nest_asyncio since get_ptz_presets, get_ptz_home and get_ptz_current are all async function that needs to be called from within a loop.
the code is working on my dev env and i can see all my presets and its updated when i move the camera to a preset inside and out homeassistant.
If someone have a better way to do this or any suggestions let me know.

1 Like