JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
968 stars 81 forks source link

C500 working, but problems when adding it #422

Closed rtollevik closed 9 months ago

rtollevik commented 9 months ago

Description

I have the integration running with several C500 outdoor pan/tilt cameras. But adding the cameras fail with a misleading error message if both the Tapo Care cloud service (the cameras comes with an initial 30-days trial period) and a local memory card is installed. When this is true, the camera disables the RTSP stream, or NVR as the camera calls it in its warning message. And adding the camera fails with the error message:

"Invalid authentication data. Make sure you have created your 3rd party account via Tapo app. You can also test if these credentials work via rtsp stream, for example VLC using link rtsp://username:password@IP Address:554/stream1"

The camera is successfully added if the memory card is removed during that process. After reinstalling the memory card the live stream stops functioning, but everything else appears to be OK.

The problem is that isRtspStreamWorking returns false in its final statement when the image is empty, which causes an "Invalid authentication data" exception to be raised in config_flow.py

Reproduction Steps

Add a camera where both its cloud service and a local memory card is in use

Expected behavior

Adding the camera should succeed

If applicable, add error logs.

No response

Device Firmware

1.0.6 Build 230609 Rel.72971n

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

Docker on Raspberry PI

Search for similar issues

Yes

Additional information

No response

JurajNyiri commented 9 months ago

This is documented in TPLink FAQ. RTSP stream is disabled when both recording and cloud is enabled. No way how to detect this from integration side.