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

ONVIF integration won't authenticate with Hikvision digest authentication #119107

Open
Alby247 opened this issue Jun 7, 2024 · 20 comments
Open
Assignees

Comments

@Alby247
Copy link

Alby247 commented Jun 7, 2024

The problem

ONVIF integration wont authenticate with Hikvision digest authentication

Previously reported here

#99166

but this was closed without resolution.

Hikvision devices are detected by ONVIF integration but authorisation fails

Returns error:

Could not authenticate: Unknown fault occured: <?xml version='1.0' encoding='utf-8'?> <head> <title>Unauthorized</title> <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> </link> <body> <h2>Access Error: 401 -- Unauthorized</h2> <pre/> </body> </head>

Users/passwords etc in Hikvision devices checked and triple checked.

Nothing in system logs.

What version of Home Assistant Core has the issue?

2024.6.0

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

ONVIF

Link to integration documentation on our website

https://home-assistant.io/integrations/onvif/

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

Tasks

Preview Give feedback
No tasks being tracked yet.
@rainepretorius
Copy link

Same for me ONVIF for my cameras not workig

@brian-kehoe
Copy link

I have received the same error message

@quieThu
Copy link

quieThu commented Jun 11, 2024

Same issue here :(

@Alby247
Copy link
Author

Alby247 commented Jun 12, 2024

@hunterjm is this an issue with the integration, or is it something we are all doing wrong re authorisation of the Hikvision cameras?

@quieThu
Copy link

quieThu commented Jun 12, 2024

I receive this error message when trying to setup the onvif integration:

Could not authenticate: The action requested requires authorization and the sender is not authorized (code:env:Sender) (subcodes:{http://www.onvif.org/ver10/error}NotAuthorized)

Model: Hikvision DS-2DE2A404IW-DE3
FW: V5.7.11 build 230612
ONVIF authentication mode: digest/WSSE

The onvif username is pretty simple and the password is only 9 characters long without specials. It works perfectly with alternative ONVIF monitoring app (onvier from play store for example)

Screenshot_20240612_203615_Chrome

@Alby247
Copy link
Author

Alby247 commented Jun 13, 2024

I should also mention I can connect to the NVR fine using Onvif Device Manager.

Onvif HA integration detects the NVR (and a camera that I enabled Onvif on) but it won't accept the authentication.

@kizza42
Copy link

kizza42 commented Jun 27, 2024

Am also experiencing this issue recently with a Hikvision DS-2CD2347G2-LU running its latest firmware.
I have played with the different Onvif access levels, sometimes It just works and then I leave it be until the next HA Update restarts HA and things break again

@ficho81
Copy link

ficho81 commented Jul 6, 2024

I have an Annke C800 camera, very similar to Hikvision ones, and HA ONVIF stopped working some months ago. After a lot of debugging, I arrived to the conclusion that HA onvif integration may be the problem.

@RuiFG
Copy link

RuiFG commented Jul 18, 2024

everybody help??

@rainepretorius
Copy link

What fixed mine was turning off stream encryption on the devices local menu.

@markbooth73
Copy link

Hello, I have ANNKE AC500, again HA ONVIF stopped working.

How I "fixed" mine was to install Hikvision firmware.

This gave me an option to turn off time verification

image

For some reason whatever attempts to correct the time failed.

Regards,

@ficho81
Copy link

ficho81 commented Jul 21, 2024

I have an Annke C800 camera, very similar to Hikvision ones, and HA ONVIF stopped working some months ago. After a lot of debugging, I arrived to the conclusion that HA onvif integration may be the problem.

solved toggling "daylight saving time" option!!

@home-assistant
Copy link

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)

@vizion1988
Copy link

I have an Annke C800 camera, very similar to Hikvision ones, and HA ONVIF stopped working some months ago. After a lot of debugging, I arrived to the conclusion that HA onvif integration may be the problem.

solved toggling "daylight saving time" option!!

This fixed the issue for me as well. First configure your time settings, thereafter enable DST. I worked the other way around and that doesn't work. So work from top to bottom in the time settings screen of your camera :-)

@alexswider
Copy link

Same here, works on VLC for example, not sure how to fix it.

@jsf3rd
Copy link

jsf3rd commented Sep 3, 2024

Hello, I have ANNKE AC500, again HA ONVIF stopped working.

How I "fixed" mine was to install Hikvision firmware.

This gave me an option to turn off time verification

image

For some reason whatever attempts to correct the time failed.

Regards,

The fundamental problem is that Onvif requires you to put the time value in UTC when encrypting the password.

image

@treppler
Copy link

Hello,

i have the same problem.
In my cam i don't have any posibiltiy turn off time verification.
I think it has something to do with the camera model.
I have to different cmaera modells (Bullett and Dome)
Both cameras using the same ONVIF-version.
The bullet has this issue. New firmware isn't available.
grafik

Homeassistant:
grafik

Nothing was changed on the camera.
This is what the protocol of homeassistant tells:
grafik

@miklosbagi
Copy link

miklosbagi commented Sep 29, 2024

*bump* Annke NC800. I have had to do 2 things to make this work:

  1. DST was set - that needs to be turned off
  2. ONVIF Authentication in configuration > Network > Advanced Settings > Onvif Management. By default this is set to digest. I had to change it to digest/WSSE

@j0chn1
Copy link

j0chn1 commented Oct 15, 2024

The integration returns an http 401 content missing for me.
I found out by this post, https://forum.instar.com/t/onvif-funktioniert-nicht-401-404-411-fehler/29394, that it is related to the digest authentication, but I can't turn it off.
Would be nice to be able to add my INSTAR IN-9408 2k+ POE to HA.

@sakulza
Copy link

sakulza commented Oct 21, 2024

Hello, I have ANNKE AC500, again HA ONVIF stopped working.

How I "fixed" mine was to install Hikvision firmware.

This gave me an option to turn off time verification

image

For some reason whatever attempts to correct the time failed.

Regards,

The same thing just helped me with the IPC-T249HA-LU camera, upgrading the firmware to Firmware_V5.8.4_240613 and disabling 'time verification.'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests