Skip to content

Commit 19733c0

Browse files
tchellomellofabaff
authored andcommitted
Extend Ring doorbell camera documentation by adding a python_script to download the video (home-assistant#3705)
1 parent 4dd901a commit 19733c0

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

source/_components/camera.ring.markdown

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,41 @@ Configuration variables:
3131
**Note:** To be able to playback the last capture, it is required to install the `ffmpeg` component. Make sure to follow the steps mentioned at [FFMPEG](https://home-assistant.io/components/ffmpeg/) documentation.
3232

3333
Currently it supports doorbell and stickup cameras.
34+
35+
36+
## {% linkable_title Saving locally the videos captured by your Ring Door Bell %}
37+
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+
40+
- Add to the `configuration.yaml` the `downloader` and `python_scripts`. Visit the component page for further details.
41+
42+
```json
43+
python_script:
44+
downloader:
45+
download_dir: downloads
46+
```
47+
- Create a file `ring_downloader.py` in the folder `<config>/python_scripts` and give it this content:
48+
49+
```python
50+
# obtain ring doorbell camera object
51+
# replace the camera.front_door by your camera entity
52+
ring_cam = hass.states.get('camera.front_door')
53+
54+
subdir_name = 'ring_{}'.format(ring_cam.attributes.get('friendly_name'))
55+
56+
# get video URL
57+
data = {
58+
'url': ring_cam.attributes.get('video_url'),
59+
'subdir': subdir_name,
60+
}
61+
62+
# call downloader component to save the video
63+
hass.services.call('downloader', 'download_file', data)
64+
```
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)