core: ONVIF: TP-Link Tapo Camera Motion not working after firmware upgrade (port 1024 is unresponsive in newer firmware, webhook messages not delivered)

Working firmware table : https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/312#issue-1664283878

The problem

Hello.

I have 2 different cameras: 1 C200 running on 1.3.5 Build 230307 Rel.6847n(4555) contains string ‘hol’ in it’s name 1 C210 running on 1.3.0 Build 220830 Rel.69909n(4555) contains string ‘living’ in it’s name

For some time, the motion sensor from C200 is not working. Usually when I had this issue, it was fixed after a restart of HA or reboot of the camera. The C210 one is still working as expected.

image

I have enabled the debug on the two entities and got the attached log. I cannot see any ERRORS, maybe you can spot something that it shouldn’t be there.

This has already been discussed in the Tapo Control issues : https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/312

What version of Home Assistant Core has the issue?

core-2023.4.5

What was the last working version of Home Assistant Core?

core-2023.4.5

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

home-assistant_2023-04-19T10-04-13.732Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Please check https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/files/11270254/home-assistant_2023-04-19T07-20-50.421Z.log for more logs.

Additional information

Might not be ONVIF fault, maybe it’s a bad firmware from TP-Link?

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 59 (27 by maintainers)

Most upvoted comments

The above PRs are in 2023.5.2

I have sent an email to local TP-Link support email support.ro@tp-link.com

I’ll get back if I get any replies.

To close the loop on our discord conversation iSpy/Agent DVR doesn’t appear to be using events and is doing local processing so thats a dead end.

Given that the port 1024 is closed on 1.3.4 and it still works… Is it possible the camera gets stuck on a call to “filtered” port 1024 and never gets a response thus leading into loop? Could we ignore any communication other than on port 2020?

Just thinking out loud here, I do not know how onvif actually works under the hood.

We really can’t do anything about it. Tplink has to fix it. Its clearly broken too deep in the internals.

@JurajNyiri Unrelated to this, but I’m going to make some changes onvif library to fix some I/O in the event loop. They will require awaiting in more places.

I’m bdraco#6479 on discord if you need assistance processing the changes once they get published.

Screenshot 2023-04-30 at 10 15 39 AM

No firmware update available. I wonder if tplink pulled that firmware

Looks like there was a fix found in this topic : JurajNyiri/HomeAssistant-Tapo-Control#312

If the issue is not in firmware, it will need to be fixed here – in HA onvif. My last updates just implement the new onvif version introduced in the latest dev versions. If you would like to help further, enable debug logs for onvif with latest DEV version of HA and post them here. Make sure to disable tapo integration and use only onvif, to prevent noise or wrong implementation in Tapo custom integration.

2023-04-20 09:39:09.611 DEBUG (MainThread) [custom_components.onvif] Tapo_Camera_8A28: Device does not support notification service or too many subscriptions: illegal status line: bytearray(b'POST /onvif/service\x00HTTP/1.1\x00\x00Host\x00 192.168.0.129: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')

Thats not good. It looks like there might be a bug in the firmware

I updated the firmware on my C320WS and now I have the same problem. If I find a workaround, I’ll post it, but I think we have to wait for them to fix the firmware at this point.

I forgot to add the version key to the manifest when I made it a custom component. Please try pulling again

mkdir -p /config/custom_components
cd /config/custom_components
git clone https://github.com/bdraco/onvif
cd /config/custom_components/onvif
git pull
git log -1

Restart

The git log -1 should should 7c65f84f1269b814bf9b61eba116eaf04d0e13cb