Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tapo Cameras: Motion sensor gets stuck #92604

Closed
JurajNyiri opened this issue May 5, 2023 · 4 comments · Fixed by JurajNyiri/HomeAssistant-Tapo-Control#331 or #92551
Closed

Tapo Cameras: Motion sensor gets stuck #92604

JurajNyiri opened this issue May 5, 2023 · 4 comments · Fixed by JurajNyiri/HomeAssistant-Tapo-Control#331 or #92551
Assignees

Comments

@JurajNyiri
Copy link

JurajNyiri commented May 5, 2023

The problem

Tapo C200 | HW 1.0 | 1.1.16

*I also see this on HW 3.0 1.3.4, but providing logs/info/images for 1.1.16

image
image
image
image
2023.5.1_1.1.16.log

  • It keeps on switching onvif ports, fairly fast. (This seems like the main issue for Tapo cameras to me and main difference to April)
  • When it does not get stuck, it has some inconsistencies like clearing state in the middle of the movement and setting it instantly back (see screenshots above)
  • Gets stuck depending on when the renewal happens
  • Sometimes get into a long loop of retrying(?) when there is no movement but somehow event still keep coming in?
  • After finishing "infinite" loop ending at 2023-05-05 10:41:00, got stuck on Detected
  • After that it was unable to regain subscription until 2023-05-05 08:43:07.119 when it went back to Clear, where it got stuck
  • It was stuck until the end when I stopped testing and at 2023-05-05 10:46:23 hit the stop button in docker.

PR #92551

This PR introduces retry functionality to retry failed renewals. @bdraco reports that it has made his HW 3.0 1.3.4 and C320WS work flawlessly like before. I tried this, and it made my HW 3.0 1.3.4 time out and gets stuck in Detected. On my 1.1.18 HW 1.0 it behaves first the same as on stable version of HA (2023.5.1) but after a while gets into infinite event receival loop. This can be noticed at :53:57 -- the time when it started looping through ports again, starting with port 1024 for the second time in the run. Loop continues and happens even if there is no movement.

image
417d46_1.1.18.log

Side note

I am developer of https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/ . Several users reported this behaviour, for example here or here.

I was able to restore original flawless working functionality on all of my cameras(*except the ones with unrelated firmware issue) by including the old version 0e8f139) of onvif integration (I use EventManager from it) along with onvif-zeep-async==1.2.11.
This is really not a long term solution, and we should work on getting this fixed upstream -- here.

What version of Home Assistant Core has the issue?

core-2023.5.1

What was the last working version of Home Assistant Core?

core-2023.4.6

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

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented May 5, 2023

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!

Code owner commands

Code owners of onvif can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign onvif Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


onvif documentation
onvif source
(message by IssueLinks)

@bdraco
Copy link
Member

bdraco commented May 5, 2023

Digging through the logs some more it seems that the more frequent renewals trigger the loop bug in these cameras.

I don’t think we can get rid of them though as we know the subscription will stop working on cameras that don’t have this bug if we don’t renew it before it expires.

@bdraco
Copy link
Member

bdraco commented May 5, 2023

I would say that I hope tplink can fix the underlying problem with the firmware but my experience with the Kasa line is that things usually get worse and not better for local control options with firmware updates

@bdraco
Copy link
Member

bdraco commented May 5, 2023

We found the root cause.

The camera has a bug where interrupts 10 minutes as 10 seconds so the subscription gets canceled prematurely.

If we express the time in seconds everything works

@github-actions github-actions bot locked and limited conversation to collaborators Jun 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants