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
72.42k stars 30.31k forks source link

uvc integration broken since 2024.09 HA release #127184

Open okaiuz opened 1 week ago

okaiuz commented 1 week ago

The problem

after upgrading from 2024.8.3 core to 2024.9.x core version, i'm unable to start and stop motion detection with Ubiquiti Unifi Cameras. if i rollback to 2024.8.3 all works! in 2024.9.xi'm unable to start and stop the motion detection even calling action via developer option (tried in 2024.9.1 and .3. in 2023.8.3 calling action works!

What version of Home Assistant Core has the issue?

core-2024.9.3

What was the last working version of Home Assistant Core?

core-2024.8.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

uvc

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

home-assistant[bot] commented 1 week ago

uvc documentation uvc source

joostlek commented 1 week ago

Do you have logs?

okaiuz commented 1 week ago

@joostlek if i call action from developer option HA give me the green thick, but no change on operating mode of the camera! i'f you can tell me where to look for specific log i can provide it! Now i'm roll back to 8.3 cause i need to operate with motion detection switch, but i can upgrade for collect log!

joostlek commented 1 week ago

https://my.home-assistant.io/redirect/logs/

okaiuz commented 1 week ago

@joostlek i update to 2024.9.3 and try to execute action to turn on and off motion detection via developer option, in logs i see that:

`Logger: homeassistant.components.uvc.camera Source: components/uvc/camera.py:235 integration: uvc (documentation, issues) First occurred: 13:08:07 (12 occurrences) Last logged: 13:09:12

Unable to set recordmode to motion Unable to set recordmode to none`

attached there's full log home-assistant_2024-10-01T11-10-48.369Z.log

joostlek commented 1 week ago

Can you enable debug logging and try again?

okaiuz commented 1 week ago

sure, here's the log: home-assistant_uvc_2024-10-01T12-27-04.893Z.log

joostlek commented 1 week ago

Right, can you maybe run the following code to install a version bump as custom component and collect more debug logs?

cd /config
curl -o- -L https://gist.githubusercontent.com/bdraco/43f8043cb04b9838383fd71353e99b18/raw/core_integration_pr | bash /dev/stdin -d uvc -p 127580

And add this to your configuration.yaml

logger:
  default: info
  logs:
    uvcclient: debug
    custom_components.homeassistant.components.uvc: debug
okaiuz commented 1 week ago

test your new version, i have this error when i try to switch to motion:

`Dettagli registro (ERRORE) Questo errore ha avuto origine da un'integrazione personalizzata. Registratore: custom_components.uvc.camera Fonte: custom_components/uvc/camera.py:220 Integrazione: uvc Prima occorrenza: 12:23:57 (1 occorrenze) Ultima registrazione: 12:23:57

Unable to set recordmode to motion `

and this is from integretion debug log: home-assistant_uvc_2024-10-05T10-28-28.113Z.log

joostlek commented 1 week ago

Okay awesome. This shows me what the device is trying to send to uvc. To also tell you the root cause, in that release the library moved owners and I wanted to introduce code quality improvements to keep the library nice for the years to come, but apparently it came with bugs. (This was mainly done to ensure the library is maintained). Ideally I now also get debug logs from the version before that (2024.8), so I will send you the script to install the uvc integration as custom component as we knew it from 2024.8. From debugging, those logs will also put in what they actually send to the device, so I can compare the both and see where it goes wrong. (given that this issue is because of the code quality improvements and not because of new HTTP library versions).

cd /config
curl -o- -L https://gist.githubusercontent.com/bdraco/43f8043cb04b9838383fd71353e99b18/raw/core_integration_pr | bash /dev/stdin -d uvc -p 123276
logger:
  default: debug

(note: since the logging in the old version of the uvc library was kinda whack, we have to lower the default log level to debug to be able to see what it sends. So please start HA after this, and execute the motion detection thing, and download the logs and be sure to put this back to the original value (I think info is default). This prevents your system from putting everything in the logs, because I don't need more than just that request)

okaiuz commented 5 days ago

Hi, i've update HA to 202410.1, and installed the last version you link me! now calling motion detection enable & disable via developer option works again!!! here the log you [need:] home-assistant_2024-10-06T17-42-32.923Z.log