slydiman / ha_custom_onvif

11 stars 2 forks source link

2021.12.12 error #5

Open leranp opened 2 years ago

leranp commented 2 years ago

Started after the update of onvif component, my Ha is 2021.12.1 via docker

Traceback (most recent call last):
File "/config/custom_components/onvif/zeeep/xsd/types/builtins.py", line 181, in pythonvalue
return isodate.parse_datetime(value)
File "/usr/local/lib/python3.9/site-packages/isodate/isodatetime.py", line 55, in parse_datetime
tmpdate = parse_date(datestring)
File "/usr/local/lib/python3.9/site-packages/isodate/isodates.py", line 201, in parse_date
return date(sign * int(groups['year']),
ValueError: month must be in 1..12

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/onvif/zeeep/xsd/types/simple.py", line 79, in parse_xmlelement
return self.pythonvalue(xmlelement.text)
File "/config/custom_components/onvif/zeeep/xsd/types/builtins.py", line 44, in _wrapper
return func(self, re.sub(r"[\n\r\t ]", " ", value).strip())
File "/config/custom_components/onvif/zeeep/xsd/types/builtins.py", line 183, in pythonvalue
raise ValueError("Invalid datetime '{}'".format(value))
ValueError: Invalid datetime '2485-13-13T18:14:13Z'
slydiman commented 2 years ago

Right, it is a known issue.

The first exception is generated by the updated library zeep. But the error message month must be in 1..12 is not useful. I have added more useful logging to see the original wrong datetime. 2485-13-13T18:14:13Z is really an incorrect datetime. 2485 is incorrect year and 13 is incorrect month. It seems this wrong datetime is reported by the camera. I have no idea what to do in this case. It seems the camera and the integration still work with these errors. Hope we can just ignore them. But now you know that your camera can response such datetime. Probably it is already fixed, so check for the camera firmware update.

leranp commented 2 years ago

Right, it is a known issue.

The first exception is generated by the updated library zeep. But the error message month must be in 1..12 is not useful. I have added more useful logging to see the original wrong datetime. 2485-13-13T18:14:13Z is really an incorrect datetime. 2485 is incorrect year and 13 is incorrect month. It seems this wrong datetime is reported by the camera. I have no idea what to do in this case. It seems the camera and the integration still work with these errors. Hope we can just ignore them. But now you know that your camera can response such datetime. Probably it is already fixed, so check for the camera firmware update.

Thank you for the reply, My camera doesn't have an firmware update , the date was fine before the 2021.12.12 update. But in the end everything is working fine.