Node red from Template to Json for Alexa TTS

Hi

I am able to get messages to Alexa by using this Call Service node

Without going into too much depth I am attempting to convert a Template to a TTS message.

But I am unable to get the json format to understand the payload.

Can anyone give the correct format? I am assuming a function here but by coding is abysmal.

Thanks

Hans
Happy New Year!

NB

This is part of this flow. Im tryting to get a notification on when I set my alarm that a door/window is open. I want Alexa to tell me which door it is.

In the template node set msg.payload.data.message

Also you’re using web socket for homeassistant so you can also now render the template in the call service node without the classic nodered template, using the same mustache syntax just make sure you mark the checkbox.

Thank you.

Is this what you mean? It gives an error, but I can see where its heading

Also, could you point me to any good examples of templating? It seems like a very powerful tool for me to lean for node red.

Like this

now using the classic template have to set the message property, data object is undefined so cannot create there, a change node could do it

1 Like

Thank you so much…

That is fantastic. And a new lesson learnt for me for the New Year.

Can you show me how you have configured each nodes? i’m trying to do the same without results.

I have configured the flow in the same way, if i start flow with inject node everything work fine with trigger state i don’t get notification even if the debug result is the same

1 Like

What is in the template node? Could you possibly share this flow?

1 Like