#Insert Timestamp into Filename of Recording

1 messages · Page 1 of 1 (latest)

noble blaze
#

In this automation, the filename becomes: "motion_unknown_doorbell.mp4" instead of the input_text.

If I look at traces, the input_text portion works correctly and sets the value: "20250615_235624", but in the filename it shows "unknown".

alias: doorbell motion notification
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.front_door_motion
    to: "on"
conditions: []
actions:
  - action: input_text.set_value
    metadata: {}
    data:
      value: "{{ now().strftime(\"%Y%m%d_%H%M%S\") }}"
    target:
      entity_id: input_text.front_door_motion_timestamp
  - action: camera.record
    metadata: {}
    data:
      duration: 30
      filename: >-
        /media/reolink_video/motion_{{
        states('input_text.front_door_motion_timestamp') }}_doorbell.mp4
    target:
      entity_id:
        - camera.front_door_clear
  - action: notify.all_devices
    metadata: {}
    data:
      message: Motion detected!
      title: Doorbell
      data:
        video: >-
          /media/reolink_video/motion_{{
          states('input_text.front_door_motion_timestamp') }}_doorbell.mp4
mode: single```

Appreciate any guidance!
magic bough
#

actions:

  • action: camera.record
    metadata: {}
    data:
    duration: 30
    lookback: 0
    filename: /media/reolink_video/frontdoormotion{{ now().strftime('%d-%m-%y %H.%M.%S') }}.mp4
    target:
    entity_id: camera.front_door_clear
#

maybe this helps

#

outputs frontdoormotion-date-time

noble blaze
#

Thank you, this works to insert the timestamp into the filename, however when I pass that video to the notification, it gives me a "Failed to load attachment. The given URL was invalid" in the notification." I'm thinking the filename isn't the same when it's being passed in the notification?