hassio-addons / addon-node-red

Node-RED - Home Assistant Community Add-ons
https://addons.community
MIT License
541 stars 126 forks source link

Mustaches in a persistent notification do no work #1924

Closed mchouque closed 3 months ago

mchouque commented 3 months ago

Problem/Motivation

Hello,

I have a workflow to detect water usage/leaks using the add-on in version 18.0.4 (I just upgraded to 18.0.5 but it's been broken for a while). There's a logic in that workflow and when it detects something, it triggers 2 notifications, both notifications being connected to the same node.

One is to my phone: { "id": "84090dc5344bfbf6", "type": "api-call-service", "z": "376be0883d3b3ac3", "name": "", "server": "c9c68061.14dcf", "version": 5, "debugenabled": false, "domain": "notify", "service": "mobile_app_pixel_8_pro", "areaId": [], "deviceId": [], "entityId": [], "data": "{\"message\":\"Possible {{ topic }} water leak, duration {{ payload.duration }}, usage {{ payload.consecutive_water_usage }} / {{ payload.total_water_usage }} liters\",\"title\":\"Water Leak\",\"data\":{\"url\":\"/lovelace/meters\",\"clickAction\":\"/lovelace/meters\"}}", "dataType": "json", "mergeContext": "", "mustacheAltTags": false, "outputProperties": [ { "property": "topic", "propertyType": "msg", "value": "topic", "valueType": "msg" } ],

The other one is a persistent notification:

{ "id": "8cdfd24c349767ab", "type": "api-call-service", "z": "376be0883d3b3ac3", "name": "", "server": "c9c68061.14dcf", "version": 5, "debugenabled": true, "domain": "notify", "service": "persistent_notification", "areaId": [], "deviceId": [], "entityId": [], "data": "{\"message\":\"Possible {{ topic }} water leak, duration {{ payload.duration }}, usage {{ payload.consecutive_water_usage }} / {{ payload.total_water_usage }} liters\",\"title\":\"Water Leak\",\"data\":{\"url\":\"/lovelace/meters\",\"clickAction\":\"/lovelace/meters\"}}", "dataType": "json", "mergeContext": "", "mustacheAltTags": false, "outputProperties": [ { "property": "topic", "propertyType": "msg", "value": "topic", "valueType": "msg" } ], "queue": "all", "x": 1000, "y": 200, "wires": [ [] ] },

For some reason, the notification on my phone works: I get all values within mustaches evaluated but for the persistent notification, all the values are empty so I get this string in the notification instead: "Possible water leak, duration , usage / liters".

Expected behavior

Given it's the same setup, device notification vs persistent, I'd expect the latter to work properly.

Actual behavior

Variables aren't being evaluated.

Steps to reproduce

Not sure how to reproduce that.

Proposed changes

N/A

frenck commented 3 months ago

Hi there @mchouque 👋

It seems like you have an issue with Node-RED itself or one of its nodes (like the Home Assistant node), not the add-on. Please report the issue upstream with the application or node you are having issues with.

Thanks 👍

../Frenck