Hi all,
I’d like to do the following:
I get a MQTT message on a topic I listen on. Whenever a message is received I create a push notification that contains the message payload and send it to the App.
What works so far: I get the MQTT message, check the payload (This won’t be needed later but it works), send a notification with dummy message and title to the App.
What doesn’t work? Setting the push message content to the MQTT message payload.
What I tried:
automation:
trigger:
platform: mqtt
topic: "alarm/+/command/alarm"
payload: "ON"
action:
service: notify.mobile_app_htc_u11_life
data:
message: '{{trigger.payload}}'
title: "Alarm Raised"
The error I get:
2020-01-21 15:37:22 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.automation_0. Error rendering template for call_service at pos 1: UndefinedError: 'trigger' is undefined
I googled a bit and found that in theory this should be working. Does anyone have an idea why it isn’t?