Automation NOT working. :(

I have my configuration setup, Whenever motion is detected it should take a camera.snapshot and save in /media/ directory. When I run it manually from the automation menu, it works perfectly. I am new to Home assistant Automation unable to get it to run automatically. :sob: Please help. Please see my configuration below:

id: '1669274337701'
alias: 'Notify: Motion Detected on Frontyard.'
description: ''
  - type: motion
    platform: device
    device_id: cb848d50d340ded6272b614a4be93c92
    entity_id: binary_sensor.frontyard_motion_region_detection
    domain: binary_sensor
      hours: 0
      minutes: 0
      seconds: 0
condition: []
  - service: notify.mobile_app_s22_ultra_aaziz
      title: 'Motion Detected: Check Front Yard.'
      message: Someone in Frontyard, check images folder.
        image: '{{ }}'
  - service: camera.snapshot
      filename: /media/detected_front_yard_{{now().strftime('%Y%m%d_%H%M%S')}}.jpg
        - cb848d50d340ded6272b614a4be93c92
        - cb848d50d340ded6272b614a4be93c92
      entity_id: camera.doods_frontyard
mode: single

Any help would be greatly appreciated! :pray:

Are you sure the motion is detected?

Does the state of binary_sensor.frontyard_motion_region_detection change at all (check in history)

If so, you can check the traces of the automation (no trace means not triggered)

And you may want to try

And maybe this is also of interest