Chreece
(Chris Chreece)
August 16, 2020, 10:19am
1
Hey You! Thank you for reading this
The code at the end of this post is an event that i am passing to an automation. I need to get the values from “event_response” to pass them in an Delay action. When i try:
delay:
seconds: ‘{{ event_response|float }}’
I get an error:
Error rendering Küche Steckdosen ResponseDauer delay template: UndefinedError: 'event_response' is undefined
also tried things like:
seconds:‘{{ event_response }}’
‘00:00:’{{ event_response }}’
The event_response_type
contents are used to trigger the automation and they work… So how i can get this 3 from the event_response
, so the Delay action understands the number in seconds?
{
"event_type": "alexa_actionable_notification",
"data": {
"event_id": "actionable_notification_kucheon",
"event_response": 3,
"event_response_type": "ResponseDuration"
}
1 Like
What value do you get when you paste
{{ event_response|float }}
in to Developer Tools / Template ?
Chreece
(Chris Chreece)
August 16, 2020, 12:18pm
3
Thank you very much for your time
I got undefined… or None
The event listener gets the data from the event alexa_actionable_notification
(from there have i pasted the code)
The big question is:
What is the right template to use for the event_response
data from the event named alexa_actionable_notification
.
Because as i understand giving the variable '{{ event_response }}'
in any template in actions got undefined.
I have searched for a template in Actions that gets data from events as variables but no luck…
I don’t have an answer for you, but pasting the entire automation might give more context to others who might
Chreece
(Chris Chreece)
August 16, 2020, 12:24pm
5
You have spend some time to read, think, and try to help me…
… so thank you very much sir!
The automation looks like that:
trigger:
- event_data:
event_id: actionable_notification_kucheon
event_response_type: ResponseDuration
event_type: alexa_actionable_notification
platform: event
condition: []
action:
- delay:
seconds: ''{{ event_response }}''
Try
seconds: '{{trigger.event.data.event_response}}'
From thread here:
Thanks to @keatontaylor ’s new Alexa Actions skill, we can now have Alexa prompt us before an optional action is taken. I figured we could use a separate topic to share our favorite automation, so we can leave the original topic to announcements and tech support.
I have an automation which locks the front door 5 minutes after it is unlocked. We have been eating meals in the front yard more lately, so we’d like the convenience of leaving the door unlocked during these times.
So every time the d…
Chreece
(Chris Chreece)
August 16, 2020, 12:40pm
7
YES SIR!
Now i understand how it works… I also found the trigger.event.data but i putted also the name of the event and i got again undefined…
So… trigger.event.data looks into the data that triggered this automation and pulls out the value from the variable next to it…
Thank you and have a wonderful day
Chreece
(Chris Chreece)
August 16, 2020, 12:50pm
9
Yes it worked…!
I got +1 level in Home Assistant programming from your answer
Nice !
I got +1 from your question