Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unfi Protect 2.0 breaks integration #72595

Closed
sose5000 opened this issue May 27, 2022 · 21 comments
Closed

Unfi Protect 2.0 breaks integration #72595

sose5000 opened this issue May 27, 2022 · 21 comments

Comments

@sose5000
Copy link

The problem

Unifi released update 2.0 to the protect product yesterday. Upon update, the unifiprotect plugin no longer connects to protect.

Reconfigure Simply states - Failed to connect

What version of Home Assistant Core has the issue?

2022.5.5

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

unifiprotect

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

Reconfigure Simply states - Failed to connect

@probot-home-assistant
Copy link

unifiprotect documentation
unifiprotect source
(message by IssueLinks)

@probot-home-assistant
Copy link

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

This comment was marked as abuse.

@KitHubek
Copy link

i have 2.0 on UNVR and after update no problem with integration

@sose5000
Copy link
Author

I will reboot my controller and test again.

@LordStewie
Copy link

I am seeing the same issue, below is an output from the logs. I believe it has to do with Ubiquiti adding package tracking to the smart detection for the new doorbell pro.

2022-05-27 10:13:01 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry UDM Pro for unifiprotect Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/unifiprotect/__init__.py", line 81, in async_setup_entry await data_service.async_setup() File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 74, in async_setup await self.async_refresh() File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 94, in async_refresh updates = await self.api.update(force=force) File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/api.py", line 507, in update self._bootstrap = await self.get_bootstrap() File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/api.py", line 676, in get_bootstrap return Bootstrap.from_unifi_dict(**data, api=self) File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 111, in from_unifi_dict data = cls.unifi_dict_to_dict(data) File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/bootstrap.py", line 152, in unifi_dict_to_dict return super().unifi_dict_to_dict(data) File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 343, in unifi_dict_to_dict data[key] = cls._clean_protect_obj_dict(data[key], unifi_dicts[key], api) File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 288, in _clean_protect_obj_dict items[key] = cls._clean_protect_obj(value, klass, api) File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 272, in _clean_protect_obj return klass.unifi_dict_to_dict(data=data) File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/devices.py", line 699, in unifi_dict_to_dict return super().unifi_dict_to_dict(data) File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 617, in unifi_dict_to_dict return super().unifi_dict_to_dict(data) File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 333, in unifi_dict_to_dict data[key] = cls._clean_protect_obj(data[key], unifi_objs[key], api) File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 272, in _clean_protect_obj return klass.unifi_dict_to_dict(data=data) File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 326, in unifi_dict_to_dict data[key] = convert_unifi_data(data[key], cls.__fields__[key]) File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 160, in convert_unifi_data value = [convert_unifi_data(v, field) for v in value] File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 160, in <listcomp> value = [convert_unifi_data(v, field) for v in value] File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 176, in convert_unifi_data value = field.type_(value) File "/usr/local/lib/python3.9/enum.py", line 384, in __call__ return cls.__new__(cls, value) File "/usr/local/lib/python3.9/enum.py", line 702, in __new__ raise ve_exc ValueError: 'package' is not a valid SmartDetectObjectType

@Wubarius
Copy link

Hi,

I have same problem and log event in HA core-2022.5.5 and Unifi-Protect 2.0.0.
Next point is: The "unifi-protect" service restarts every minute on the udm pro - 1.11.4
Only disable HA integration Unif-Protect stop loop.

Bye...
Thomas

@KitHubek
Copy link

tried update UDM to EA fw?

@AngellusMortis

This comment was marked as abuse.

@LordStewie
Copy link

@AngellusMortis Thank you, that fixed my issue. I figured since it was the end of the month I was going to be able to wait until after the next update got pushed to do that update.

@AngellusMortis

This comment was marked as abuse.

@Thheizz
Copy link

Thheizz commented May 27, 2022

I have a similar situation.

`Deze fout is ontstaan door een aangepaste integratie.

Logger: homeassistant.config_entries
Source: custom_components/unifiprotect/data.py:89
Integration: UniFi Protect (documentation, issues)
First occurred: 19:00:05 (1 occurrences)
Last logged: 19:00:05

Error setting up entry Home for unifiprotect
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/unifiprotect/init.py", line 210, in async_setup_entry
await data_service.async_setup()
File "/config/custom_components/unifiprotect/data.py", line 74, in async_setup
await self.async_refresh()
File "/config/custom_components/unifiprotect/data.py", line 89, in async_refresh
self._async_process_updates(await self.api.update(force=force))
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/api.py", line 568, in update
self._bootstrap = await self.get_bootstrap()
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/api.py", line 717, in get_bootstrap
return Bootstrap.from_unifi_dict(**data, api=self)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 100, in from_unifi_dict
data = cls.unifi_dict_to_dict(data)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/bootstrap.py", line 132, in unifi_dict_to_dict
return super().unifi_dict_to_dict(data)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 332, in unifi_dict_to_dict
data[key] = cls._clean_protect_obj_dict(data[key], unifi_dicts[key], api)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 277, in _clean_protect_obj_dict
items[key] = cls._clean_protect_obj(value, klass, api)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 261, in _clean_protect_obj
return klass.unifi_dict_to_dict(data=data)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/devices.py", line 680, in unifi_dict_to_dict
return super().unifi_dict_to_dict(data)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 595, in unifi_dict_to_dict
return super().unifi_dict_to_dict(data)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 322, in unifi_dict_to_dict
data[key] = cls._clean_protect_obj(data[key], unifi_objs[key], api)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 261, in clean_protect_obj
return klass.unifi_dict_to_dict(data=data)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 315, in unifi_dict_to_dict
data[key] = convert_unifi_data(data[key], cls.fields[key])
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 159, in convert_unifi_data
value = [convert_unifi_data(v, field) for v in value]
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 159, in
value = [convert_unifi_data(v, field) for v in value]
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 177, in convert_unifi_data
value = field.type
(value)
File "/usr/local/lib/python3.9/enum.py", line 384, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.9/enum.py", line 702, in new
raise ve_exc
ValueError: 'package' is not a valid SmartDetectObjectType
`

