### The problem
Trying to switch on or off animal/person or vehicle detection s…witches in HA for a G4 camera returns an error:

I *can* successfully achieve this on a G5 (but most of my cameras are G4s).
### What version of Home Assistant Core has the issue?
core-2025.4.3
### 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
[home-assistant_unifiprotect_2025-04-27T05-54-23.124Z.log](https://github.com/user-attachments/files/19927708/home-assistant_unifiprotect_2025-04-27T05-54-23.124Z.log)
Logger: homeassistant.components.websocket_api.http.connection
Source: components/unifiprotect/entity.py:451
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 3:20:55 PM (2 occurrences)
Last logged: 3:57:15 PM
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 652, in queue_update
await self._update_sync.event.wait()
File "/usr/local/lib/python3.13/asyncio/locks.py", line 213, in wait
await fut
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 651, in queue_update
async with asyncio_timeout(0.05):
~~~~~~~~~~~~~~~^^^^^^
File "/usr/local/lib/python3.13/asyncio/timeouts.py", line 116, in __aexit__
raise TimeoutError from exc_val
TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 816, in handle_execute_script
script_result = await script_obj.async_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
msg.get("variables"), context=context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1827, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
self._handle_exception(
~~~~~~~~~~~~~~~~~~~~~~^
ex, continue_on_error, self._log_exceptions or log_exceptions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 556, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1008, in _async_step_call_service
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<9 lines>...
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 624, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2794, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2837, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
hass, entity, func, data, call.context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/switch.py", line 484, in async_turn_off
await self.entity_description.ufp_set(self.device, False)
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/entity.py", line 451, in ufp_set
await getattr(obj, self.ufp_set_method)(value)
File "/usr/local/lib/python3.13/site-packages/uiprotect/data/devices.py", line 1547, in set_animal_detection
return await self._set_object_detect(SmartDetectObjectType.ANIMAL, enabled)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/uiprotect/data/devices.py", line 2399, in _set_object_detect
await self.queue_update(callback)
File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 667, in queue_update
await self._save_device_changes(
...<2 lines>...
)
File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 751, in _save_device_changes
await self._api_update(updated)
File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 954, in _api_update
return await self._api.update_device(model, self.id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 1742, in update_device
await self.api_request(
...<3 lines>...
)
File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 454, in api_request
data = await self.api_request_raw(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
)
^
File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 406, in api_request_raw
await self._raise_for_status(response, raise_exception)
File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 441, in _raise_for_status
raise BadRequest(msg % (url, status, reason))
uiprotect.exceptions.BadRequest: Request failed: https://192.168.1.18/proxy/protect/api/cameras/63ca489903202a03e4001787 - Status: 400 - Reason: The smart detection feature is not enabled for: face, licensePlate
### Example YAML snippet
```yaml
action: switch.turn_off
data: {}
target:
entity_id: switch.shed_camera_detections_animal
```
### Anything in the logs that might be useful for us?
```txt
It is sending this:
'smart_detect_settings': {'object_types': [<SmartDetectObjectType.FACE: 'face'>, <SmartDetectObjectType.LICENSE_PLATE: 'licensePlate'>, <SmartDetectObjectType.PERSON: 'person'>, <SmartDetectObjectType.VEHICLE: 'vehicle'>]
...when it appears that the API does not understand this for a G4?
```
### Additional information
_No response_