Trying to put values into a notification

I’m trying to get the notification to reflect the value out of the state change.

The call service works without the variable, but when I include it like below:

{“message”:“Load in excess of 30% on UPS. Currently {{ msg[‘payload’] }}.”,“title”:“Load Alert”}

I get an error

jinja2.exceptions.UndefinedError: ‘msg’ is undefined

in the logs.

I see in the debug the “msg” object with payload is passed in. How do I reference this in the data field in the Service call?

Try msg.payload

Sorry, also forgot you need to create that payload using the template node. So {{ msg.payload }} expands there and then the whole object goes to the service call. I am on my phone now, so I can’t syntax the whole template

Ended up doing it with a Template but it was just {{payload}} and not msg.payload.

Now to put in frequency capping.

Struggling with this. How did you do it?