Open Julian0021 opened 3 weeks ago
Please provide a screenshot as its not clear what is not working
The entity switch _switch.g4_ptz_trackingperson became unavailable recently.
Thanks. Can you also provide diagnostics?
Which camera model is it?
It might be that the field moved in protect 4.x
I don't have any PTZ cameras to test with, but I suspect this might fix it
diff --git a/homeassistant/components/unifiprotect/binary_sensor.py b/homeassistant/components/unifiprotect/binary_sensor.py
index fb60158580e..35e378d32e8 100644
--- a/homeassistant/components/unifiprotect/binary_sensor.py
+++ b/homeassistant/components/unifiprotect/binary_sensor.py
@@ -284,7 +284,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
name="Tracking: person",
icon="mdi:walk",
entity_category=EntityCategory.DIAGNOSTIC,
- ufp_required_field="is_ptz",
+ ufp_required_field="feature_flags.is_ptz",
ufp_value="is_person_tracking_enabled",
ufp_perm=PermRequired.NO_WRITE,
),
diff --git a/homeassistant/components/unifiprotect/switch.py b/homeassistant/components/unifiprotect/switch.py
index ca56a602209..50372d47ea8 100644
--- a/homeassistant/components/unifiprotect/switch.py
+++ b/homeassistant/components/unifiprotect/switch.py
@@ -319,7 +319,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
name="Tracking: person",
icon="mdi:walk",
entity_category=EntityCategory.CONFIG,
- ufp_required_field="is_ptz",
+ ufp_required_field="feature_flags.is_ptz",
ufp_value="is_person_tracking_enabled",
ufp_set_method="set_person_track",
ufp_perm=PermRequired.WRITE,
The diagnostics should confirm either way
The problem
After the latest protect update, the ptz person tracking feature became unavailable.
What version of Home Assistant Core has the issue?
core-2024.6.1
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Unifi Protect
Link to integration documentation on our website
https://www.home-assistant.io/integrations/unifiprotect/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response