The IFTTT example is not working for me…
I was able to initiate a trigger but can NOT use the data passed in the trigger.
I verified that the data I send appears in the trigger (on the DB table)
but it seems like the trigger additional data can not be parsed within the automation:
Passing the following in IFTTT:
{ "action": "testme","a":"This is A","b":"Something else" }
Automation action:
- service: notify.mainnotification
data:
message: '{{ trigger.event.data.a }}'
title: '{{ trigger.event.data.b }}'
Log Error:
ServiceCall notify.mainnotification (c:e470d168c107459c9890a499f4ef35eb): message=<homeassistant.helpers.template.Template object at 0x6d647970>, title=<homeassistant.helpers.template.Template object at 0x6d647650>>
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/template.py", line 132, in async_render
return self._compiled.render(kwargs).strip()
File "/usr/local/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
return original_render(self, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "<template>", line 1, in top-level template code
File "/usr/local/lib/python3.6/site-packages/jinja2/sandbox.py", line 385, in getattr
value = getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'trigger' is undefined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1177, in _event_to_service_call
await service_handler.func(service_call)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/notify/__init__.py", line 106, in async_notify_message
kwargs[ATTR_TITLE] = title.async_render()
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/template.py", line 134, in async_render
raise TemplateError(err)
homeassistant.exceptions.TemplateError: UndefinedError: 'trigger' is undefined