-
I am trying to get TTS working in node-red with the Call Service and Function nodes because I want to be able to generate a TTS message with Javascript, but I am stuck on trying to figure out what format the notify service is actually expecting, and this doesn't seem to be documented anywhere. I get lots of messages about keys missing in the debug pane but I don't see anywhere what format is expected. Can someone please provide a clean, basic example of the JSON (not YAML) required to make these two nodes work together. Here's a sample of what I'm using in the function node, but it's not working. const p = {
"msg": {
"data": {
"domain": "notify",
"service": "alexa_media_living_room_echo",
"message": "it is 60 degrees",
"data": {
"type": "tts"
}
}
}
}
node.send(p)
return msg |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Never mind, I figure it out with help from this issue: const newTemp = msg.data.new_state.attributes.temperature
const oldTemp = msg.data.old_state.attributes.temperature
if (newTemp !== oldTemp && newTemp >= 60) {
msg.payload = {
domain: "notify",
service: "alexa_media_living_room_echo",
data: {
message: "it is "+ newTemp +" degrees",
data: {
type: "tts"
}
}
}
node.send(msg);
}
return ; |
Beta Was this translation helpful? Give feedback.
Never mind, I figure it out with help from this issue:
AYapejian/node-red-contrib-home-assistant#59
I ended up with an empty Call Service node with {} in the Data field and this in the Function Node