JurajNyiri / HomeAssistant-Tapo-Control

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

Unable to add Tapo C500, invalid authentication data error #493

Closed martinrosenauer closed 9 months ago

martinrosenauer commented 9 months ago

Description

Updated C500 PTZ camera to firmware 1.1.2 build 231107 and are trying to add it to Home Assistant 2023.12.4. Unfortunately account is not being accepted, even though it works fine in VLC and Frigate.

Accessing the camera from outside Home Assistant using pytapo apparently works

from pytapo import Tapo user = "admin" password = "tapo_pasword" host = "10.0.0.100" tapo = Tapo(host, user, password) print(tapo.getBasicInfo())

Reproduction Steps

  1. Update to 1.1.2 build 231107 on the app
  2. Try to add camera in Tapo: Cameras Control integration

Expected behavior

It would get added

If applicable, add error logs.

Dec 28 22:11:50 hass hass[3877873]: 2023-12-28 22:11:50.642 DEBUG (MainThread) [custom_components.tapo_control] [ADD DEVICE][10.0.0.100] Verifying Camera Account. Dec 28 22:11:50 hass hass[3877873]: 2023-12-28 22:11:50.642 DEBUG (MainThread) [custom_components.tapo_control] [ADD DEVICE][10.0.0.100] Verifying ports all required camera ports. Dec 28 22:11:50 hass hass[3877873]: 2023-12-28 22:11:50.649 DEBUG (MainThread) [custom_components.tapo_control] [ADD DEVICE][10.0.0.100] All camera ports are opened. Dec 28 22:11:50 hass hass[3877873]: 2023-12-28 22:11:50.649 DEBUG (MainThread) [custom_components.tapo_control] [ADD DEVICE][10.0.0.100] Testing RTSP stream. Dec 28 22:11:50 hass hass[3877873]: 2023-12-28 22:11:50.650 DEBUG (MainThread) [custom_components.tapo_control] [isRtspStreamWorking][10.0.0.100] Testing RTSP stream. Dec 28 22:11:50 hass hass[3877873]: 2023-12-28 22:11:50.650 DEBUG (MainThread) [custom_components.tapo_control] [isRtspStreamWorking][10.0.0.100] Creating image frame. Dec 28 22:11:50 hass hass[3877873]: 2023-12-28 22:11:50.650 DEBUG (MainThread) [custom_components.tapo_control] [isRtspStreamWorking][10.0.0.100] Encoding username and password. Dec 28 22:11:50 hass hass[3877873]: 2023-12-28 22:11:50.650 DEBUG (MainThread) [custom_components.tapo_control] [isRtspStreamWorking][10.0.0.100] Getting image from rtsp://HIDDEN_USERNAME:HIDDEN_PASSWORD@10.0.0.100:554/stream1. Dec 28 22:11:50 hass hass[3877873]: 2023-12-28 22:11:50.656 DEBUG (MainThread) [custom_components.tapo_control] [isRtspStreamWorking][10.0.0.100] Image data received. Dec 28 22:11:50 hass hass[3877873]: 2023-12-28 22:11:50.657 DEBUG (MainThread) [custom_components.tapo_control] [ADD DEVICE][10.0.0.100] RTSP stream returned invalid authentication data error. Dec 28 22:11:50 hass hass[3877873]: 2023-12-28 22:11:50.657 DEBUG (MainThread) [custom_components.tapo_control] [ADD DEVICE][10.0.0.100] Showing config flow for Camera Account.

Device Firmware

1.1.2 build 231107

Integration Version

5.4.12

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

No

HASS Environment

Core in Virtual Environment

Search for similar issues

Yes

Additional information

No response

JurajNyiri commented 9 months ago

Read faq, you are overloading camera.

martinrosenauer commented 9 months ago

Thanks for the quick response @JurajNyiri , I've read the FAQ already, but not entirely sure if it's related to overloading. I've waited a couple of hours without anything changing. What puzzles me is that PyTapo connects and returns information from tapo.getBasicInfo() without problems on the account (and from the same IP as Home Assistant is running). I've stopped Frigate and the IOS app to make sure that no RTSP is being streamed. Any good suggestions on what other things I can try ?

JurajNyiri commented 9 months ago

Pytapo control != RTSP stream. It is overloaded if it returns 401 for RTSP stream which it does for you.

martinrosenauer commented 9 months ago

Fully aware there's a difference between the Tapo cloud account (which I believe is what PyTapo is using for the getBasicInfo() method) and the RTSP account. Ok, haven't found a way around this situation and believe i have to stick with the "Generic Camera" in Home Assistant for now then. (Which works with the RTSP account of the Tapo C500).

Thanks anyway, @JurajNyiri, for a great integration!

Inglan commented 5 months ago

Create a camera account under camera > settings > advanced settings and use that