diff --git a/source/_components/camera.ring.markdown b/source/_components/camera.ring.markdown index c383381eaf78..854c77f55198 100644 --- a/source/_components/camera.ring.markdown +++ b/source/_components/camera.ring.markdown @@ -32,19 +32,30 @@ Configuration variables: Currently it supports doorbell and stickup cameras. +## {% linkable_title Saving the videos captured by your Ring Door Bell %} -## {% linkable_title Saving locally the videos captured by your Ring Door Bell %} +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`. -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. +```yaml +downloader: + download_dir: downloads +``` +Then you can use the following `action` in your automation (this will save the video file under `/downloads/ring_/`): - - Add to the `configuration.yaml` the `downloader` and `python_scripts`. Visit the component page for further details. +```yaml +action: + - service: downloader.download_file + data_template: + url: "{{ states.camera.front_door.attributes.video_url }}" + subdir: "{{states.camera.front_door.attributes.friendly_name}}" + filename: "{{states.camera.front_door.attributes.friendly_name}}" +``` -```json +If you want to use `python_script`, enable it your `configuration.yaml` file first: +```yaml python_script: -downloader: - download_dir: downloads ``` - - Create a file `ring_downloader.py` in the folder `/python_scripts` and give it this content: +You can then use the following `python_script` to save the video file: ```python # obtain ring doorbell camera object @@ -57,15 +68,9 @@ subdir_name = 'ring_{}'.format(ring_cam.attributes.get('friendly_name')) data = { 'url': ring_cam.attributes.get('video_url'), 'subdir': subdir_name, + 'filename': ring_cam.attributes.get('friendly_name') } # call downloader component to save the video hass.services.call('downloader', 'download_file', data) ``` - - - Start Home Assistant - - Call the server `python_script/ring_downloader` - -You should be able to see a video file saved under `//ring_/`. - -You can also automate the process by integrating it with the (automation)[/components/automation) component.