LLM Vision error defining response variable

Hi everyone,

I am trying to send a messages to my phone using the response variable according to a guide online. When I run the automation, I get an error saying my response variable is undefined:
“Error rendering message: UndefinedError: ‘response’ is undefined”

Did I miss something when setting up the automation?

Please paste the entire YAML for the automation, correctly formatted. Note that when you manually run an automation, only the actions section is run. If your service call to populate the response is not in the actions section, that bit won’t be run and response will be undefined.

This is my current yaml code:

alias: LLM test
description: ""
trigger: []
condition: []
action:
  - sequence:
      - action: llmvision.stream_analyzer
        metadata: {}
        data:
          duration: 5
          max_frames: 3
          include_filename: false
          target_width: 1280
          detail: low
          max_tokens: 100
          temperature: 0.2
          expose_images: false
          provider: 01JE9K600K742HDJAGQYTAFCHC
          message: >-
            Beschrijf in het Nederlands wat er zichtbaar is. Zit de hond in de
            bench? beschrijf de zichtbare personen
          image_entity:
            - camera.kodycam_lsc_indoor_ptz_dual_band
        response_variable: response
      - device_id: 1358451a239a4660345b07296846300b
        domain: mobile_app
        type: notify
        message: "{{ response.response_txt }}"
mode: single

Running the entire section does not give the undefined error, but the notification is still empty.

The documentation suggests that your message should refer to:

{{ response.response_text }}
----------------------^

With no trigger, this should be defined as a script rather than an automation.

1 Like

Thank you for helping. It was indeed a simple typo and it works as expected now!

1 Like