I am trying to template my various notifications. for example
if i put this in the data field it works
If i put it in a template and view the debug output, i see it broken down correctly into titles, objects, arrays. etc.
but using {{payload}} in the data field always gives error. the actions/array parse out but the rest does not. how can I achieve this?
reason being is I want to have 1 notify node for each device, but the notifications vary, some with intents and some without. so i’d like to template all that, and then just pass it to 1 notify node.
{
"title": "Alert",
"message": "A new version of HomeAssistant is available. would you like me to upgrade?",
"data": {
"actions": [
{
"action": "upgrade_ha_yes",
"title": "Upgrade HA Now?"
},
{
"action": "upgrade_ha_no",
"title": "I will upgrade manually"
}
]
}
}
@Kermit - thanks for the response. I checked that my formatting was correct, and when i look at the debug output of the inject node, it looks correct to me. but when it hits the call service node, it’s junk. screen shot attached. any idea what i’m doing wrong?
nevermind I got it sorted. will leave my solution for anyone else searching.
my formatting was indeed not correct.
had to use {{msg.payload}} and this json format, it it worked.
{
"data": {
"title": "Alert",
"message": "A new version of HomeAssistant is available. would you like me to upgrade?",
"data": {
"actions": [
{
"action": "upgrade_ha_yes",
"title": "Upgrade HA Now?"
},
{
"action": "upgrade_ha_no",
"title": "I will upgrade manually"
}
]
}
}
}