Hello,
I’m trying to create a generic automation for my IFTTT applets.
My Applet JSONs have same structure…like this:
{
"action":"call_service",
"service":"notify.telegram_myname",
"action_data": {
"message": {{UserName}}
}
}
Now…this automation works fine…
- id: '1571231239000'
alias: IFTTT Webhook
trigger:
platform: event
event_type: ifttt_webhook_received
event_data:
action: call_service
action:
- service_template: '{{ trigger.event.data.service }}'
data_template: { "message" : "MYNAME!" }
but, if I try to pass the “action_data” of my JSON object as data_template…
- id: '1571231239000'
alias: IFTTT Webhook
trigger:
platform: event
event_type: ifttt_webhook_received
event_data:
action: call_service
action:
- service_template: '{{ trigger.event.data.service }}'
data_template: {{ trigger.event.data.action_data }}
…I’ve got this error…
2019-10-14 23:20:38 ERROR (SyncWorker_11) [homeassistant.util.yaml.loader] invalid key: "OrderedDict([('trigger.event.data.action_data', None)])"
in "/home/homeassistant/.homeassistant/automations.yaml", line 221, column 0
2019-10-14 23:20:38 ERROR (MainThread) [homeassistant.components.automation] invalid key: "OrderedDict([('trigger.event.data.action_data', None)])"
in "/home/homeassistant/.homeassistant/automations.yaml", line 221, column 0
if I try to pass the “action_data” of my JSON object as data_template with quotes…
- id: '1571231239000'
alias: IFTTT Webhook
trigger:
platform: event
event_type: ifttt_webhook_received
event_data:
action: call_service
action:
- service_template: '{{ trigger.event.data.service }}'
data_template: "{{ trigger.event.data.action_data }}"
…I’ve got this error…
2019-10-15 00:15:00 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: expected a dictionary for dictionary value @ data['action'][0]['data_template']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 194). Please check the docs at https://home-assistant.io/integrations/automation/
How can I solve this problem ?
Is it possible to pass an entire JSON in data_template ?
Thank you