RobinBonk1
(RobinBonk)
December 5, 2024, 11:01am
1
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?
Troon
(Troon)
December 5, 2024, 11:05am
2
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.
RobinBonk1
(RobinBonk)
December 5, 2024, 12:19pm
3
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.
Troon
(Troon)
December 5, 2024, 12:29pm
4
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
RobinBonk1
(RobinBonk)
December 7, 2024, 10:10pm
5
Thank you for helping. It was indeed a simple typo and it works as expected now!
1 Like
Troon
(Troon)
January 23, 2025, 11:03am
8
Post code as properly-formatted text not screenshots. See rule 11 of this:
Before we begin…
This forum is not a helpdesk
The people here don’t work for Home Assistant, that’s an open source project. We are volunteering our free time to help others. Not all topics may get an answer, never mind one that helps you solve your problem.
[image]
This also isn’t a general home automation forum, this is a forum for Home Assistant and things related to it. Any question about Home Assistant, and about using things with Home Assistant, is welcome here. We can’t help you with eve…
DJGIG
January 25, 2025, 3:59pm
9
action: llmvision.image_analyzer
metadata: {}
data:
remember: false
include_filename: false
target_width: 1280
max_tokens: 100
temperature: 0.2
provider: ***********************
model: gemini-1.5-flash
message: >-
Beschreibe das Bild in einem Satz. Wenn du Personen siehst, beschreibe deren
aussehnen.
image_file: /media/local/tuerKG.jpg
generate_title: false
expose_images: false
expose_images_persist: false
response_variable: response
DJGIG
January 25, 2025, 4:02pm
10
Can anyboady help me in order to correct the code to work ?
Br.
action: notify.gary_steffi_notification
data:
message: "{{ response.response_text }}"
title: Türglocke
data:
image: /media/local/local/tuerKG.jpg
actions:
- action: URI
title: Livestream
uri: /lovelace-glocke/0
Troon
(Troon)
January 26, 2025, 7:33am
12
You are missing a "
at the end of the message
.
message: "{{ response.response_text ))"
Troon
(Troon)
January 28, 2025, 5:00pm
14
Show all the code — we can’t see where you are populating the response
variable.
DJGIG
January 28, 2025, 10:00pm
17
Troon
(Troon)
January 29, 2025, 8:52am
18
Please try to combine your posts together…
We’re going to need to see an automation trace, as you say “the llm vision part is working and schould give a feedback ----> response_variable: response” but it clearly isn’t, from the error message.
Find a recent trace that generated the error (Automations screen, three dots on its row, Traces), then on the Trace screen click the three dots and select Download Trace. Then paste all of that in here, formatted as code not a screenshot.