JurajNyiri / HomeAssistant-Tapo-Control

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

Feature Request: Access Recordings on SD #40

Closed giovanne123 closed 1 year ago

giovanne123 commented 3 years ago

First of all, thanks a lot for the great work. I have a C200 running in HA very well.

Is there a way to access, download the recordings on the SD card of the Tapo C200? (right after motion is/was detected) Or alternatively and maybe better to start a recording on HA side if motion is detected?

Currently there is the lack of feature in C200 firmware to directly record to ftp, cloud, ... instead if only to the SD card. So the SD card can be stolen and every record is away :-(

I know this request is normally more a todo for TP-Link to add the possibility in their C200 firmware, but maybe there is also a way within your HA-Tapo-Control. There are lot's of requests in the TP-Link forum but no progress so far...

JurajNyiri commented 3 years ago

Hello,

I would also love a way to get the videos out of SD card. It is possible to watch the videos via app so should be possible to do via API.

When someone discovers a way to download the videos by RE I will add it to Tapo library and then maybe also here when I figure a Home Assistant friendly implementation.

I am not doing RE myself to make sure not to break the TOS of Tapo (even when I am pretty sure it would be ok because of device interoperability clause in law but I want to be on the safe side).

Pytapo, library which I am using for this integration has a Feature Request opened here: https://github.com/JurajNyiri/pytapo/issues/4

JurajNyiri commented 3 years ago

In the mean time, you could record via Home Assistant instead, by using https://www.home-assistant.io/integrations/camera/ record service. Using automation trigger binary sensor, initiate recording.

peslung commented 3 years ago

In the mean time, you could record via Home Assistant instead, by using https://www.home-assistant.io/integrations/camera/ record service. Using automation trigger binary sensor, initiate recording.

Using the motion trigger and automation myself. Tip that worked for me is to enable Preload stream on the camera and define lookback in the recording. This will start the record xx seconds before the motion event started


data:  
  filename: '/media/movement_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4'  
  duration: 10  
  lookback: 10  
entity_id: camera.camgar_mainstream
JurajNyiri commented 3 years ago

We are almost there and need help! More information at pytapo feature request.

RestOp commented 3 years ago

In the mean time, you could record via Home Assistant instead, by using https://www.home-assistant.io/integrations/camera/ record service. Using automation trigger binary sensor, initiate recording.

It do not work. Not it works, but the it freezes and give and continious error till HA restated. So this function us unuseful

Electronlibre2012 commented 2 years ago

Hello!

First, big thank you to @JurajNyiri for this awesome integration!

it works with the sd or hd stream provide with the TAPO integration camera.yourcam_hd, with the servoce camera.record of HA, i have video in .mp4 done, but i get this warning in the log : Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 2304x1296): unspecified pixel format Consider increasing the value for the 'analyzeduration' (10000000) and 'probesize' (5000000) options

Any idea please to solve this?

Thanks

JurajNyiri commented 2 years ago

@Electronlibre2012 there is an issue opened about that and its not this one. Please keep discussion on topic.

leaskovski commented 2 years ago

Chucking my thoughts on this in as well. If this could open up recordings to be accessible via the "Media" interface in HA, similar to say how the reolink plugin works, that would be awesome!

lucamir commented 2 years ago

I recently buy a tapo c200 cam and i would like to write a python script that download the local SD recorded videos after the alarm was triggered. I see that the function getMediaSession use the cloud password that involve that i need a paid plan. So i just wanna ask you if there's any https request that for access to that local files and if there's any sort of webhook for trigger the event ?

JurajNyiri commented 2 years ago

I see that the function getMediaSession use the cloud password that involve that i need a paid plan.

That is an incorrect assumption. Cloud password is not used for cloud, just a different type of account (fully local).

So i just wanna ask you if there's any https request that for access to that local files and if there's any sort of webhook for trigger the event ?

No, check this thread and connected https://github.com/JurajNyiri/pytapo/issues/4 for more info.

JurajNyiri commented 1 year ago

This is now possible super easily via a script.

https://github.com/JurajNyiri/pytapo#downloading-recordings

Home Assistant way coming in the future.

JurajNyiri commented 1 year ago

This is now available in beta releases.

Bastiencc commented 1 year ago

Awesome 👍 is there a way to download/synchronize those recording to local storage (on hassOs) ?

JurajNyiri commented 1 year ago

Not currently, you can play recordings on demand on the latest version 5.0.0. It will stay cached for 24 hours.

Bastiencc commented 1 year ago

ok thanks @JurajNyiri , do you think this will be something doable in the future?

JurajNyiri commented 1 year ago

Yes I plan to implement it.

pdsakurai commented 1 year ago

Hi @JurajNyiri! Thank you and your team for making Tapo cameras integrated very well in Hass.

May I know how I can use the Media Browser in Hass? I already tried re-adding my tapo cameras but I cannot fihure out how to access the media browser.

Found it when accessed directly in browser. 😅 I cannot remember how I removed it in the app. Gonna reset the Hass app.

Sorry for the trouble.

pikajuicy commented 1 year ago

Hi, thanks for making this available for everyone. Just wondering if it is possible to run this on a NAS. I have an Asustor AS5202T and hope to run this script on my NAS for retrieving recordings stored locally on my Tapo C110 and C320WS.

JurajNyiri commented 1 year ago

https://github.com/JurajNyiri/pytapo#downloading-recordings might be better for your use case @pikajuicy especially if you are not already running HA.

Bastiencc commented 1 year ago

Yes I plan to implement it.

Hello, I come to the news, to know if you still think that it will be possible?

JurajNyiri commented 1 year ago

Hi, I've been busy and haven't gotten to it yet. I will try to find some time soon, or if anyone else wants to open pr it is welcomed.

JurajNyiri commented 1 year ago

Media Sync is now available in https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.3.0.beta.1 .