core: [2022.8.1] ONVIF integration failing with "Couldn't connect to camera x, please verify that the credentials are correct. Error: Invalid data"

The problem

I’ve Amcrest NVR and cameras. Everything was working well in 2022.6.6. But today I upgraded to 2022.8.1 and the ONVIF integration started to fail with:

2022-08-06 15:31:23.822 ERROR (MainThread) [homeassistant.components.onvif] Couldn't connect to camera 'AC', please verify that the credentials are correct. Error: Invalid data

What version of Home Assistant Core has the issue?

2022.8.1

What was the last working version of Home Assistant Core?

2022.6.6

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

onvif

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2022-08-06 15:31:23.822 ERROR (MainThread) [homeassistant.components.onvif] Couldn't connect to camera 'AC', please verify that the credentials are correct. Error: Invalid data

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 45

Most upvoted comments

too long this issue open. since august is a long time 😦

I just wanted to add my voice to this. I hadn’t updated since the July Release, I finally just got around to updating, and instantly it broke my cameras. (I also had to update all of my MQTT entities in configuration.yaml, but that was easy enough). I dug through the logs and found that the issue is that Home Assistant thinks that its an hour ahead of the camera time. EVERYTHING on my Network is sync’d to my Local NTP Server, so the camera’s are displaying the correct time. The weird thing is, The Time Zone is set correctly in Home Assistant, so it is displaying the correct time, its just that it doesn’t seem to take in consideration Daylight Savings time, only when trying to authenticate with the cameras.

The only fix I could find was either setting Home Assistant an hour ahead, which sucks for home assistant, or by taking off daylight savings time in my Cameras, and then putting them on the time zone that is an hour ahead. Then it authenticates just fine. Its only a week until Daylight savings time is over, so I can just set my cameras back on DST then, but wish I wouldn’t have to do this at all. It would be nice if whatever August update broke this would be reviewed and fixed in the next release. Just wanted to communicate that this was still an issue, in the latest release as of now, 2022.10.5. Thank you!

Here is a copy of the relevant log entry, and as I said above, both Home Assistant and the Camera’s were set with the correct exact time (and both are set to the Pacific US Time Zone, which for me is is -8 UTC), its just that for when authenticating to the camera, Home Assistant forgets to take into account Daylight Savings Time:

image

EDIT: Actually, I had my analysis backwards. Home Assistant is taking DST into consideration with its own time when attempting to authenticate to all of my cameras on the network, however, with every single camera, its NOT taking DST into consideration with regards to each camera’s reported time. Therefore it thinks the time that each camera is reporting is exactly one hour ahead of the actual current time, and as a consequence is not authenticating. Before the updates (I was on 2022.7.4 before updating to 2022.10.5) it authenticated with each camera just fine, and what’s even weirder is this isn’t just one brand. I am using Axis, Reolink, Camius, and Dahua Camera’s on my network, and before the updates it authenticated to each just fine, it was only after this update that it started claiming there was a time mismatch.

Anyways, I just wanted to correct the record, its not Home Assistant’s time that is misreporting, its the camera’s time.

Hi, had the same problem and is indeed solved triggering the NTP on the camera. I am using a HIKVISION DS-2CD2347G2-L.

Solved! And I hope it works for you: I have a Victure IPC360 camera… No NTP on settings. My error log says I’m in GMT, even if I’m in Spain… No idea why.

Screenshot_20220816-171218_Pixel Launcher

So, I change the setting on my camera, to be in ‘London’ ( XX time + 00), then I came back to the onvif and press refresh… And I’ve got 5 entities Screenshot_20220816-171048_Pixel Launcher

3 for different resolutions of the camera, one to reset and a new one to set date and time. I haven’t even pressed it since the camera works just fine!

Same issue here, both on Dahua and Reolink.

I have the same issue in 2022.8.3 with imou/dahua cameras.

I still have the problem after upgrading to 2022.8.7.

I have Amcrest Cameras which have a problem with keeping the NTP setting applied, so while I can enable NTP on each camera. it doesn’t stay enabled. So every time I restart HA, I have to enable NTP on every camera and reload each camera integration.

Logger: homeassistant.components.onvif
Source: components/onvif/device.py:137
Integration: ONVIF (documentation, issues)
First occurred: August 25, 2022 at 7:21:52 PM (6 occurrences)
Last logged: August 25, 2022 at 7:44:42 PM

Couldn't connect to camera 'FrontPorch', please verify that the credentials are correct. Error: Invalid data
Couldn't connect to camera 'Sunroom', please verify that the credentials are correct. Error: Invalid data
Couldn't connect to camera 'Doorbell', please verify that the credentials are correct. Error: Invalid data
Couldn't connect to camera 'Greatroom', please verify that the credentials are correct. Error: Invalid data
Couldn't connect to camera 'Garage', please verify that the credentials are correct. Error: Invalid data

Problem remains in 2022.8.6

Frustrating to have all security cameras disabled on reboot. Kinda defeats the purpose.

Having the same problem with my Imou (Dahua) camera sinds HA core 2022.8.x therefore restored to HA 2022.7.7 Now After installing HA core 2022.8.5 and changing the camera timezone on the camera to UTC as @mabusdogma suggested, the Onvif integration worked. But now the time on the camera has 2hour offset. HA timezone is set to utc+1 Amsterdam. So can we say the root cause is at the timezone and daylight savingtime in HA core sinds v 2022.8.x ?

https://github.com/home-assistant/core/issues/68216 Is also mentioning this issue.

Yes, a lot of reboots, cause I was installing and checking a lot of things… Everything goes well

+1. 2022.8.3. Camera Victure PC650

+1 in 2022.8.3

Some problem here. Ntp solves the issue for a while only

Setting NTP on my cameras worked for a while, restarting HA brings the problems back.

looks like others are also facing the same issue: https://community.home-assistant.io/t/2022-8-you-can-fix-it/446505/248