@bdraco
Copy link
Member

bdraco commented May 27, 2022

You need to be running home assistant 2022.5.5 or later for the new protect version

@bdraco
Copy link
Member

bdraco commented May 27, 2022

Please delete the HACS version from /config/custom_components/unifiprotect and restart

@xeno111
Copy link

xeno111 commented Jun 2, 2022

Home Assistant Core
Installed version
2022.4.7
i updated my unifi protect to v2 and cameras no longer connect to HA, ill perform a full backup now and update to latest HA version and test again (i have been hesitant to do this as it broke another integration last time i updated)

2022-06-02 13:11:49 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry UDM-Pro for unifiprotect
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/init.py", line 81, in async_setup_entry
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 74, in async_setup
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 94, in async_refresh
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/api.py", line 507, in update
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/api.py", line 676, in get_bootstrap
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 111, in from_unifi_dict
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/bootstrap.py", line 152, in unifi_dict_to_dict
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 343, in unifi_dict_to_dict
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 288, in _clean_protect_obj_dict
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 272, in _clean_protect_obj
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/devices.py", line 699, in unifi_dict_to_dict
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 617, in unifi_dict_to_dict
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 333, in unifi_dict_to_dict
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 272, in _clean_protect_obj
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 326, in unifi_dict_to_dict
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 161, in convert_unifi_data
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 161, in
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 177, in convert_unifi_data

@xeno111
Copy link

xeno111 commented Jun 2, 2022

updated to 2022.6.0 and unifi now works fine, however as i said it has now broken my Alexa Integration - Alexa Media Player its has an exclamation with Not Loaded showing. i use this for important notications such as the doorbell and water leak sensors, they perform an "announce" to all alexa devices.
Logger: homeassistant.setup
Source: setup.py:162
Logger: homeassistant.util.package
Source: util/package.py:99
First occurred: 14:35:28 (3 occurrences)
Last logged: 14:35:49

Unable to install package alexapy==1.25.3: ERROR: Cannot install alexapy==1.25.3 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts WARNING: You are using pip version 22.0.3; however, version 22.1.2 is available. You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
First occurred: 14:35:49 (1 occurrences)
Last logged: 14:35:49

Setup failed for custom integration alexa_media: Requirements for alexa_media not found: ['alexapy==1.25.3'].

Anyone have any idea how to fix this please?

@AngellusMortis

This comment was marked as abuse.

@Kortex49
Copy link

Kortex49 commented Jun 5, 2022

UPDATE: found out what was my issue. I didn't realise that Protect is now part of HA Core, despite this mentioned many time in this thread :-). Uninstalling HACS Protect and utilising Core Project allowed me to integrate the devices without issues. Please ignore my message below.

Hi, same issue here that appeared recently.

Unifi Protect 2.0.1 (official version)
Home Assistant Core 2022.6.2
Home Assistant Supervisor 2022.05.3
HACS Protect 1.12.0

As mentioned in this thread, I have restarted the UDM Pro, I have deleted the HACS Protect configuration but its integration still fails with the error:
"ValueError: 'package' is not a valid SmartDetectObjectType"

Any suggestion?
Thanks.

@fribse
Copy link

fribse commented Jun 5, 2022

I'm at Protect 2.0.1
HA is Core 2022.6.2

If I restart HA, the integration fails, and all the feeds are blank. If I remove it, and readd it, it works until next time I restart the HA.

