Skip to content

Commit b60cc24

Browse files
authored
Merge pull request home-assistant#3890 from arsaboo/current
Added instructions to save Ring video file using automation
2 parents ad2baa4 + 47c0165 commit b60cc24

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

source/_components/camera.ring.markdown

+19-14
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,30 @@ Configuration variables:
3232

3333
Currently it supports doorbell and stickup cameras.
3434

35+
## {% linkable_title Saving the videos captured by your Ring Door Bell %}
3536

36-
## {% linkable_title Saving locally the videos captured by your Ring Door Bell %}
37+
You can save locally the latest video captured by your Ring Door Bell using the [downloader](/components/downloader) along with either an [automation](/components/automation) or [python_script](/components/python_script). First, enable the [downloader](/components/downloader) component in your configuration by adding the following to your `configuration.yaml`.
3738

38-
You can save locally the latest video captured by your Ring Door Bell by enabling the [downloader](/components/downloader) and the [python_scripts](/components/python_script) components.
39+
```yaml
40+
downloader:
41+
download_dir: downloads
42+
```
43+
Then you can use the following `action` in your automation (this will save the video file under `<config>/downloads/ring_<camera_name>/`):
3944

40-
- Add to the `configuration.yaml` the `downloader` and `python_scripts`. Visit the component page for further details.
45+
```yaml
46+
action:
47+
- service: downloader.download_file
48+
data_template:
49+
url: "{{ states.camera.front_door.attributes.video_url }}"
50+
subdir: "{{states.camera.front_door.attributes.friendly_name}}"
51+
filename: "{{states.camera.front_door.attributes.friendly_name}}"
52+
```
4153

42-
```json
54+
If you want to use `python_script`, enable it your `configuration.yaml` file first:
55+
```yaml
4356
python_script:
44-
downloader:
45-
download_dir: downloads
4657
```
47-
- Create a file `ring_downloader.py` in the folder `<config>/python_scripts` and give it this content:
58+
You can then use the following `python_script` to save the video file:
4859

4960
```python
5061
# obtain ring doorbell camera object
@@ -57,15 +68,9 @@ subdir_name = 'ring_{}'.format(ring_cam.attributes.get('friendly_name'))
5768
data = {
5869
'url': ring_cam.attributes.get('video_url'),
5970
'subdir': subdir_name,
71+
'filename': ring_cam.attributes.get('friendly_name')
6072
}
6173
6274
# call downloader component to save the video
6375
hass.services.call('downloader', 'download_file', data)
6476
```
65-
66-
- Start Home Assistant
67-
- Call the server `python_script/ring_downloader`
68-
69-
You should be able to see a video file saved under `<config>/<downloader_dir>/ring_<camera_name>/`.
70-
71-
You can also automate the process by integrating it with the (automation)[/components/automation) component.

0 commit comments

Comments
 (0)