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

Error in Unifi Protect since 2025.1 #134703

Closed
RobBie1221 opened this issue Jan 4, 2025 · 14 comments
Closed

Error in Unifi Protect since 2025.1 #134703

RobBie1221 opened this issue Jan 4, 2025 · 14 comments

Comments

@RobBie1221
Copy link
Contributor

The problem

Unifi protect integration won't load since 2025.1. See logging below.

I have one G4 Doorbell and 2 ONVIF camera's + AI Port paired with them. I have a UNVR with Unifi Protect on the latest version (5.1.85).

What version of Home Assistant Core has the issue?

core-2025.1

What was the last working version of Home Assistant Core?

core-2024.12

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?

�[31m2025-01-04 20:11:44.562 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 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/__init__.py", line 75, in async_setup_entry
    await protect.update()
  File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 830, in update
    bootstrap = await self.get_bootstrap()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 1198, in get_bootstrap
    return Bootstrap.from_unifi_dict(**data, api=self)
           ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 134, in from_unifi_dict
    data = cls.unifi_dict_to_dict(data)
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/bootstrap.py", line 236, in unifi_dict_to_dict
    return super().unifi_dict_to_dict(data)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 358, in unifi_dict_to_dict
    data[key] = cls._clean_protect_obj_dict(value, unifi_dicts[key], api)
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 278, in _clean_protect_obj_dict
    return {k: cls._clean_protect_obj(v, klass, api) for k, v in items.items()}
               ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 259, in _clean_protect_obj
    return klass.unifi_dict_to_dict(data=data)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/devices.py", line 1066, in unifi_dict_to_dict
    return super().unifi_dict_to_dict(data)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 354, in unifi_dict_to_dict
    data[key] = cls._clean_protect_obj(value, unifi_objs[key], api)
                ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 259, in _clean_protect_obj
    return klass.unifi_dict_to_dict(data=data)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 338, in unifi_dict_to_dict
    data[key] = convert_unifi_data(data[key], _fields[key])
                ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/utils.py", line 247, in convert_unifi_data
    return type_.from_string(value)
           ~~~~~~~~~~~~~~~~~^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/types.py", line 78, in from_string
    return cls(value)  # type: ignore[call-arg]
  File "/usr/local/lib/python3.13/enum.py", line 726, in __call__
    return cls.__new__(cls, value)
           ~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/enum.py", line 1199, in __new__
    raise ve_exc
ValueError: 'none' is not a valid AutoExposureMode�[0m

Additional information

No response

@RaHehl
Copy link
Contributor

RaHehl commented Jan 4, 2025

Hi @RobBie1221,

Do you have one or multiple AI Ports, and how are they paired? (For example, is the AI Port paired with the G4 Doorbell?) Also, what camera models are the ONVIF ones?

@RobBie1221
Copy link
Contributor Author

I have two AI Ports both paired with Dahua camera’s. See screenshot.

image

@RaHehl
Copy link
Contributor

RaHehl commented Jan 4, 2025

@RobBie1221
The issue seems to be the unexpected "AutoExposureMode" value "none"

Could you please share the Camera object having this value from your bootstrap? You will get the full bootstrap at https://unvrip/proxy/protect/api/bootstrap (u should anonymize the mac adresses there)

P.S.: are you sure it's a 2025.1 topic, and not related to adding the onvif cams?

@RobBie1221
Copy link
Contributor Author

Same setup was working 2024.12. I’ve kept it on 2025.1 for now with the 2024.12 version in custom_components. No problem with that.

@RaHehl
Copy link
Contributor

RaHehl commented Jan 4, 2025

@RobBie1221 in this case it's maybe the aiport object in my bootstrap i can's see any AutoExposureMode values

@RaHehl
Copy link
Contributor

RaHehl commented Jan 4, 2025

https://github.com/uilibs/uiprotect/releases/tag/v7.3.0 should fix this, but I would like to make sure that there are no further problems

@RobBie1221
Copy link
Contributor Author

RobBie1221 commented Jan 4, 2025

See below bootstrap from AI Port. You still want it for the camera as well? As this seems to work fine?

@RaHehl
Copy link
Contributor

RaHehl commented Jan 4, 2025

can u pls check if there is any AutoExposureMode or ae_mode string in your bootstrap?

should be under isp_settings

@RaHehl
Copy link
Contributor

RaHehl commented Jan 4, 2025

nvm found it as aeMode

@RobBie1221
Copy link
Contributor Author

With your new release it hangs on FocusMode

Logger: homeassistant.config_entries
Source: config_entries.py:640
First occurred: 22:51:42 (1 occurrences)
Last logged: 22:51:42

Error setting up entry UNVR for unifiprotect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/unifiprotect/__init__.py", line 75, in async_setup_entry
    await protect.update()
  File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 830, in update
    bootstrap = await self.get_bootstrap()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/api.py", line 1198, in get_bootstrap
    return Bootstrap.from_unifi_dict(**data, api=self)
           ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 134, in from_unifi_dict
    data = cls.unifi_dict_to_dict(data)
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/bootstrap.py", line 238, in unifi_dict_to_dict
    return super().unifi_dict_to_dict(data)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 358, in unifi_dict_to_dict
    data[key] = cls._clean_protect_obj_dict(value, unifi_dicts[key], api)
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 278, in _clean_protect_obj_dict
    return {k: cls._clean_protect_obj(v, klass, api) for k, v in items.items()}
               ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 259, in _clean_protect_obj
    return klass.unifi_dict_to_dict(data=data)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/devices.py", line 1066, in unifi_dict_to_dict
    return super().unifi_dict_to_dict(data)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 354, in unifi_dict_to_dict
    data[key] = cls._clean_protect_obj(value, unifi_objs[key], api)
                ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 259, in _clean_protect_obj
    return klass.unifi_dict_to_dict(data=data)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/base.py", line 338, in unifi_dict_to_dict
    data[key] = convert_unifi_data(data[key], _fields[key])
                ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/utils.py", line 247, in convert_unifi_data
    return type_.from_string(value)
           ~~~~~~~~~~~~~~~~~^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/types.py", line 78, in from_string
    return cls(value)  # type: ignore[call-arg]
  File "/usr/local/lib/python3.13/enum.py", line 726, in __call__
    return cls.__new__(cls, value)
           ~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/enum.py", line 1199, in __new__
    raise ve_exc
ValueError: 'none' is not a valid FocusMode

@RaHehl
Copy link
Contributor

RaHehl commented Jan 4, 2025

@RobBie1221 pls try this one, it should fix everything ispsettings releated https://github.com/uilibs/uiprotect/releases/tag/v7.4.0

@RobBie1221
Copy link
Contributor Author

WIth that version, it loads properly. No errors in the logs. Thanks :)

@RaHehl
Copy link
Contributor

RaHehl commented Jan 5, 2025

@home-assistant close

@RobBie1221
Copy link
Contributor Author

Solved with #134829

@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2025
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

3 participants