It worked for a few days on 0.89, no problems.
I have since upgraded to 0.91 and I get the following error whenever its triggered
2019-04-05 11:43:59 ERROR (MainThread) [homeassistant.helpers.service] Error rendering data
template: UndefinedError: ‘trigger’ is undefined
Configuration for the automation:
I had a look at the “breaking changes” section for 0.91 and saw nothing related…
oof. That’s using the wrong quotes in so many spots. If you are using quotes inside quotes, you can’t use the same quote type. Adding a second simliar quote type just hides the issue.
If you use single quotes outside a template line '{{ }}' then you gotta use double quotes inside, not double single quotes (like you are doing). '{{ "double quotes aroudn this" }}'
EDIT: Also, you were using a multiline template without using the multiline indicator.
I applied those changes but it resulted same error message
I rebooted the machine, no change…
I removed the condition containing the mac, however, the error persisted.
Definitely seems to be in the data template.
I checked device_tracker.see; the parameters appear to be correct.
I then converted the yaml to json, input it into the UI for the automation but it gave me back the yaml as I had converted.
I have the same issue. My automation par looks as follows.
- alias: Mark person as just arrived
trigger:
platform: state
entity_id: group.mike
action:
- service: notify.ios_mischaiphonexs
data:
title: "Just Arrived"
message: '{{ trigger.entity_id }} Just arrived.'
The error message is:
Error while executing automation automation.mark_person_as_just_arrived. Error rendering template for call_service at pos 1: UndefinedError: ‘trigger’ is undefined
Was working fine before upgrading to 0.93.2, but now I get:
Error while executing automation automation.ifttt_turn_on_the_ps4. Error rendering template for call_service at pos 1: UndefinedError: 'trigger' is undefined
The funny thing is that when I trigger the recepie from the IFTTT site it works, but it doesn’t work when triggered from HA itself, nor with my voice command.
Are you pressing the button to fire the automation? Or are you waiting for it to naturally trigger? If you are pressing the button to test the automation, it will not work because the trigger object doesn’t exist. Because it didn’t trigger.
Are you pressing the button in the UI? Did you read my post above that explains why that doesn’t work? If you press the test button in the UI, trigger will be undefined and you’ll get errors.
Yes, that’s why I went out of my way to say “REAL triggered event”. I am not using the test button in the UI. This is an actual motion sensor triggering from a real motion event.