2022-06-05 23:45:58 ERROR (MainThread) [homeassistant.components.switch] Platform unifiprotect does not generate unique IDs. ID 61d31db80283000387002e8b_osd_date already exists - ignoring switch.have_overlay_show_date
2022-06-05 23:45:58 ERROR (MainThread) [homeassistant.components.switch] Platform unifiprotect does not generate unique IDs. ID 61d31db80283000387002e8b_osd_logo already exists - ignoring switch.have_overlay_show_logo
2022-06-05 23:45:58 ERROR (MainThread) [homeassistant.components.switch] Platform unifiprotect does not generate unique IDs. ID 61d31db80283000387002e8b_osd_bitrate already exists - ignoring switch.have_overlay_show_bitrate
2022-06-05 23:45:58 ERROR (MainThread) [homeassistant.components.switch] Platform unifiprotect does not generate unique IDs. ID 61d31db80283000387002e8b_smart_person already exists - ignoring switch.have_detections_person
2022-06-05 23:45:58 ERROR (MainThread) [homeassistant.components.switch] Platform unifiprotect does not generate unique IDs. ID 61d31db80283000387002e8b_smart_vehicle already exists - ignoring switch.have_detections_vehicle
2022-06-05 23:45:58 ERROR (MainThread) [homeassistant.components.switch] Platform unifiprotect does not generate unique IDs. ID 5f702a2d02cef103870003f3_status_light already exists - ignoring switch.entre_status_light_on
2022-06-05 23:45:58 ERROR (MainThread) [homeassistant.components.switch] Platform unifiprotect does not generate unique IDs. ID 5f702a2d02cef103870003f3_hdr_mode already exists - ignoring switch.entre_hdr_mode
2022-06-05 23:45:58 ERROR (MainThread) [homeassistant.components.switch] Platform unifiprotect does not generate unique IDs. ID 5f702a2d02cef103870003f3_privacy_mode already exists - ignoring switch.entre_privacy_mode
2022-06-05 23:45:58 ERROR (MainThread) [homeassistant.components.switch] Platform unifiprotect does not generate unique IDs. ID 5f702a2d02cef103870003f3_osd_name already exists - ignoring switch.entre_overlay_show_name
2022-06-05 23:45:58 ERROR (MainThread) [homeassistant.components.switch] Platform unifiprotect does not generate unique IDs. ID 5f702a2d02cef103870003f3_osd_date already exists - ignoring switch.entre_overlay_show_date
2022-06-05 23:45:58 ERROR (MainThread) [homeassistant.components.switch] Platform unifiprotect does not generate unique IDs. ID 5f702a2d02cef103870003f3_osd_logo already exists - ignoring switch.entre_overlay_show_logo
2022-06-05 23:45:58 ERROR (MainThread) [homeassistant.components.switch] Platform unifiprotect does not generate unique IDs. ID 5f702a2d02cef103870003f3_osd_bitrate already exists - ignoring switch.entre_overlay_show_bitrate

@AlbertDijksma
Copy link

After updating Protect to version 2.1.1-beta.3 it stops working with ValueError: 'homekit' is not a valid VideoMode

Logger: homeassistant.config_entries
Source: components/unifiprotect/data.py:94
First occurred: 22:19:53 (1 occurrences)
Last logged: 22:19:53

Error setting up entry UDM Pro for unifiprotect
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup
result = await component.async_setup_entry(hass, self)
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/init.py", line 139, in async_setup_entry
await data_service.async_setup()
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 74, in async_setup
await self.async_refresh()
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 94, in async_refresh
updates = await self.api.update(force=force)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/api.py", line 508, in update
self._bootstrap = await self.get_bootstrap()
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/api.py", line 677, in get_bootstrap
return Bootstrap.from_unifi_dict(**data, api=self)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 111, in from_unifi_dict
data = cls.unifi_dict_to_dict(data)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/bootstrap.py", line 160, in unifi_dict_to_dict
return super().unifi_dict_to_dict(data)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 343, in unifi_dict_to_dict
data[key] = cls._clean_protect_obj_dict(data[key], unifi_dicts[key], api)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 288, in _clean_protect_obj_dict
items[key] = cls._clean_protect_obj(value, klass, api)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 272, in _clean_protect_obj
return klass.unifi_dict_to_dict(data=data)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/devices.py", line 699, in unifi_dict_to_dict
return super().unifi_dict_to_dict(data)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 617, in unifi_dict_to_dict
return super().unifi_dict_to_dict(data)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 333, in unifi_dict_to_dict
data[key] = cls._clean_protect_obj(data[key], unifi_objs[key], api)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 272, in clean_protect_obj
return klass.unifi_dict_to_dict(data=data)
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/data/base.py", line 326, in unifi_dict_to_dict
data[key] = convert_unifi_data(data[key], cls.fields[key])
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 160, in convert_unifi_data
value = [convert_unifi_data(v, field) for v in value]
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 160, in
value = [convert_unifi_data(v, field) for v in value]
File "/usr/local/lib/python3.9/site-packages/pyunifiprotect/utils.py", line 176, in convert_unifi_data
value = field.type
(value)
File "/usr/local/lib/python3.9/enum.py", line 384, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.9/enum.py", line 702, in new
raise ve_exc
ValueError: 'homekit' is not a valid VideoMode

@bdraco
Copy link
Member

bdraco commented Jun 9, 2022

I'm going to close this issue since this is about 2.0. The message above is about 2.1.1-beta.3 which is a new problem. Please open a new issue @AlbertDijksma so we can start working on that problem.

@bdraco bdraco closed this as completed Jun 9, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests