twrecked / hass-aarlo

Asynchronous Arlo Component for Home Assistant
GNU Lesser General Public License v3.0
383 stars 77 forks source link

Old file when requesting a snapshot/video file #905

Open bbo76 opened 5 months ago

bbo76 commented 5 months ago

When I call the service to request a video or snapshot with file, the file downloaded is an old media. Wich service I need to call to record a new snapshot or video from now ?

twrecked commented 5 months ago

This service aarlo.camera_request_video_to_file should do the job.

Is that the one you are using?

bbo76 commented 5 months ago

yes but the file is not taking from now but it's an old file...

bbo76 commented 5 months ago

It looks like the file isn't overwrite. I tried to clear media folder and the snapshot is fresh image. Home Assistant by default not support overwrite files ?

twrecked commented 5 months ago

I'll take a look. It's probably the way I'm doing it.

bbo76 commented 5 months ago

I have another question, If I'm true, we need to call the recording service before call the request video file ? So if we have no cloud subscription this feature work or we need to put HDD or usb drive on the base station to save media ?

Pete118 commented 1 month ago

Any updates on this?

twrecked commented 3 weeks ago

It's working as expected for me. This is the code that writes the snapshot to a file, the call to open() with w will overwrite the file.

            # Get and write snapshot
            snapshot = camera.get_snapshot()
            with open(snapshot_file, "wb") as out_file:
                out_file.write(snapshot)

Can you turn on and send me some debug, something else must be going wrong. I also don't know the answer to the "recording without subscription" but maybe the debug will help here.

Debug instructions are here, you should go with verbose.