I want to download the last video every time a new video is created. I was thinking after it sees motion it would kick the script off and save that url. then I can just create a rsync script to save every created video off to my nas…Thanks for the help btw
So, it works but… when the binary_sensor.ring_front_door_motion goes “on”, the last recorded video it’s not the one it is recording in that moment, but previous one it has been already sent to the ring servers. Probably I have to add a delay between the trigger and the download.
Anyway, in my configuration file I have:
downloader:
download_dir: downloads
This tells to the downloader component to download files into /config/downloads (I am using HA on Hassio, if you are using it on a different platform the “downloads” dir will be inside your HA root dir).
And this is my ring.yaml package:
############################################################
#
# Ring
#
############################################################
ring:
username: !secret ring_user
password: !secret ring_password
sensor:
- platform: ring
binary_sensor:
- platform: ring
camera:
- platform: ring
automation:
- alias: 'Doorbell Motion'
trigger:
- platform: state
entity_id: binary_sensor.ring_front_door_motion
from: 'off'
to: 'on'
action:
- service: downloader.download_file
data_template:
url: "{{ states.camera.front_door.attributes.video_url }}"
filename: "last.mpg"
overwrite: true
- alias: 'Doorbell Ding'
trigger:
- platform: state
entity_id: binary_sensor.ring_front_door_ding
from: 'off'
to: 'on'
action:
- service: hassio.addon_stdin
data:
addon: local_audio_player
input: "http://192.168.1.100:8123/local/doorbell-1.mp3"
I use to save the file in the www folder, which is accessible from the web frontend. So you can play the video from there. I actually don’t do it on my hassio because ffmpeg platform keeps freezing the raspberry pi. Anyway it’s something like this @hastarin :
Excuse my ignorance, however are we required to have a monthly subscription with Ring.com in order to be able to store the latest video on our local HAAS? Or is it possible to use the camera as live feed? Cheers!
Digging up an old thread, here is an AppDaemon version of the automation/app
Doorbell Video:
class: ring_doorbell_video_download
module: ring_doorbell_video_download
ring_camera: camera.front_door
## Custom subdir or use 'dynamic' to use the date (yyyy-mm-dd)
subdir: doorbell
import appdaemon.plugins.hass.hassapi as hass
class ring_doorbell_video_download(hass.Hass):
def initialize(self):
self.ring_camera = self.args["ring_camera"]
self.subdir_name = self.args["subdir"]
self.log("Doorbell Video download setup for {}".format(self.ring_camera))
self.listen_state(self.video_event, self.ring_camera, attribute="video_url")
def video_event(self, entity, attribute, old, new, kwargs):
if old != new:
if self.subdir_name == "dynamic":
subdir_name = "{}".format(self.date())
else:
subdir_name = self.subdir_name
url = self.get_state(self.ring_camera, attribute="video_url")
filename = '{}_{}.mp4'.format(self.ring_camera, self.datetime())
filename = filename.replace(":", "-")
filename = filename.replace(" ", "_")
if url:
self.call_service("downloader/download_file",
url=url,
subdir=subdir_name,
filename=filename)
self.log("Doorbell Video Downloaded", "INFO")
else:
self.log("No URL Provided for Doorbell Video", "WARNING")
def log_notify(self, msg, level):
self.log(msg, level)
self.call_service("notify/notify", message=msg)
@kylerw You said digging up an old thread. Can you point me to that thread or explain what goes where? Do I need to put
python_script:
in my configuration.yaml
and create a python script in the python_scripts folder that contains that script. what is used to trigger that script an automation? And does that automation go in the automation.yaml file?
This documentation from the Ring Integration works! It seems to be the easiest working option to download videos from ring at the moment.
Does anyone know how to use the Delay function properly, so that when motion is triggered, the Downloader process waits 1 or 2 minutes until the motion video is ready?
Simply adding the delay: 60 option to the config makes the config file error out during restart and it does not work.
I too have gotten the downloader working pretty well, and I can see all the processed motion videos in my downloads folder, however I haven’t really figured out how to put it to any significant use from within Home Assistant.
Has anyone done anything significant with this integration?