core: Unifi Protect failed to load with latest public release of protect (2.9.33)
The problem
The integration fails to load,
What version of Home Assistant Core has the issue?
core-2023.11.0
What was the last working version of Home Assistant Core?
unknown
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?
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/__init__.py", line 105, in async_setup_entry
await _async_setup_entry(hass, entry, data_service)
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/__init__.py", line 137, in _async_setup_entry
await data_service.async_setup()
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 114, in async_setup
await self.async_refresh()
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 134, in async_refresh
updates = await self.api.update(force=force)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/api.py", line 600, in update
self._bootstrap = await self.get_bootstrap()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/api.py", line 776, in get_bootstrap
return Bootstrap.from_unifi_dict(**data, api=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 124, in from_unifi_dict
data = cls.unifi_dict_to_dict(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/bootstrap.py", line 202, in unifi_dict_to_dict
return super().unifi_dict_to_dict(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 356, in unifi_dict_to_dict
data[key] = cls._clean_protect_obj_dict(data[key], unifi_dicts[key], api)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 302, in _clean_protect_obj_dict
items[key] = cls._clean_protect_obj(value, klass, api)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 286, in _clean_protect_obj
return klass.unifi_dict_to_dict(data=data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/devices.py", line 902, in unifi_dict_to_dict
return super().unifi_dict_to_dict(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 788, in unifi_dict_to_dict
return super().unifi_dict_to_dict(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 346, in unifi_dict_to_dict
data[key] = cls._clean_protect_obj(data[key], unifi_objs[key], api)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 286, in _clean_protect_obj
return klass.unifi_dict_to_dict(data=data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/devices.py", line 399, in unifi_dict_to_dict
return super().unifi_dict_to_dict(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 339, in unifi_dict_to_dict
data[key] = convert_unifi_data(data[key], cls.__fields__[key])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyunifiprotect/utils.py", line 239, in convert_unifi_data
return type_(value)
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/enum.py", line 712, in __call__
return cls.__new__(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/enum.py", line 1135, in __new__
raise ve_exc
ValueError: 'schedule' is not a valid RecordingMode
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Reactions: 3
- Comments: 16 (2 by maintainers)
It only appears if you have one of your cameras set to a schedule-based recording mode (introduced in 2.9). People who do not use that feature in 2.9 will not get an error and people that get the error on 2.9 will still get it even after rolling back until they manually revert the recording mode on those cameras.
@home-assistant close
There may be something else going on in your case. I am just one data point but I am running HA Core 2023.11.0 and the UniFi Protect integration works fine for me connecting to a UDM-SE running Protect 2.8.35.
I downgraded to 2.8.35 and the same issue
I held off on this Unifi Protect release, but it has been reverted back to early access.
See unifi community post