JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
1.17k stars 89 forks source link

Can't add C200 camera / Already have other two C200 camera working with the same config #600

Closed mzspicoli closed 6 months ago

mzspicoli commented 6 months ago

Description

Hello,

I have 3 cameras model C200 and one C100.

I could add without any problem two C200 and the one C100. But there is a C200, apparently with the same configs, connected to the same router as the others that I can't connect. I've got the Depuration Report, hope it helps.

The devices that are working have the ip from 192.168.178.201 to 192.168.178.205. The one that is not connecting is 192.168.178.200. The camera is working well in the Tapo app and the "Camera Account" is also on, with the same user and password as the others.

The error is "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" Tapo C.pdf home-assistant_tapo_control_2024-05-30T14-34-10.401Z.log

Reproduction Steps

Step 1: User left click in "Settings – Home Assistant and 1 more page - Personal - Microsoft​ Edge" Step 2: User mouse wheel down in "Settings – Home Assistant and 1 more page - Personal - Microsoft​ Edge" Step 3: User left click on "Tapo: Cameras Control ()" in "Settings – Home Assistant and 1 more page - Personal - Microsoft​ Edge" Step 4: User left click in "Settings – Home Assistant and 1 more page - Personal - Microsoft​ Edge" Step 5: User keyboard input on "Settings – Home Assistant and 1 more page - Personal - Microsoft​ Edge (window)" in "Settings – Home Assistant and 1 more page - Personal - Microsoft​ Edge" [...] Step 6: User left click in "Settings – Home Assistant and 1 more page - Personal - Microsoft​ Edge" Step 7: User keyboard input on "Settings – Home Assistant and 1 more page - Personal - Microsoft​ Edge (window)" in "Settings – Home Assistant and 1 more page - Personal - Microsoft​ Edge" [... Tab ...] Step 8: User left click in "Settings – Home Assistant and 1 more page - Personal - Microsoft​ Edge"

Expected behavior

Adding the camera without problem. But appearing "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" before it asks for the cloud password.

If applicable, add error logs.

No response

Device Firmware

1.3.13 Build 240327 Rel.63336n(4555)

Integration Version

5.4.13

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

Camera connected to wifi router

Search for similar issues

Yes

Additional information

No response

JurajNyiri commented 6 months ago

Thank you for your report.

See FAQ for this error, you are probably hitting the limit of camera for rtsp. If nothing helps, post debug logs and we will be able to see the exact issue.

mzspicoli commented 6 months ago

Thanks for the quickly reply. The debug can be found here home-assistant_tapo_control_2024-05-30T14-34-10.401Z.log I can confirm that the RTSP of the camera is not being used by other apps.

JurajNyiri commented 6 months ago

The last message in there is "2024-05-30 13:55:33.767 DEBUG (MainThread) [custom_components.tapo_control] [ADD DEVICE][192.168.178.200] Showing config flow for Camera Account."

Once you input the data, you should also see "[ADD DEVICE][%s] Verifying Camera Account." and others.

mzspicoli commented 6 months ago

Yes I removed some parts because the file had 50mbs. Please download the complete version from gdrive. https://drive.google.com/file/d/1gmwUMhnHYUMRmxXGo2IPrLq0YLtkJH9a/view?usp=drive_link

mzspicoli commented 6 months ago

Managed to zip it. 001 tapo.zip

JurajNyiri commented 6 months ago

RTSP stream returned invalid authentication data error.

This happens if the received image bytes is empty.

Since it works for other cameras I assume ffmpeg and environment is correctly set up.

Try it inside vlc, see if rtsp://{username}:{password}@{host}:554/stream1 works.

Honestly, there is not much that can be fixed on integration side, this specific camera is returning no data to HA, for some reason. That could be due to it being overloaded (see FAQ) or bad environment setup (that you ruled out by other cameras working).

If nothing else helps, to rule out it being overloaded, I would suggest

  1. Factory reset
  2. Before connecting it, set a different IP for it (to rule out anything else querying the rtsp, I know you have said that there is nothing else using it, but others said that as well and it was not correct, so to rule that out)
  3. See if it works