Skip to content

Unifi Protect bug with G4 doorbell #124093

Closed
@BerserkeR-Git

Description

The problem

Home Assistant automations are no longer working because of a bug that makes the unifi protect integration crash.

What version of Home Assistant Core has the issue?

core-2024.8.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

UniFi Protect

Link to integration documentation on our website

https://www.home-assistant.io/integrations/unifiprotect/

Diagnostics information

config_entry-unifiprotect-01J5EYQRBJDJH1MY3SA47HV1CT.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.number
Source: helpers/entity_platform.py:598
integration: Number (documentation, issues)
First occurred: 03:37:08 (1 occurrences)
Last logged: 03:37:08

Error adding entity number.g4_doorbell_infrared_custom_lux_trigger for domain number with platform unifiprotect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 598, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 912, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1365, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/entity.py", line 254, in async_added_to_hass
    self._async_update_device_from_protect(self.device)
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/number.py", line 272, in _async_update_device_from_protect
    self._attr_native_value = self.entity_description.get_ufp_value(self.device)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uiprotect/data/devices.py", line 1155, in icr_lux_display
    return LUX_MAPPING_VALUES[10 - self.isp_settings.icr_custom_value]
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range

Additional information

No response

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions