core
core copied to clipboard
[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
onvif documentation onvif source (message by IssueLinks)
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!
(message by CodeOwnersMention)
looks like others are also facing the same issue: https://community.home-assistant.io/t/2022-8-you-can-fix-it/446505/248
I'm having a very similar error, mine seems coming from a time setting error and bringing to an authenticating error:
Couldn't connect to camera 'I91BL', please verify that the credentials are correct. Error: Invalid data 09:56:23 – (ERRORE) ONVIF The date/time on I91BL (UTC) is '2022-08-07 15:56:22+00:00', which is different from the system '2022-08-07 14:56:23.239885+00:00', this could lead to authentication issues 09:56:23 – (AVVISO) ONVIF
Also for me it raised up after upgrade to 2022.8. The camera is added correclty under ONVIF integration but not added nor visible between devices The internal camera is correct, syncronized with local time etc...
edit: It's seems to be solved with one of these actions: I tried to force several time the time auto sync from camera menu. I set the legal-solar auto change (otherwise 1 hour of delay was remaining). Now integration works withour errors
Hi, had the same problem and is indeed solved triggering the NTP on the camera. I am using a HIKVISION DS-2CD2347G2-L.
Also solved With NTP Set on 👍👍
Setting NTP on my cameras worked for a while, restarting HA brings the problems back.
Some problem here. Ntp solves the issue for a while only
After restart or Update HA have to Set NTP in my Cam Off and On again. And Than reload the Integration . Than it works again till next Update or HA restart..... So it will Not stay Work permanently. I Hope the Problem will be fixed.....
+1 in 2022.8.3
I have the same issue in 2022.8.3 with imou/dahua cameras.
+1. 2022.8.3. Camera Victure PC650
Same issue here, both on Dahua and Reolink.
same problem with Imou camera's HA 2022.8.0, 2022.8.1, 2022.8.2 and 2022.8.3
I think this issue have all brands and cams which don´t use for default NTP.
My cameras have NTP configured and date and time are correct, so NTP alone is not the issue.
same problem with Imou camera's HA 2022.8.0, 2022.8.1, 2022.8.2 and 2022.8.3
+1 same for me too.. :( ..but interesting that only one of the Imou camera of the 4 previously configured still working. Nothing have been changed at the IP cam side. The problem started with the update to the HA version 2022.8.0 and it persist with the 2022.8.3.
Anyone tested with 2022.8.4?
Yes tested, but its the same issue, now with 2022.8.4 it´s no more working here, also with NTP ON no entity shown and Cam so not shown in the Lovelace :-( . With 8.0 above with NTP its working. But it´s strange in 8.4 in ONVIF Integration there is in changelog no Error shown. In older Version before shown NTP Error. But now nothing.....
Same here, Supervisor 2022.08.3 Operating System 8.4 Frontend 20220802.0 - latest Camera Victure PC730
Motion Eye run the Cam and Time Date are correct, NTP alone is not the issue
Same here, Dahua ip-cam at HA 2022.7.6 everything is OK, after update to 2022.8.4 can't connect for my Dahua. I restored 2022.7.6
With my Imou I'm also getting this error, but it seems to be the Home Assistant that has the wrong time set??
Couldn't connect to camera 'Lechange', please verify that the credentials are correct. Error: Invalid data
2:12:20 PM – (ERROR) ONVIF
The date/time on Lechange (UTC) is '2022-08-14 13:12:19+00:00', which is different from the system '2022-08-14 12:12:20.497007+00:00', this could lead to authentication issues
2:12:20 PM – (WARNING) ONVIF
The system time is wrong here. I checked and my timezone is set to Amsterdam as it should be. I enabled NTP on my camera as some suggested, but clearly it's Home Assistant that's in the wrong here. There doesn't seem to be a way to set the system time??
My platform is Raspberry Pi 3 with the hassio image.
Looks like daylight saving time settings mismatch between camera and home assistant?
Just updated to 2022.8.4 (from .3) since onvif motion detection stopped working, all of a sudden (for all cameras at once). After the update to .4 I can't test if the motion detection is working, since I am at work, but I have picture from all cameras except one and 3 errors regarding onvif and leechange in the log:
Logger: homeassistant.bootstrap
Source: bootstrap.py:435
First occurred: 00:02:59 (1 occurrences)
Last logged: 00:02:59
Waiting on integrations to complete setup: onvif
Logger: homeassistant.components.onvif
Source: components/onvif/device.py:129
Integration: ONVIF ([documentation](https://www.home-assistant.io/integrations/onvif), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+onvif%22))
First occurred: 00:03:38 (5 occurrences)
Last logged: 00:10:50
Couldn't connect to camera 'Lechange', but will retry later. Error:
Logger: homeassistant.components.onvif
Source: components/onvif/camera.py:147
Integration: ONVIF ([documentation](https://www.home-assistant.io/integrations/onvif), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+onvif%22))
First occurred: 00:06:18 (6 occurrences)
Last logged: 00:07:20
Fetch snapshot image failed from Lechange, falling back to FFmpeg; Unknown error:
Edit: Motion detection is working too.
I updated to 2022.8.5 and it fixed the issue for me. My doorbell and indoor camera is visible again in Home Assistant.
Here not fixed with 8.5. :-( But it´s working with NTP Setting again. 8.4 also this not working.
Logger: homeassistant.components.onvif Source: components/onvif/device.py:137 Integration: ONVIF (documentation, issues) First occurred: 11:05:44 (1 occurrences) Last logged: 11:05:44
Couldn't connect to camera 'General', please verify that the credentials are correct. Error: Invalid data
Do you have NTP turned on for the cameras?
Yes. With 8.1, 8.2. 8.3 and new 8.5 its working With NTP. 8.4 before also Not working With NTP.
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.

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

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!
@mabusdogma and you test a HA reboot after that ?
Yes, a lot of reboots, cause I was installing and checking a lot of things... Everything goes well
Here same issue with 8.5, after restart i have to do the Step NTP set OFF and ON and ONVIF integration reload again for work.
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.
Problem remains in 2022.8.6
Frustrating to have all security cameras disabled on reboot. Kinda defeats the purpose.
It works for me now, so not sure if this are actually several different bugs?
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
At the end, I gave up: Now I'm using WebRTC, a HACS integration like onvif, but with less lag. You need to configure it like rtsp (look for documentation if you try).
El vie, 26 ago 2022 9:22 p. m., yang3535 @.***> escribió:
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
— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/76368#issuecomment-1228836265, or unsubscribe https://github.com/notifications/unsubscribe-auth/AESCMAXC6HLHXYEL5V4GC5DV3EKOFANCNFSM55ZOA4TA . You are receiving this because you were mentioned.Message ID: @.***>
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.
Exact the Same here with my expensive Blaupunkt cams.
I have two Imou (Dahua) cams and one of them is working fine and the second stopped working two days ago. I've tried to change the timezone to London (UTC+0) and for now it is working. Anyway I think it is not the normal operation. Hope to be solved in next system updates.