Update ring.markdown (#21724)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Rob_R 2022-02-21 22:01:13 +00:00 committed by GitHub
parent cfa6494ff8
commit 4ef7a89755
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,7 +59,7 @@ downloader:
download_dir: downloads
```
Then you can use the following automation, with the entities from your system, which will save the video file under `<config>/downloads/ring_<camera_name>/`:
Then you can use the following automation, with the entities from your system, which will save the video file under `<config>/downloads/<camera_name>/<camera_name>/`:
{% raw %}
@ -80,6 +80,19 @@ automation:
{% endraw %}
You may consider some modifications in the subdirectory and the filename to suit your needs. For example, you can add the date and the time and extension to the downloaded file:
{% raw %}
```yaml
data:
url: "{{ state_attr('camera.front_door', 'video_url') }}"
subdir: "{{ state_attr('camera.front_door', 'friendly_name') }}/{{ now().strftime("%m.%Y") }}"
filename: "{{ now().strftime("%Y-%m-%d-at-%H-%M-%S") }}.mp4"
```
{% endraw %}
the above modification will save the video file under `<config>/downloads/<camera_name>/YYYY-MM/YYYY-MM-DD-at-HH-MM-SS.mp4`. You can change the date according to your localization format.
If you want to use `python_script`, enable it your `configuration.yaml` file first:
```yaml