I’m building a garage door reminder to remind me if the garage door has been open for more than 30 minutes and continue a looping reminder every 30 minutes until closed. If it is left open, send a push notification to my phone with actions to close the door or ignore loop.
I have everything working correctly in node-red but I want to pull the time the door was opened into the notification. I’m capturing the time the door was opened by getting current state of sensor.time and passing it along as msg.open_since. I then set the payload with the JSON below and pass it to a call service node that notifies my phone app. I can’t seem to pull the open_since value into the string and have tried various different syntax, including sending the time as payload and using that in the string.
I’ve added debug nodes and can confirm that msg.open_since does contain a string of the time value. The JSON passed to the notify call service contains the curly brackets within the object but I assume that’s expected until the notification hits my phone. Any suggestions?
{
"data": {
"title": "Garage door left open",
"message": "Garage door has been open since {{open_since}}.",
"data": {
"actions": [
{
"action": "close_garage",
"title": "Close Door"
},
{
"action": "stop_garage_loop",
"title": "Stop Alerts"
}
],
"tag": "garage_reminder",
"group": "garage_reminder"
}
}
}