Closed TechHummel 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)
@TechHummel have you got any solution to this problem? I'm having the same issue with Winees IP camera
No, no yet!
Today, I tested it again with the Homeassistant 2023.4.2, but I am still receiving errors:
When using a different time
2023-04-11 22:03:57.169 DEBUG (MainThread) [homeassistant.components.onvif] Starting ONVIF discovery
2023-04-11 22:04:00.180 DEBUG (MainThread) [homeassistant.components.onvif] Discovered ONVIF devices [{'deviceid': None, 'host': '192.168.2.138', 'name': 'IPCAM', 'port': 80}]
2023-04-11 22:04:07.006 DEBUG (MainThread) [homeassistant.components.onvif] Fetching profiles from ONVIF device {'host': '192.168.2.138',
'name': 'IPCAM',
'password': '',
'port': 80,
'username': ''}
2023-04-11 22:04:18.187 INFO (MainThread) [homeassistant.setup] Setting up onvif
2023-04-11 22:04:18.187 INFO (MainThread) [homeassistant.setup] Setup of domain onvif took 0.0 seconds
2023-04-11 22:04:19.290 DEBUG (MainThread) [homeassistant.components.onvif] Setting up the ONVIF device management service
2023-04-11 22:04:19.291 DEBUG (MainThread) [homeassistant.components.onvif] Retrieving current device date/time
2023-04-11 22:04:19.740 DEBUG (MainThread) [homeassistant.components.onvif] Device time: {
'DateTimeType': 'Manual',
'DaylightSavings': False,
'TimeZone': {
'TZ': 'CET-1CEST,M3.5.0,M10.5.0/3'
},
'UTCDateTime': {
'Time': {
'Hour': 22,
'Minute': 4,
'Second': 19
},
'Date': {
'Year': 2023,
'Month': 4,
'Day': 11
}
},
'LocalDateTime': {
'Time': {
'Hour': 20,
'Minute': 4,
'Second': 19
},
'Date': {
'Year': 2023,
'Month': 4,
'Day': 11
}
},
'Extension': None,
'_attr_1': None
}
2023-04-11 22:04:19.745 DEBUG (MainThread) [homeassistant.components.onvif] Device date/time: 2023-04-11 22:04:19+00:00 | System date/time: 2023-04-11 20:04:19.291160+00:00
2023-04-11 22:04:19.746 WARNING (MainThread) [homeassistant.components.onvif] The date/time on IPCAM (UTC) is '2023-04-11 22:04:19+00:00', which is different from the system '2023-04-11 20:04:19.291160+00:00', this could lead to authentication issues
2023-04-11 22:04:19.885 DEBUG (MainThread) [homeassistant.components.onvif] System date (UTC): 2023-04-11 20:04:19.885852+00:00
2023-04-11 22:04:19.888 DEBUG (MainThread) [homeassistant.components.onvif] SetSystemDateAndTime: {
'DateTimeType': 'Manual',
'DaylightSavings': True,
'TimeZone': 'CEST',
'UTCDateTime': {
'Time': {
'Hour': 20,
'Minute': 4,
'Second': 19
},
'Date': {
'Year': 2023,
'Month': 4,
'Day': 11
}
}
}
2023-04-11 22:04:19.914 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry IPCAM - AE:CA:06:04:XX for onvif
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
result = await component.async_setup_entry(hass, self)
File "/usr/src/homeassistant/homeassistant/components/onvif/__init__.py", line 30, in async_setup_entry
if not await device.async_setup():
File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 99, in async_setup
await self.async_check_date_and_time()
File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 246, in async_check_date_and_time
await self.async_manually_set_date_and_time()
File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 179, in async_manually_set_date_and_time
await device_mgmt.SetSystemDateAndTime(dt_param)
File "/usr/local/lib/python3.10/site-packages/zeep/proxy.py", line 64, in __call__
return await self._proxy._binding.send_async(
File "/usr/local/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 164, in send_async
return self.process_reply(client, operation_obj, response)
File "/usr/local/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 181, in process_reply
raise TransportError(
zeep.exceptions.TransportError: Server returned HTTP status 404 (no content available)
and with correct time:
2023-04-11 22:14:18.733 DEBUG (MainThread) [homeassistant.components.onvif] Starting ONVIF discovery
2023-04-11 22:14:21.746 DEBUG (MainThread) [homeassistant.components.onvif] Discovered ONVIF devices [{'deviceid': None, 'host': '192.168.2.138', 'name': 'IPCAM', 'port': 80}]
2023-04-11 22:14:23.917 DEBUG (MainThread) [homeassistant.components.onvif] Fetching profiles from ONVIF device {'host': '192.168.2.138',
'name': 'IPCAM',
'password': '',
'port': 80,
'username': ''}
2023-04-11 22:14:27.947 DEBUG (MainThread) [homeassistant.components.onvif] Setting up the ONVIF device management service
2023-04-11 22:14:27.947 DEBUG (MainThread) [homeassistant.components.onvif] Retrieving current device date/time
2023-04-11 22:14:27.984 DEBUG (MainThread) [homeassistant.components.onvif] Device time: {
'DateTimeType': 'Manual',
'DaylightSavings': False,
'TimeZone': {
'TZ': 'UTC-0'
},
'UTCDateTime': {
'Time': {
'Hour': 20,
'Minute': 14,
'Second': 27
},
'Date': {
'Year': 2023,
'Month': 4,
'Day': 11
}
},
'LocalDateTime': {
'Time': {
'Hour': 20,
'Minute': 14,
'Second': 27
},
'Date': {
'Year': 2023,
'Month': 4,
'Day': 11
}
},
'Extension': None,
'_attr_1': None
}
2023-04-11 22:14:27.986 DEBUG (MainThread) [homeassistant.components.onvif] Device date/time: 2023-04-11 20:14:27+00:00 | System date/time: 2023-04-11 20:14:27.948092+00:00
2023-04-11 22:14:28.239 DEBUG (MainThread) [homeassistant.components.onvif] Camera IPCAM info = DeviceInfo(manufacturer='IPCAM', model='IPC', fw_version='v5.3.1.1811211102', serial_number='gm8135_v2', mac='AE:CA:06:04:XX')
2023-04-11 22:14:29.229 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry IPCAM - AE:CA:06:04:XX for onvif
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
result = await component.async_setup_entry(hass, self)
File "/usr/src/homeassistant/homeassistant/components/onvif/__init__.py", line 30, in async_setup_entry
if not await device.async_setup():
File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 110, in async_setup
self.capabilities = await self.async_get_capabilities()
File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 287, in async_get_capabilities
media_capabilities = await media_service.GetServiceCapabilities()
File "/usr/local/lib/python3.10/site-packages/zeep/proxy.py", line 64, in __call__
return await self._proxy._binding.send_async(
File "/usr/local/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 164, in send_async
return self.process_reply(client, operation_obj, response)
File "/usr/local/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 181, in process_reply
raise TransportError(
zeep.exceptions.TransportError: Server returned HTTP status 404 (no content available)
I tried to investigate the issue further, and I think it is an issue with the library used by the integration (https://github.com/hunterjm/python-onvif-zeep-async) and not the integration itself. Sadly, it seems that it is not possible to open issues for the library.
I wrote a small python script to reproduce the issue without Homeassistant
which produced the same error:
zeep.exceptions.TransportError: Server returned HTTP status 404 (no content available)
but also allowed me to enable a higher log level:
Further, I downloaded an Android app for ONVIF which is working with my IP camera and saved the following debugging log:
I think its this camera https://www.amazon.com/dp/B0BLRKY4BR?th=1
camera showed up. going to see if I can fix it now
The camera doesn't support the media service at all. It doesn't reject it, it just returns a 404 👎
This camera has very limited onvif support.
Events don't work but I can get snapshots by handling the 404s and letting setup proceed
Thanks for looking into this 👍
My camera is this one: https://www.amazon.de/d/B08XVWHHX7 I can gather more information (like soc or a more generic model name) if this would be helpful.
I can also test your pull request in the next couple of days and give you feedback.
Thanks for the link. I ordered that one. It will take a few days to get here. I’ll give it a spin when it arrives and open another pr if there is anything else I can find a fix for
Also you’ll likely need to integrate all my open onvif PRs into a branch to get it to work
I just upgraded to today's dev docker image, which seems to include all your onvif changes. I can now add the camera to homeassistant via the onvif integration. However, I am still receiving a 404 when the time of my camera and homeassistant is different.
Once my camera is added successfully, I am receiving the following error:
Adding the camera took quite long - the capabilities and the profiles step are more than one minute apart.
I haven't had any chance to research the BrokenPipeError yet, but this would be a separte issue anyway.
The test camera showed up. I'm going to see if I can replicate the issue now
So the original one I bought from https://www.amazon.com/dp/B0BLRKY4BR?th=1 is a very similar model but doesn't behave the same.
I can get the setup failure with the one I ordered from amazon.de
The problem
I tried adding a Winees IP camera to my Homeassistant installation with the ONVIF integration. The integration detects the camera and lists it as "IPCAM". When trying to add the camera, I receive an error and the camera cannot be added.
This might be related to https://github.com/home-assistant/core/issues/36523.
The software Agent DVR recognizes the camera and allows streaming the video:
Two video streams are recognized: 1920x1080: rtsp://:PW@192.168.2.138:554/live/XX_p0_XX
I tried using the stream URLs with VLC media player but couldn't get it to work.
What version of Home Assistant Core has the issue?
2022.12.8
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
ONVIF
Link to integration documentation on our website
https://www.home-assistant.io/integrations/onvif/
Diagnostics information
home-assistant_onvif_debug-logs.log
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response