#Copying and renaming an image based on Text Input from an Actionable Notification

1 messages · Page 1 of 1 (latest)

old pilot
#

The following automation works properly:

alias: LLM Vision Front door
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.front_doorbell_person
    to: "on"
    from: "off"
conditions: []
actions:
  - action: llmvision.image_analyzer
    metadata: {}
    data:
      remember: true
      use_memory: false
      include_filename: false
      target_width: 1280
      generate_title: true
      expose_images: true
      provider: REDACTED
      message: >-
        Write a short, matter-of-fact description of people in the image.
        Keep the response under 100 tokens.
      image_file: /media/Reolink/snapshot.jpg
      max_tokens: 100
    response_variable: llm_response
  - action: notify.mobile_app_chris_iphone_16
    metadata: {}
    data:
      title: "{{ llm_response.title }}"
      message: "{{ llm_response.response_text }}"
      data:
        image: /media/local/Reolink/snapshot.jpg
        actions:
          - action: REMEMBER
            title: Remember
            behavior: textInput
            textInputButtonTitle: Who is this?
          - action: DISMISS
            title: Dismiss

When "REMEMBER" is chosen, I would like the snapshot image to be copied and renamed. I have set up the following shell command in config.yaml: remember_doorbell_snapshot: cp /media/local/reolink/snapshot.jpg /media/local/reolink/library/{{ trigger.event.data["textInput"] }}.jpg

I have written the following handler automation. When it runs, it fails out and gives trigger is undefined:

alias: Copy Doorbell Snapshot
description: ""
conditions:
  - condition: template
    value_template: "{{ trigger.event.data.action == 'REMEMBER' }}"
actions:
  - action: shell_command.remember_doorbell_snapshot
    metadata: {}
    data: {}
mode: single
triggers:
  - event_type: mobile_app_notification_action
    event_data:
      action: REMEMBER
    trigger: event

I can't figure out what I'm missing here -- any ideas?