Ring Floodlight Pro. Automation help

Can someone help me with this?

It isn’t working. I have ring flood light cameras, and I want to save the the entire video to my server when the motion detected has been finished. I have front and back flood light pros. I am very very new to HA. I am not sure wtf I am doing with this YAML file or this configuration. Especially with the URL portion.

I have MQTT integrated and the Ring integration set up.

My intention is once motion is detected and finished it pulls that entire clip to the nas. I do pay ring subscription. I am not trying to get out of ring subs.

automation:
  - alias: "Save the video when motion is detected (Front)"
    trigger:
      platform: state
      entity_id: binary_sensor.front_motion
      to: "on"
    action:
      - service: downloader.download_file
        data:
          url: "{{ states.camera.front.attributes.video_url }}"
          filename: "front-motiondetected-{{ now().strftime('%Y-%m-%d-at-%H-%M-%S') }}.mp4"
          target:
            dir: "/mnt/remotes/Test2"

  - alias: "Save the video when motion is detected (Back)"
    trigger:
      platform: state
      entity_id: binary_sensor.backyard_motion
      from: "off"
      to: "on"
    action:
      - service: downloader.download_file
        data:
          url: "{{states.camera.backyard.attributes.video_url}}"
          filename: "back-motiondetected-{{ now().strftime('%Y-%m-%d-at-%H-%M-%S') }}.mp4"
          target:
            dir: "/mnt/remotes/Test1"

The files probably don’t exist until motion has stopped. You are attempting to download the file when motion starts. Easy enough fix. Change your trigger to: 'off' and if you need a delay for the file to write:

    trigger:
      platform: state
      entity_id: binary_sensor.backyard_motion
      from: "on"
      to: "off"
      for: 5 # seconds

It is unlikely that you are going to match file names to a resolution of seconds though. Not sure what you can do about that.

Thanks! Do I have to create an action to have it download to my share? Sorry I am bit confused, I am going based off youtube videos who used the GUI automation… This YAML seems to cover all the basis and doesn’t need the GUI automation.

Thanks :slight_smile:

It has nothing to do with using yaml or the GUI editor. Read what I wrote again.