Automation not working - help appreciated

Hi all,

I’m trying to get a snapshot picture once there is motion with a ring camera. The automation will wait for 2 minutes before taking the snapshot then place it locally.

Once we have the snapshot I would then like to view this in lovelace using a card which updates every time the snapshot updates

Ring in general seems to be broken at the moment only showing randomly so to get round this I’m trying the above though my issue is that I’m getting a little confused.

The snapshot part works relatively fine & places the image locally though the card (tried different onesI does not update. Also I’m not sure which entity to use in the card config.

Any pointers would be appreciated. Thanks

configuration.yaml

  whitelist_external_dirs:
    - /config/www

   camera:
  - platform: local_file
    name: front
    file_path: /config/www/snapshots/front_door.jpg
    
  - platform: local_file
    name: back
    file_path: /config/www/snapshots/backyard.jpg
    

automations.yaml

   - alias: 'Show snapshot when motion at front door'
     trigger:
       platform: state
       entity_id: binary_sensor.front_door_motion
       to: 'on'
     action:
      - delay:
          minutes: 2
      - service: camera.snapshot
        entity_id: camera.front_door
        data:
          filename: "/config/www/snapshots/front_door.jpg"
      - service: camera.local_file_update_file_path
          

   - alias: 'Show snapshot when motion at backyard'
     trigger:
       platform: state
       entity_id: binary_sensor.backyard_motion
       to: 'on'
     action:
      - delay:
          minutes: 2
      - service: camera.snapshot
        entity_id: camera.backyard
        data:
          filename: "/config/www/snapshots/backyard.jpg"
      - service: camera.local_file_update_file_path

AFAICT, the local_file platform only signals a change to HA if the local_file.update_file_path service is called.

I see you’re trying to do that, but idk where “camera.local_file_update_file_path” comes from.
You should do, e.g.

- service: local_file.update_file_path
  entity_id: camera.front
  data:
    file_path: /config/www/snapshots/front_door.jpg

Hi, I think I got that command from some search I did. Will try your suggestion tomorrow & let you know.

Thanks

So I tried that & then in the picture-entity added the below though get an error “Entity not available”

cards:
  - aspect_ratio: 50%
    entity: local_file.front
    image: /local/snapshots/front_door.jpg
    show_name: false
    show_state: false
    type: picture-entity

The entity is likely camera.front. Just check your entities…

I think thats part the issue I have it does not create a camera.XXXXX after I restart HA. Checked the logs & just can’t see anything relevant.

I guess I will just keep plugging away

Thanks

Wow! Turns out I have a ‘camera.yaml’ file with my other cameras in there. Deleted the camera section from the configuration file & both newly created cameras where present after a restart.

So I will now try once more & add some notes here once done.

Thanks

Yep all working now. @koying Thanks for your time

Heya. is the local_file.update_file_path gone from HA?
I have a problem that my snapshot wont replace the old one when a new triggers applies in my automation. Only until some minutes later the snapshot replaces the old one. So if 2 triggers apply to close they will both show the first snapshot!