JurajNyiri / HomeAssistant-Tapo-Control

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

1.3.9: Can't view media (401) #462

Closed eskey0 closed 7 months ago

eskey0 commented 7 months ago

Description

I'm having issues with the media playback, Im getting error 401 (that is what HA says) and if I try again it says its downloading, but it is not. I tried changing passwords for cloud and local account, and hard resseting the camera and re-adding it in app and HA. Iam probably missing something important here but I can't figure out

I have a firewall in between the camera and the HA instance, actually with ports 8800, 2020, 443, 554 open from the server to the cam, I tried with all communication allowed without success.

it is a tapo c200, camera in 1.3.9 integration in 5.4.6 I can do playback from the app

https://imgur.com/a/c57vB1Z

Reproduction Steps

1.- Reboot HA 2.- Go to media, camera, any record 3.- Try to play the video and get the error

Expected behavior

Watch the recorded video in the SD card from the cam

If applicable, add error logs.

No response

Device Firmware

1.3.9

Integration Version

5.4.6

Using stream component

No

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

Official image in proxmox VM

Search for similar issues

Yes

Additional information

I can provide any logs or make any tests

JurajNyiri commented 7 months ago

In firmware 1.3.9 along other things, only for some cameras, they changed 443 communication to use SHA256 encryption instead of MD5 encryption. Sometimes it is MD5, sometimes it is SHA256. Maybe they changed it for the media stream on 8800 as well.

I tested download with my camera on 1.3.9 and it still works as expected.

We might need to change it in pytapo in many places which currently md5 the admin password to do sha256 instead (and automatically detect correct hashing algorithm) It would be very hard for me to debug this without a target device to test on, so you could try doing this:

Let me know how it goes and what you changed (create PR please), then I can automate the detection.

You could also port forward the camera and send me credentials via email so that I can use it to test and develop a fix, that would be the most efficient solution. That is how we implemented control support on 1.3.9 firmware thanks to 2 users sharing their cameras for me to test on.

JurajNyiri commented 7 months ago

Fixed in https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.4.7 .