home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.58k stars 29.91k forks source link

Unifi Protect not working #75152

Closed martogsl closed 2 years ago

martogsl commented 2 years ago

The problem

After upgrading to 2022.7.0 and every version since the Protect addon isn't working. I have deleted the integration and re-added it with the same issue.

What version of Home Assistant Core has the issue?

2022.7.4

What was the last working version of Home Assistant Core?

2022.6.7

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?

Logger: homeassistant.config_entries
Source: components/unifiprotect/data.py:118
First occurred: 10:24:06 PM (2 occurrences)
Last logged: 10:33:57 PM

Error setting up entry Martog's UNVR for unifiprotect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 353, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/__init__.py", line 88, in async_setup_entry
    await data_service.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 98, in async_setup
    await self.async_refresh()
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 118, in async_refresh
    updates = await self.api.update(force=force)
  File "/usr/local/lib/python3.10/site-packages/pyunifiprotect/api.py", line 600, in update
    self._bootstrap = await self.get_bootstrap()
  File "/usr/local/lib/python3.10/site-packages/pyunifiprotect/api.py", line 781, in get_bootstrap
    return Bootstrap.from_unifi_dict(**data, api=self)
  File "/usr/local/lib/python3.10/site-packages/pyunifiprotect/data/base.py", line 114, in from_unifi_dict
    data = cls.unifi_dict_to_dict(data)
  File "/usr/local/lib/python3.10/site-packages/pyunifiprotect/data/bootstrap.py", line 184, in unifi_dict_to_dict
    return super().unifi_dict_to_dict(data)
  File "/usr/local/lib/python3.10/site-packages/pyunifiprotect/data/base.py", line 346, in unifi_dict_to_dict
    data[key] = cls._clean_protect_obj_dict(data[key], unifi_dicts[key], api)
  File "/usr/local/lib/python3.10/site-packages/pyunifiprotect/data/base.py", line 291, in _clean_protect_obj_dict
    items[key] = cls._clean_protect_obj(value, klass, api)
  File "/usr/local/lib/python3.10/site-packages/pyunifiprotect/data/base.py", line 275, in _clean_protect_obj
    return klass.unifi_dict_to_dict(data=data)
  File "/usr/local/lib/python3.10/site-packages/pyunifiprotect/data/user.py", line 66, in unifi_dict_to_dict
    return super().unifi_dict_to_dict(data)
  File "/usr/local/lib/python3.10/site-packages/pyunifiprotect/data/base.py", line 341, in unifi_dict_to_dict
    data[key] = cls._clean_protect_obj_list(data[key], unifi_lists[key], api)
  File "/usr/local/lib/python3.10/site-packages/pyunifiprotect/data/base.py", line 283, in _clean_protect_obj_list
    items[index] = cls._clean_protect_obj(item, klass, api)
  File "/usr/local/lib/python3.10/site-packages/pyunifiprotect/data/base.py", line 275, in _clean_protect_obj
    return klass.unifi_dict_to_dict(data=data)
  File "/usr/local/lib/python3.10/site-packages/pyunifiprotect/data/user.py", line 26, in unifi_dict_to_dict
    data["model"] = ModelType(parts[0])
  File "/usr/local/lib/python3.10/enum.py", line 385, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.10/enum.py", line 710, in __new__
    raise ve_exc
ValueError: 'recordingSchedule' is not a valid ModelType

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

unifiprotect documentation unifiprotect source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @briis, @angellusmortis, @bdraco, mind taking a look at this issue as it has been labeled with an integration (unifiprotect) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

AngellusMortis commented 2 years ago

The issue likely has nothing to do with you upgrading, but rather you adding recording schedules to your cameras. We have not done any testing with recording schedules at all.

As a workaround for now, I recommend removing the recording schedules from the Protect app and add them back as automations in HA.

martogsl commented 2 years ago

I actually have no recording schedules setup in Protect. I'm also using Protect 2.0.1

Screenshot 2022-07-13 230101 Screenshot 2022-07-13 230017 1