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
73.56k stars 30.73k forks source link

Unifi Protect Integration Broken with UniFi Protect Application 3.0.22 #113938

Closed MKippen closed 7 months ago

MKippen commented 7 months ago

The problem

Upon upgrading UniFi Protect Application to 3.0.22 and reloading the Unifi Protect Integration in Home Assistant, the integration fails to load and is completely broken.

2024-03-21 07:45:53.221 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry UNVR for unifiprotect Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/unifiprotect/init.py", line 70, in async_setup_entry bootstrap = await protect.get_bootstrap() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/api.py", line 1009, in get_bootstrap return Bootstrap.from_unifi_dict(**data, api=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 120, in from_unifi_dict data = cls.unifi_dict_to_dict(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/bootstrap.py", line 224, in unifi_dict_to_dict return super().unifi_dict_to_dict(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 369, in unifi_dict_to_dict data[key] = cls._clean_protect_obj_dict( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 311, in _clean_protect_obj_dict items[key] = cls._clean_protect_obj(value, klass, api) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 289, in _clean_protect_obj return klass.unifi_dict_to_dict(data=data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/user.py", line 72, in unifi_dict_to_dict return super().unifi_dict_to_dict(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 360, in unifi_dict_to_dict data[key] = cls._clean_protect_obj_list( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 300, in _clean_protect_obj_list items[index] = cls._clean_protect_obj(item, klass, api) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 289, in _clean_protect_obj return klass.unifi_dict_to_dict(data=data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/user.py", line 34, in unifi_dict_to_dict data["nodes"] = [PermissionNode(n) for n in parts[1].split(",")] ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/enum.py", line 744, in call return cls.new(cls, value) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/enum.py", line 1158, in new raise ve_exc ValueError: 'readlive' is not a valid PermissionNode 2024-03-21 07:46:19.856 ERROR (MainThread) [aiounifi.interfaces.messages] Bad JSON data ''

What version of Home Assistant Core has the issue?

core-2024.3.1

What was the last working version of Home Assistant Core?

core-2024.3.1

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

2024-03-21 07:43:47.982 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 135, in async_refresh updates = await self.api.update(force=force) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/api.py", line 673, in update self._bootstrap = await self.get_bootstrap() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/api.py", line 1009, in get_bootstrap return Bootstrap.from_unifi_dict(**data, api=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 120, in from_unifi_dict data = cls.unifi_dict_to_dict(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/bootstrap.py", line 224, in unifi_dict_to_dict return super().unifi_dict_to_dict(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 369, in unifi_dict_to_dict data[key] = cls._clean_protect_obj_dict( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 311, in _clean_protect_obj_dict items[key] = cls._clean_protect_obj(value, klass, api) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 289, in _clean_protect_obj return klass.unifi_dict_to_dict(data=data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/user.py", line 72, in unifi_dict_to_dict return super().unifi_dict_to_dict(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 360, in unifi_dict_to_dict data[key] = cls._clean_protect_obj_list( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 300, in _clean_protect_obj_list items[index] = cls._clean_protect_obj(item, klass, api) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/base.py", line 289, in _clean_protect_obj return klass.unifi_dict_to_dict(data=data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyunifiprotect/data/user.py", line 34, in unifi_dict_to_dict data["nodes"] = [PermissionNode(n) for n in parts[1].split(",")] ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/enum.py", line 744, in call return cls.new(cls, value) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/enum.py", line 1158, in new raise ve_exc ValueError: 'readlive' is not a valid PermissionNode

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 7 months ago

Hey there @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!

Code owner commands Code owners of `unifiprotect` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign unifiprotect` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


unifiprotect documentation unifiprotect source (message by IssueLinks)

AngellusMortis commented 7 months ago

@home-assistant close

MKippen commented 7 months ago

@AngellusMortis sorry to waste your time here, I see there were closed issues related to previous version. Since this is no longer a RC but is the official release, I got automatically updated and didn't see anything active. My apologies.

scottgrobinson commented 7 months ago

@AngellusMortis Why is this closed? It's a genuine issue now - It's no longer an RC, it's stable and released....

AngellusMortis commented 7 months ago

Stop pinging code owners. God damn. Do you own research and look for 5 fucking seconds and see there are like 10 other duplicate issues with other discussions.

scottgrobinson commented 7 months ago

Stop pinging code owners. God damn. Do you own research and look for 5 fucking seconds and see there are like 10 other duplicate issues with other discussions.

I've done my research thanks. You've stated on nearly every ticket RC not supported. It's not an RC. It's official. :)

AngellusMortis commented 7 months ago

Apparently not very well.

https://github.com/home-assistant/core/issues/113879 https://github.com/home-assistant/core/pull/113630 https://community.home-assistant.io/t/unifi-protect-failed-to-connect/701518/6