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.94k stars 30.16k forks source link

ONVIF reports "401 Unauthorized" but half works anyway #114913

Open aik opened 6 months ago

aik commented 6 months ago

The problem

I have dual ONVIF camera, identified as "XM530V200_X6-WEQ_8M", port 8899, user "admin", password "admin", added fine to the HA 2024.4.0. Added via "Picture glance Card" - shows a static preview image so authorization seems working. However it does not show video:

2024-04-05 16:22:57.182 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.monstercam_substream] Error from stream worker: Error opening stream (HTTP_UNAUTHORIZED, Server returned 401 Unauthorized (authorization failed)) rtsp://****:****@192.168.10.234:554/channel=0_stream=1&onvif=0.sdp?real_stream= Trying manually works: mpv rtsp://monstercam:554/user=admin&password=admin&channel=&stream=.sdp?real_stream--rtp-caching=100

Other 5 ONVIF cameras work, all Hikvision but older. Is this something known?

What version of Home Assistant Core has the issue?

2024.4.0

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

onvif

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 6 months ago

Hey there @hunterjm, mind taking a look at this issue as it has been labeled with an integration (onvif) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `onvif` 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 onvif` 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)


onvif documentation onvif source (message by IssueLinks)

SunvidWong commented 4 months ago

Hikvision cam Model : DS-2CD3T647WDAP2-LPTS
ONVIF Version : 19.12

It is also impossible to add on hassio ONVIF but Works on scrypted,Frigate,

PLCHome commented 2 months ago

I have the following cameras: XM530V200_X6-WEQ_8M von H264 Firmware: V5.00.R02.000807D8.10010.346624.S.ONVIF 21.06

and XM530V200_X6C-WEQ_8M von H264 Firmware: V5.00.R02.000807DD.10010.346732.S.ONVIF 21.06

The camera works flawlessly in Home Assistant. I just had to turn on the preload.

The user admin does not work on my camera. The user admin was not created, only a user wfbr for the first and mxfy for the second camera. I logged into the web interface and created a new user.

image

s-kostyuk commented 1 month ago

Having the same issue with a Hikvision NVR: static images update periodically, but the stream does not load. Probably I missed something during the last re-configuration of the NVR.

UPD: Logging via UI by the "hass" user (the separate user I created for Home Assistant's access to NVR) gives the "device locked" error. Probably something performed too many failed login attempts.

UPD2: Fixed by allowing "PTZ Control" and "Playback/Download" for the HASS user in the NVR settings. зображення