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

Unifi Protect will not load cameras #137283

Closed
mtherien opened this issue Feb 4, 2025 · 3 comments · Fixed by #137343
Closed

Unifi Protect will not load cameras #137283

mtherien opened this issue Feb 4, 2025 · 3 comments · Fixed by #137343

Comments

@mtherien
Copy link

mtherien commented Feb 4, 2025

The problem

Cameras do not appear in Home Assistant. Shows a gray box.

What version of Home Assistant Core has the issue?

core-2025.1.4

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

home-assistant_unifiprotect_2025-02-04T01-18-23.706Z.log

Example YAML snippet

Anything in the logs that might be useful for us?

This error is in the log:
Logger: homeassistant.components.camera
Source: helpers/entity_platform.py:366
integration: Camera (documentation, issues)
First occurred: January 29, 2025 at 8:36:47 AM (7 occurrences)
Last logged: 7:36:23 PM

Error while setting up unifiprotect platform for camera
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/camera.py", line 156, in async_setup_entry
    async_add_entities(_async_camera_entities(hass, entry, data))
                       ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/camera.py", line 108, in _async_camera_entities
    for camera, channel, is_default in _get_camera_channels(
                                       ~~~~~~~~~~~~~~~~~~~~^
        hass, entry, data, ufp_device
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ):
    ^
  File "/usr/src/homeassistant/homeassistant/components/unifiprotect/camera.py", line 86, in _get_camera_channels
    if channel.is_package:
       ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uiprotect/data/devices.py", line 299, in is_package
    return self.fps <= 2
           ^^^^^^^^^^^^^
TypeError: '<=' not supported between instances of 'NoneType' and 'int'

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Feb 4, 2025

Hey there @RaHehl, 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)

@scocoh
Copy link

scocoh commented Feb 4, 2025

02 Feb 2025 UPDATE - the 2025.2 release resolved the issue. Thanks RaHehl!

original post:
UniFi Protect in HA for me has been offline since the UniFi Update to UniFi Protect on 27 Jan 2025.

The work around I found was to install HomeBridge which has a working connection to UniFi Protect and then to use UniFi Protect through the Home Kit Device integration. It works okay. But I am waiting on the HA UniFi Protect integration to catch up.

Read the various threads on the delay and from the code owner to understand why I decided to go this route. I needed the occupancy and motion data for driving my automations. The HomeBridge integration supplies this information.

If your cameras are assigned an area in UniFi Protect (HA), when you sync the names in HomeBridge they will not be assigned an area. This will help you distinguish between the two identically named entities.

@RaHehl
Copy link
Contributor

RaHehl commented Feb 4, 2025

2025.2 release is tomorrow https://www.youtube.com/watch?v=rflpsHsEE5s

but "TypeError: '<=' not supported between instances of 'NoneType' and 'int'" is something new, more informations about the setup are required

When I look at the diagnostic log, it looks something like this, maybe something is wrong with the HA setup, but I couldn't tell what, are HACS plugins installed?

bdraco added a commit to uilibs/uiprotect that referenced this issue Feb 4, 2025
bdraco added a commit to uilibs/uiprotect that referenced this issue Feb 4, 2025
bdraco added a commit to uilibs/uiprotect that referenced this issue Feb 4, 2025
* fix: handle fps being None

home-assistant/core#137283

* fix: handle fps being None

home-assistant/core#137283
bdraco added a commit that referenced this issue Feb 4, 2025
@bdraco bdraco mentioned this issue Feb 4, 2025
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants