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
71.06k stars 29.72k forks source link

Unifi Protect Integration causing status lights of cameras to come on constantly #79876

Closed Urbanpixels closed 1 year ago

Urbanpixels commented 1 year ago

The problem

When using the integration: unifiprotect my cameras and doorbells status light are always turned back ON.

Settings the status lights OFF wether in the integration OR protect it'self does not stick. After a few hours the status lights are back on.

Removing the integration completely and the status lights stay OFF and never turn back on unless set to do so.

Disabling the entities for the status lights does not help.

What version of Home Assistant Core has the issue?

2022.10.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

unifiprotect

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

homeassistant commented 1 year ago

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)


unifiprotect documentation unifiprotect source (message by IssueLinks)

AngellusMortis commented 1 year ago

I am not able to reproduce this and never have been able to as people have mentioned it before. I always have the status lights off on my cameras and they never come back on.

Please provide a diagnostics file. Also, do you have any automations on your Home Assistant? It is likely something else from Home Assistant is turning back on the status light. Nothing in pyunifiprotect automatically turns on the light.

Urbanpixels commented 1 year ago

I have a few automations but only for the doorbell pro. Which triggers alexa for a "chime" on my echos. The other cameras with Status lights have no automation applied and have this behavior.

Ive attached the file also.

config_entry-unifiprotect-ec175a9299d0ccd665e8aee62e51473c.json.txt

bdraco commented 1 year ago

Check the logbook at the time the light turned on. It might provide some insight on the source

AngellusMortis commented 1 year ago

The user that you are using for the UniFi Protect integration does not have write access to your cameras. So, it is impossible for Home Assistant to be causing the issue since the user cannot change the status light.

"allPermissions": [
  "nvr:read:*",
  "liveview:create",
  "user:read,write,delete:$",
  "deviceGroup:read:*",
  "bridge:read:*",
  "camera:read,readmedia:*",
  "doorlock:read:*",
  "light:read:*",
  "sensor:read:*",
  "viewer:read:*",
  "display:read:*",
  "chime:read:*"
],

You should not even have a switch to change the status light for your cameras. If you do it is likely from before support for the permission system was added and it should be orphaned now and no longer functioning. If you somehow do still have a switch, are you sure it is actually activating? And not just toggling back to off because the HTTP request failed.

Urbanpixels commented 1 year ago

Yes they stay off for a random amount of time. Sometimes 12 hours sometimes 3 hours but the status lights still come back on unless i remove the integration completely. Which makes no sense if the user doesent have permission.

Urbanpixels commented 1 year ago

My apologies it looks like something else was causing this. My homebridge docker was setting the status lights to on. Perhaps when i stopped the integration last time i just didnt leave it long enough and assumed this was the cause.