Closed mahuttoro 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)
I have exactly same issue.
Camera Model: C320WS Firmware: 1.0.4 Build 221031 Rel.40874n (latest)
Homeassistant Version: 2023.1.1 (EDIT: Same issue also with 2023.1.4)
same issue with different model:
Camera Model: C225 Firmware: 1.0.12
Homeassistant Version: 2023.1.4
Hi,
The exception indicates that the camera responds with a generic error code: HTTP/1.1 500 Internal Server Error
This error is the response for the method create_pullpoint_subscription
. It might actually be that the camera does not support "PullPoint subscriptions". At this moment the Onvif integration does not seem to first validate if the camera indicates to support this functionality.
It would help if you would enable extra logging. Especially the "zeep.transports" will help to find the reason for the error. The logging of "zeep.transports" will result in the communication with the camera to be logged. In the log you should be able to find strings related to "Capabilities".
logger:
default: error
logs:
homeassistant.components.onvif.camera: info
homeassistant.components.camera: info
zeep.transports: debug
My camera does support PullPoint-subscription and i can see this snippet in the Capability-response of my camera:
<tt:Events>
<tt:XAddr>http://192.168.178.175:80/onvif/Events</tt:XAddr>
<tt:WSSubscriptionPolicySupport>true</tt:WSSubscriptionPolicySupport>
<tt:WSPullPointSupport>true</tt:WSPullPointSupport>
<tt:WSPausableSubscriptionManagerInterfaceSupport>false</tt:WSPausableSubscriptionManagerInterfaceSupport>
</tt:Events>
Hope this helps...
Hi,
In my case (Tapo C320WS, version 1.0.4 Build 221031 Rel.40874n) it looks like the camera reports to support PullPoint:
<tt:Events>
<tt:XAddr>http://192.168.4.114:2020/onvif/service</tt:XAddr>
<tt:WSSubscriptionPolicySupport>true</tt:WSSubscriptionPolicySupport>
<tt:WSPullPointSupport>true</tt:WSPullPointSupport>
<tt:WSPausableSubscriptionManagerInterfaceSupport>false</tt:WSPausableSubscriptionManagerInterfaceSupport>
</tt:Events>
But for me the method create_pullpoint_subscription
seems to cause the issue as well as @GrumpyMeow explains above:
2023-01-23 10:00:19.749 DEBUG (MainThread) [zeep.transports] HTTP Post to http://192.168.4.114:2020/onvif/service:
b'<?xml version=\'1.0\' encoding=\'utf-8\'?>\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope">
<soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Action>http://www.onvif.org/ver10/events/wsdl/EventPortType/CreatePullPointSubscriptionRequest</wsa:Action>
<wsa:MessageID>urn:uuid:8a3be80f-0771-43a4-8ed6-851934240ff6</wsa:MessageID>
<wsa:To>http://192.168.4.114:2020/onvif/service</wsa:To>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>homeassistant</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">xxx</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">xxx</wsse:Nonce>
<wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-01-23T08:00:19+00:00</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap-env:Header>
<soap-env:Body>
<ns0:CreatePullPointSubscription xmlns:ns0="http://www.onvif.org/ver10/events/wsdl"/>
</soap-env:Body>
</soap-env:Envelope>'
2023-01-23 10:00:19.805 ERROR (MainThread) [custom_components.tapo_control] Unexpected error fetching Tapo resource status data: illegal status line: bytearray(b'POST /onvif/service\x00HTTP/1.1\x00\x00Host\x00 192.168.4.114:2020\x00\x00Accept\x00 */*\x00\x00Accept-Encoding\x00 gzip, deflate, br\x00\x00Connection\x00 keep-alive\x00\x00User-Agent\x00 ZeHTTP/1.1 500 Internal Server Error')
Full zeep.transports:debug
log:
Tapo_C320WS.log
I couldn't get this to work either, and re-adding the cameras didn't work. Today, it sprung to mind that I disabled Motion detection on the outside cameras via the Tapo app last week. I did this because my NAS runs Surveillance Station, which not only allows you to define zones / areas of interest, it has the ability to detect motion in those zones / areas.
To verify that (me turning off motion detection on the camera using the Tapo app) caused the problem, I just enabled motion detection in the app for one of the outside cameras. And, lo and behold, the Cell Motion detection sensor instantly became available again in the ONVIF integration:
I am still missing the PTZ controls via ONVIF, which is why I reverted to the custom component for Tapo Cameras.
Camera: C320WS Harware Version: 2 Firmware: 1.0.4 Build 221031 Rel. 40874n
Homeassistant Version: 2023.2.5
Same problem with https://github.com/home-assistant/core/issues/85902#issuecomment-1399963159 If you need more info I will be happy to provide
Capabilities snippet
2023-02-24 09:40:18.271 DEBUG (MainThread) [zeep.transports] HTTP Response from http://192.168.1.124:2020/onvif/device_service (status: 200):
b'
...
<tt:Events>
<tt:XAddr>http://192.168.1.124:2020/onvif/service</tt:XAddr>
<tt:WSSubscriptionPolicySupport>true</tt:WSSubscriptionPolicySupport>
<tt:WSPullPointSupport>true</tt:WSPullPointSupport>
...
And the error
2023-02-24 09:40:18.718 DEBUG (MainThread) [zeep.transports] HTTP Post to http://192.168.1.124:2020/onvif/service:
b'
<?xml version=\'1.0\' encoding=\'utf-8\'?>\n
<soap-env:Envelope
xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope">
<soap-env:Header
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Action>http://www.onvif.org/ver10/events/wsdl/EventPortType/CreatePullPointSubscriptionRequest</wsa:Action>
<wsa:MessageID>urn:uuid:7373c6b1-0bf0-4b10-9a35-fe08562014d2</wsa:MessageID>
<wsa:To>http://192.168.1.124:2020/onvif/service</wsa:To>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>akarta</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">REDUCTED</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">REDUCTED</wsse:Nonce>
<wsu:Created
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-02-24T07:40:18+00:00
</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap-env:Header>
<soap-env:Body>
<ns0:CreatePullPointSubscription
xmlns:ns0="http://www.onvif.org/ver10/events/wsdl"/>
</soap-env:Body>
</soap-env:Envelope>'
2023-02-24 09:40:18.732 ERROR (MainThread) [custom_components.tapo_control] Unexpected error fetching Tapo resource status data: illegal status line: bytearray(b'POST /onvif/service\x00HTTP/1.1\x00\x00Host\x00 192.168.1.124:2020\x00\x00Accept\x00 */*\x00\x00Accept-Encoding\x00 gzip, deflate, br\x00\x00Connection\x00 keep-alive\x00\x00User-Agent\x00 ZeHTTP/1.1 500 Internal Server Error')
i have this problem.. after I disabled motion on camera it won't work in HA even after Enabling it again. all that time the tapo App is receiving the motion notifications though
Unfortunately, nothing changed with 2023.3.5. The issue still persists.
I'm having the same issues with my 320ws cameras as well. I just installed them hoping to replace my current ring doorbell camera, but I need the motion sensor to work. If you need someone to provide logs or anything, I'm happy to do so.
Thanks for your effort! Could you please explain how to test?
Is it just replacing the client.py? I have replaced the client.py and the event.py. Unfortunately, the issue still persists.
You need onvif-zeep-async 1.2.3 which isn't released yet
Fix is now included in https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.0.0.beta.7. Thank you!
@AndreiArdelean1 reported that the issue is still not fixed in onvif-zeep-async 1.2.3.
I encountered the same issue with a Tapo C225 and discovered that the request fails if no InitialTerminationTime
is passed in the CreatePullPointSubscription
request.
It works for me if I change https://github.com/hunterjm/python-onvif-zeep-async/blob/async/onvif/client.py#L350 to
pullpoint = await events.CreatePullPointSubscription(
{"InitialTerminationTime": "PT2H"}
)
I'm willing to PR this but I don't know what a sensible default value should be.
Is it the same error? I have tried with Tapo C500, with the lastest HA version (2023.4.0), I have not the motion detection binary sensor too.
Unexpected error fetching Tapo resource status data: illegal status line: bytearray(b'POST /onvif/service\x00HTTP/1.1\x00\x00Host\x00 192.168.1.63:2020\x00\x00Accept\x00 */*\x00\x00Accept-Encoding\x00 gzip, deflate, br\x00\x00Connection\x00 keep-alive\x00\x00User-Agent\x00 ZeeHTTP/1.1 500 Internal Server Error')
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
yield
File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 188, in _receive_event
event = self._h11_state.next_event()
File "/usr/local/lib/python3.10/site-packages/h11/_connection.py", line 487, in next_event
exc._reraise_as_remote_protocol_error()
File "/usr/local/lib/python3.10/site-packages/h11/_util.py", line 77, in _reraise_as_remote_protocol_error
raise self
File "/usr/local/lib/python3.10/site-packages/h11/_connection.py", line 469, in next_event
event = self._extract_next_receive_event()
File "/usr/local/lib/python3.10/site-packages/h11/_connection.py", line 411, in _extract_next_receive_event
event = self._reader(self._receive_buffer)
File "/usr/local/lib/python3.10/site-packages/h11/_readers.py", line 104, in maybe_read_from_SEND_RESPONSE_server
matches = validate(status_line_re, lines[0], "illegal status line: {!r}", lines[0])
File "/usr/local/lib/python3.10/site-packages/h11/_util.py", line 91, in validate
raise LocalProtocolError(msg)
h11._util.RemoteProtocolError: illegal status line: bytearray(b'POST /onvif/service\x00HTTP/1.1\x00\x00Host\x00 192.168.1.63:2020\x00\x00Accept\x00 */*\x00\x00Accept-Encoding\x00 gzip, deflate, br\x00\x00Connection\x00 keep-alive\x00\x00User-Agent\x00 ZeeHTTP/1.1 500 Internal Server Error')
I encountered the same issue with a Tapo C225 and discovered that the request fails if no
InitialTerminationTime
is passed in theCreatePullPointSubscription
request.It works for me if I change https://github.com/hunterjm/python-onvif-zeep-async/blob/async/onvif/client.py#L350 to
pullpoint = await events.CreatePullPointSubscription( {"InitialTerminationTime": "PT2H"} )
I'm willing to PR this but I don't know what a sensible default value should be.
@pierrebateau: How can i test this? Is there a file where i can add these lines of code? i can't find the file with 'find -iname client.py' on my HA
@bdraco: should we re-open this ticket? The new Version of onvif hasn't fix the error.
Reopened it. Works for me now with the latest firmware in the camera.
someone who can replicate will need to pick it up and fix it as I no longer have a valid test case
@thomasramm It works for me if I change the line in /usr/local/lib/python3.10/site-packages/onvif/client.py
@thomasramm It works for me if I change the line in /usr/local/lib/python3.10/site-packages/onvif/client.py
i don't have the python3.10 folder, if i try to go for this folder in ha terminal. in the terminal it shows me core-ssh$ i guess im in the wrong docker conatiner. So i tried to connect to the core os via this tutorial: https://developers.home-assistant.io/docs/operating-system/debugging/. after i connected to the basic os, i found the script in the folder: /mnt/data/docker/overlay2/b725a088fa592f72edc7163b25228033fa1994580b2b006a8b897eed48cde389/diff/usr/local/lib/python3.10/site-packages/onvif i add the line and restart the server. Now, it seems that the authentication error is gone, no more error messages. But the motion sensor still not comming up (the cam is in front of mee, lots of detection in app, camera restarted, ha restarted) ???
From https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/308
Errors log:
Logger: custom_components.tapo_control
Source: components/onvif/event.py:89
Integration: Tapo: Cameras Control ([documentation](https://github.com/JurajNyiri/HomeAssistant-Tapo-Control), [issues](https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues))
First occurred: 18:08:47 (293 occurrences)
Last logged: 19:22:15
Unexpected error fetching Tapo resource status data: illegal status line: bytearray(b'POST /onvif/service\x00HTTP/1.1\x00\x00Host\x00 192.168.1.111:2020\x00\x00Accept\x00 */*\x00\x00Accept-Encoding\x00 gzip, deflate\x00\x00Connection\x00 keep-alive\x00\x00User-Agent\x00 Zeep/4HTTP/1.1 500 Internal Server Error')
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
yield
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/http11.py", line 188, in _receive_event
event = self._h11_state.next_event()
File "/srv/homeassistant/lib/python3.10/site-packages/h11/_connection.py", line 487, in next_event
exc._reraise_as_remote_protocol_error()
File "/srv/homeassistant/lib/python3.10/site-packages/h11/_util.py", line 77, in _reraise_as_remote_protocol_error
raise self
File "/srv/homeassistant/lib/python3.10/site-packages/h11/_connection.py", line 469, in next_event
event = self._extract_next_receive_event()
File "/srv/homeassistant/lib/python3.10/site-packages/h11/_connection.py", line 411, in _extract_next_receive_event
event = self._reader(self._receive_buffer)
File "/srv/homeassistant/lib/python3.10/site-packages/h11/_readers.py", line 104, in maybe_read_from_SEND_RESPONSE_server
matches = validate(status_line_re, lines[0], "illegal status line: {!r}", lines[0])
File "/srv/homeassistant/lib/python3.10/site-packages/h11/_util.py", line 91, in validate
raise LocalProtocolError(msg)
h11._util.RemoteProtocolError: illegal status line: bytearray(b'POST /onvif/service\x00HTTP/1.1\x00\x00Host\x00 192.168.1.111:2020\x00\x00Accept\x00 */*\x00\x00Accept-Encoding\x00 gzip, deflate\x00\x00Connection\x00 keep-alive\x00\x00User-Agent\x00 Zeep/4HTTP/1.1 500 Internal Server Error')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
yield
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
raise exc
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
response = await connection.handle_async_request(request)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/connection.py", line 90, in handle_async_request
return await self._connection.handle_async_request(request)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/http11.py", line 112, in handle_async_request
raise exc
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/http11.py", line 91, in handle_async_request
) = await self._receive_response_headers(**kwargs)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/http11.py", line 155, in _receive_response_headers
event = await self._receive_event(timeout=timeout)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/http11.py", line 187, in _receive_event
with map_exceptions({h11.RemoteProtocolError: RemoteProtocolError}):
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc)
httpcore.RemoteProtocolError: illegal status line: bytearray(b'POST /onvif/service\x00HTTP/1.1\x00\x00Host\x00 192.168.1.111:2020\x00\x00Accept\x00 */*\x00\x00Accept-Encoding\x00 gzip, deflate\x00\x00Connection\x00 keep-alive\x00\x00User-Agent\x00 Zeep/4HTTP/1.1 500 Internal Server Error')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py", line 250, in _async_refresh
self.data = await self._async_update_data()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py", line 206, in _async_update_data
return await self.update_method()
File "/home/homeassistant/.homeassistant/custom_components/tapo_control/__init__.py", line 234, in async_update_data
await setupOnvif(hass, entry)
File "/home/homeassistant/.homeassistant/custom_components/tapo_control/utils.py", line 550, in setupOnvif
hass.data[DOMAIN][entry.entry_id]["eventsSetup"] = await setupEvents(
File "/home/homeassistant/.homeassistant/custom_components/tapo_control/utils.py", line 560, in setupEvents
if await events.async_start():
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/onvif/event.py", line 89, in async_start
if not await self.device.create_pullpoint_subscription():
File "/srv/homeassistant/lib/python3.10/site-packages/onvif/client.py", line 350, in create_pullpoint_subscription
pullpoint = await events.CreatePullPointSubscription()
File "/srv/homeassistant/lib/python3.10/site-packages/zeep/proxy.py", line 64, in __call__
return await self._proxy._binding.send_async(
File "/srv/homeassistant/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 156, in send_async
response = await client.transport.post_xml(
File "/srv/homeassistant/lib/python3.10/site-packages/zeep/transports.py", line 234, in post_xml
response = await self.post(address, message, headers)
File "/srv/homeassistant/lib/python3.10/site-packages/zeep/transports.py", line 219, in post
response = await self.client.post(
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1848, in post
return await self.request(
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1533, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1620, in send
response = await self._send_handling_auth(
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1648, in _send_handling_auth
response = await self._send_handling_redirects(
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1685, in _send_handling_redirects
response = await self._send_single_request(request)
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1722, in _send_single_request
response = await transport.handle_async_request(request)
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_transports/default.py", line 352, in handle_async_request
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.RemoteProtocolError: illegal status line: bytearray(b'POST /onvif/service\x00HTTP/1.1\x00\x00Host\x00 192.168.1.111:2020\x00\x00Accept\x00 */*\x00\x00Accept-Encoding\x00 gzip, deflate\x00\x00Connection\x00 keep-alive\x00\x00User-Agent\x00 Zeep/4HTTP/1.1 500 Internal Server Error')
Logger: custom_components.tapo_control
Source: components/onvif/event.py:104
Integration: Tapo: Cameras Control ([documentation](https://github.com/JurajNyiri/HomeAssistant-Tapo-Control), [issues](https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues))
First occurred: 18:13:18 (15 occurrences)
Last logged: 19:20:18
Unexpected error fetching Tapo resource status data:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 111, in connect_tcp
stream: anyio.abc.ByteStream = await anyio.connect_tcp(
File "/srv/homeassistant/lib/python3.10/site-packages/anyio/_core/_sockets.py", line 213, in connect_tcp
async with create_task_group() as tg:
File "/srv/homeassistant/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 662, in __aexit__
raise exceptions[0]
File "/srv/homeassistant/lib/python3.10/site-packages/anyio/_core/_sockets.py", line 164, in try_connect
stream = await asynclib.connect_tcp(remote_host, remote_port, local_address)
File "/srv/homeassistant/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 1691, in connect_tcp
await get_running_loop().create_connection(
File "/usr/lib/python3.10/asyncio/base_events.py", line 1049, in create_connection
sock = await self._connect_sock(
File "/usr/lib/python3.10/asyncio/base_events.py", line 960, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/lib/python3.10/asyncio/selector_events.py", line 500, in sock_connect
return await fut
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
yield
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 110, in connect_tcp
with anyio.fail_after(timeout):
File "/srv/homeassistant/lib/python3.10/site-packages/anyio/_core/_tasks.py", line 118, in __exit__
raise TimeoutError
TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
yield
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
raise exc
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
response = await connection.handle_async_request(request)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/connection.py", line 86, in handle_async_request
raise exc
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/connection.py", line 63, in handle_async_request
stream = await self._connect(request)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/connection.py", line 111, in _connect
stream = await self._network_backend.connect_tcp(**kwargs)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/backends/auto.py", line 29, in connect_tcp
return await self._backend.connect_tcp(
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp
with map_exceptions(exc_map):
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc)
httpcore.ConnectTimeout
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py", line 250, in _async_refresh
self.data = await self._async_update_data()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py", line 206, in _async_update_data
return await self.update_method()
File "/home/homeassistant/.homeassistant/custom_components/tapo_control/__init__.py", line 234, in async_update_data
await setupOnvif(hass, entry)
File "/home/homeassistant/.homeassistant/custom_components/tapo_control/utils.py", line 550, in setupOnvif
hass.data[DOMAIN][entry.entry_id]["eventsSetup"] = await setupEvents(
File "/home/homeassistant/.homeassistant/custom_components/tapo_control/utils.py", line 560, in setupEvents
if await events.async_start():
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/onvif/event.py", line 104, in async_start
response = await pullpoint.PullMessages(
File "/srv/homeassistant/lib/python3.10/site-packages/zeep/proxy.py", line 64, in __call__
return await self._proxy._binding.send_async(
File "/srv/homeassistant/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 156, in send_async
response = await client.transport.post_xml(
File "/srv/homeassistant/lib/python3.10/site-packages/zeep/transports.py", line 234, in post_xml
response = await self.post(address, message, headers)
File "/srv/homeassistant/lib/python3.10/site-packages/zeep/transports.py", line 219, in post
response = await self.client.post(
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1848, in post
return await self.request(
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1533, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1620, in send
response = await self._send_handling_auth(
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1648, in _send_handling_auth
response = await self._send_handling_redirects(
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1685, in _send_handling_redirects
response = await self._send_single_request(request)
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1722, in _send_single_request
response = await transport.handle_async_request(request)
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_transports/default.py", line 352, in handle_async_request
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectTimeout
Today, I made a clean fresh install of HA on RPI for testing. Only with needed Add-on and Integrations:
Hardware
Installation
HA configuration changes from default
There is an error 500 in the log if onvif try to register the motion sensor event. I add a line to the onvif component see my prev comment, now the error in the log is away. The Debug Log shows me "Motion sensor or time sync is enabled" and "Motion sensor: OK". Still no motion sensor in HA. Both logs are appended.
For further testing i do the following:
maybe the attached log with zeep.transport debugging help for further investigation (after my code change). It seems that there is no error message on registration, but still no motion message is recived by HA (I don't know how a good log looks like, but i can't find error or warn messages)
These camera run out of subscriptions quickly. https://github.com/home-assistant/core/pull/91485 should help with that
The problem
When adding a Tapo C320WS to HA via ONVIF integration or Tapo custom component, which uses ONVIF for motion detection, the motion detection binary sensor does not appear. A Tapo C110 works flawlessly.
What version of Home Assistant Core has the issue?
core-2023.1.1
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
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response