automation – Automation Fixation https://automation.moebius.site A site dedicated to home automation and technologies. Sun, 28 May 2023 07:07:36 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.4 156416546 Home Assistant with a Ring Doorbell in 2022 https://automation.moebius.site/home-assistant-with-a-ring-doorbell-in-2022/ Sun, 28 Aug 2022 11:07:00 +0000 http://automation.moebius.site/?p=1549 In this post, we will go through in detail how to integrate Home Assistant with a Ring doorbell, add an automation and download videos locally. If you haven’t seen my introduction video for first time users, please check it out as this video follows on directly from there including the Samba and Visual Studio Plugins used in this video.

What you need for this tutorial:

Step 1Adding the Ring Doorbell with Home Assistant

  • Open up your Home Assistant Browser
  • Navigate to Settings and then Device and Services
  • Select Add Integration in the bottom right
  • Search for Ring and select it
Home Assistant Ring Doorbell Tutorial
  • Follow the prompts to enter in the associated account details including 2FA if this has been enabled
  • Select the area where the device is located and then finish. If you need to create an area, select add new area and then add
  • The Ring integration should now be visible in the integration screen
Home Assistant Ring Doorbell Tutorial
  • If you go to the overview screen, the Ring sensors and key values should have been added as a new card
  • From here, you can see the sensors which show if a ding or motion is currently active, and historical details on the last activity, ding or motion. You can also see the volume settings and there are additional values to add such as battery level if you need them.
Home Assistant Ring Doorbell Tutorial
  • If you click on a value, you will be able to see the historical details.

Step 2Adding an Ring Doorbell Automation

Ok, now that we have integrated Home Assistant with the Ring platform, let’s add an automation for when something occurs with the doorbell.

  • Navigate to Settings and then Automations and Scenes
  • Click Create Automation and then Start with an empty automation
  • Let’s call this automation – “Front Door Light Motion” as I want to be able to turn on a switch when there is motion at the door
  • First we need to set up a Trigger to specify when the automation will start
  • Select Trigger type State and then the entity. We are going to select the binary sensor Front Door Motion
  • I will leave the From and To blank so that it switches on when the motion sensor is triggered
Front door light motion triggers
  • Now we need to select an Action, so select Action type call service and then switch turn on and then select the entity. In this case, I’m going to use the Front Door light switch.
Front door light motion actions
  • Once complete, Save the automation and return

Step 3 – Saving the Ring Doorbell Videos Locally

I’ve received a lot of requests on my older Ring video on how to save videos locally. Please note that you will need to have a Ring Plan for this to work.

  • To start, open up your configuration yaml file to add in the downloader module config.
  • Paste the following config and select an appropriate downloads folder:
Configuration.yaml file editing with download module
downloader: 
  download_dir: downloads 
  • Make sure you create also create a downloads folder that matches the config or you will get an error when trying to download
  • Go to Developer Tools and check that the configuration is fine and then restart Home Assistant.
Home Assistant Configuration validation
  • Back now in Settings, select Devices and Services and confirm the camera name so that we can use it in the next automation. e.g. camera.front_door
Ring Doorbell entity name
  • Go back to Settings, select Automations and Scenes
  • Click Create Automation and then Start with an empty automation
  • Let’s name this automation “Download Ring on Motion”
  • The Trigger again will be State and Front Door Motion
Download Ring Video on motion automation
  • You will need to add in a couple of Actions
  • Generally there will be some time required before the video is ready on the Ring Server, so I suggest adding a Delay step.
  • Add in “Wait for Time to Pass” and a 2 minute period to allow time for the video to upload to Ring and then download
  • Now we need a second action to download the file
  • Select “Call Service” and search for downloader
Ring Doorbell automation actions
  • Now click on the extra options to edit in YAML
  • Paste the code and adjust based on your camera name which we confirmed previously. In my case, it is camera.front_door and add in the filename script to name the file with an appropriate timestamp
Ring Doorbell automation Actions
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"
  • Save the automation and return to the previous screen
  • Trigger the automation to check if it worked
  • Navigate to the downloads directory using the Samba share addon and see if the video worked. This should show the last video recorded by the Ring.
Samba share download screenshot of Ring video
  • If the automation is triggered by actual motion, you will be able to see the history showing that it was triggered by state of Front Door Motion.
Download Ring on Motion History

Thanks for reading. If you liked this article, please like and subscribe to the YouTube video at the start of this page.

Additional Links:

]]>
1549