Closed jarrodsfarrell closed 1 year 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!
(message by CodeOwnersMention)
onvif documentation onvif source (message by IssueLinks)
For convenience, the relevant files and lines: https://github.com/home-assistant/core/blob/83704f03342741611d8c2dba20b4ca88309c960a/homeassistant/components/onvif/button.py#L41-L54 https://github.com/home-assistant/core/blob/83704f03342741611d8c2dba20b4ca88309c960a/homeassistant/components/onvif/device.py#L155-L179 Looks like there's a debug logging here. And enabling debug...
2023-04-05 02:22:32.956 DEBUG (MainThread) [homeassistant.components.onvif] System date (UTC): 2023-04-05 06:22:32.956536+00:00
2023-04-05 02:22:32.965 DEBUG (MainThread) [homeassistant.components.onvif] SetSystemDateAndTime: {
'DateTimeType': 'Manual',
'DaylightSavings': True,
'TimeZone': 'EDT',
'UTCDateTime': {
'Time': {
'Hour': 6,
'Minute': 22,
'Second': 32
},
'Date': {
'Year': 2023,
'Month': 4,
'Day': 5
}
}
}
2023-04-05 02:22:32.969 DEBUG (MainThread) [zeep.transports] HTTP Post to http://192.168.254.18:80/onvif/device_service:
b'\nadminC9VJHaOB4O9wAAfslFOpQGFKdQM=dTYipPzOpfnkiECkwvlZfA==2023-04-05T06:22:32+00:00ManualtrueEDT62232202345'
2023-04-05 02:22:33.017 DEBUG (MainThread) [zeep.transports] HTTP Response from http://192.168.254.18:80/onvif/device_service (status: 500):
b'\r\nenv:Sender\r\nter:InvalidArgVal\r\nter:InvalidTimeZone\r\n\r\n\r\n\r\nInvalid data\r\n\r\n\r\n\r\n\r\n'
There's our smoking gun.
env:Sender ter:InvalidArgVal ter:InvalidTimeZone Invalid data'
Looks like my camera doesn't understand EDT
, and I sort-of recall the timezones being jank on these cameras when working with them before.
So I might need a toggle to switch between giving the timezone, supplying a fake one, or just send the time sans timezone.
And the specification: https://github.com/quatanium/python-onvif/blob/09ffc65b8cd9d141b6a386804e7af7028755034e/wsdl/devicemgmt.wsdl#L351-L376 Okay, time is being sent in UTC. If I could instead just send local time and kludge it by saying the camera is now in UTC.
Or run a purposefully misconfigured NTP server.
I went across my cameras and it seems like they do not have an option for a daylight savings timezone; only EST
.
Instead it's set as a separate option that has to be configured.
Unfortunately not only is our cameras EOL, our state will probably permanently change to EDT
due to the Sunshine Protection Act.
For anyone else that should come here, I'm using Chrony, a NTP server, that's available to the cameras. Then the cameras are configured to use it to sync and configured the cameras with correct daylight savings settings.
For anyone else that should come here, I'm using Chrony, a NTP server, that's available to the cameras. Then the cameras are configured to use it to sync and configured the cameras with correct daylight savings settings.
Hi, How to configure cameras with this Chrony add-on??
@Artekbed I'm using the default configuration for the Chrony addon, though I have the luxury of a VM with a server connected to the Camera network. So I needed to add a bridge for the interface with NetPlan on the host and add another interface to the HA VM with it connected to the new bridge.
The problem
Clicking the provided button to update the date and time causes an exception. See provided logs.
Maybe something's up with how HA's sending the date/time that's causing Zeep to panic.Nope turns out it's because of my camera not having daylight savings timezones.What version of Home Assistant Core has the issue?
core-2023.3.6
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://www.home-assistant.io/integrations/onvif/
Diagnostics information
config_entry-onvif-c8b47ded00b2935b18071ed09d1c4d5a.json.txt
Example YAML snippet
No response
Anything in the logs that might be useful for us?