Yes, that means that the camera is not reporting DST properly. Do you understand that both have to be reporting a time for it to be correct? If one of the 2 does not apply the time correctly, they will be off. Home assistant properly applies DST and your local timezone. Otherwise nothing time oriented would work in HA.
Iām sure youāre frustrated with me but you have to understand thereās 3 parts to this:
- Home assistant
- onvif python
- your hardware
I verified that Home asisstant thinks itās getting the correct time from the camera. That means the problem is in onvif python or your hardware.
If onvif python thinks itās getting the correct informationā¦ looking at that code, itās making a call directly from the camera. That means it does nothing with the time (I.e. it doesnāt make it into a datetime object or do anything fancy. It just makes a request to the camera).
That means the issue is in your specific hardware, i.e. the device.
If you look at the old report Onvif integration is not picking up your Timezone Ā· Issue #34522 Ā· home-assistant/core Ā· GitHub you see many reporting the issue with different manufacturers of cameras.
They are all broken - and Home Assistant the only perfect? It could be the case. But it is likely?
I use onvif and all my cameras are fineā¦
So yes, it seems like some of these devices have an issue getting the correct time to HA.
So right now, what does your camera warning say this very moment for UTC?
My cameras say:
2022-04-08 11:12:30.955984+00:00
my home assistant says:
2022-04-08 11:12:30.955984+00:00
the internet says
and Iām smack dab in the middle of DST.
If your camera does not report
then your camera is wrong.
And if by chance HA reports something different, then that means your HA time is set incorrectly.
Naturally Murphy is after me. Now it all works. I did not see this error often. I wonder if it is triggered a specific time of day. Like around midnight. I will be back when it has run for a while.
I did try to set the clock in this camera some days ago but that did not cure the issue. But it was at night. I will report back. Naturally I did not save the exact log entry as there was already 3 bug reports on same problem. That was stupid.
I can see it happen around the DST transition, depending on your timezone that can be different. My TZ applies it at 2am or 3am if itās jump ahead or fall behind. Other TZās do it at 1 am, some at 2:05am. Some at midnight.
Above is the camera time setting.
It is an Amcrest. Normally I have run this camera with the Amcrest integration, but the Amcrest integration is currently broken (author is working on it) so I am using ONVIF as a temporary solution.
The Last Sunday of March is the correct transition for DST in EU incl Denmark where I am
The work around I did was to disable DST and set the Time Zone to GMT+1.
And then changing it back - problem gone. For now. I will let 24 hours pass and report
Your NVR or camera is reporting the wrong time to ONVIF. Here is a screenshot that shows the HA time, a timestamp of one of my cameras, the time reported by the the NVR in ONVIF Device Manager and my laptop time down in the corner.
It is the ONVIF time that is wrong. Not Home Assistant. Thatās why I had it marked as a hardware bug in my config issues. BTW thanks for taking the time to reply there!
Anyway, @petro is correct. The problem lies within the way our NVR/Cameras are reporting the time to ONVIF. It is not likely to ever be resolved.
Strange thing is, I do not see the problem any longer after having upgraded HA and set the time zone of the camera to an extra zone to the east with no DST, followed by setting it back to correct TZ and DST. One of the two cured it. At least for now.
I was also able to suppress the warning. In my case I have to turn DST off in the NVR settings then set the time zone behind (east) in the ONVIF device manager when daylight savings is in effect. This leaves the time and time zone setting in the NVR at the correct values but somehow changes the ONVIF time setting in the NVR so it sends the correct UTC time to HA.
Then when DST ends I see the warning pop back up and I set the time zone back to the correct value in the ONVIF Device Manager. Itās been this way as long as I have been using ONVIF in HA. The problem almost certainly lies within how the Cam/NVRs are reporting time to ONVIF
I actually tried your solution to see if it would work for me, but it did not.
I found that with a āwhite labelā ONVIF IP camera, Home Assistant would set the date correctly, but would not set the timezone.
So this curl request can set the timezone:
curl --verbose --http1.1 --header Accept: --header "Content-Type: application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver10/device/wsdl/SetSystemDateAndTime"" --header "Connection: close" --user-agent "Happytime onvif client V11.6" --data-binary "<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:pt="http://www.onvif.org/ver10/pacs" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" xmlns:tac="http://www.onvif.org/ver10/accesscontrol/wsdl" xmlns:tdc="http://www.onvif.org/ver10/doorcontrol/wsdl" xmlns:tth="http://www.onvif.org/ver10/thermal/wsdl" xmlns:tcr="http://www.onvif.org/ver10/credential/wsdl" xmlns:tar="http://www.onvif.org/ver10/accessrules/wsdl" xmlns:tsc="http://www.onvif.org/ver10/schedule/wsdl" xmlns:trv="http://www.onvif.org/ver10/receiver/wsdl" xmlns:tpv="http://www.onvif.org/ver10/provisioning/wsdl" xmlns:ter="http://www.onvif.org/ver10/error" ><s:Body><tds:SetSystemDateAndTime><tds:DateTimeType>Manual</tds:DateTimeType><tds:DaylightSavings>false</tds:DaylightSavings><tds:TimeZone><tt:TZ>GMT+12:00</tt:TZ></tds:TimeZone><tds:UTCDateTime><tt:Time><tt:Hour>15</tt:Hour><tt:Minute>34</tt:Minute><tt:Second>57</tt:Second></tt:Time><tt:Date><tt:Year>2023</tt:Year><tt:Month>6</tt:Month><tt:Day>17</tt:Day></tt:Date></tds:UTCDateTime></tds:SetSystemDateAndTime></s:Body></s:Envelope>" http://192.168.37.90:8888/onvif/device_service
Edit as required for your needs