I’m using a call service node to call alexa_tts. I want her to say the string from the msg.payload from the previous node.
A working Data field looks like this:
{"message":"This is a test"}
How do i replace “This is a test” with the string in the payload from the calling Node?
This has to with you sending more data than the service call was expecting. Make sure you’re not passing any extra data in msg.payload.data for the previous nodes.
Just to explain my test situation…
I have an input slider called “brightness” that goes from 0-100.
I have an event state reading this slider which outputs a string consisting of a number between 0 & 100.
This goes into a function node with the following code. This converts to JSON.
var data={"brightness_pct":+msg.payload};
node.log(typeof data);
msg.payload= JSON.stringify(data);
return msg;
This goes to another function node with the following code. This gets the number back (in a different format???). This is where I think it could be more direct but yet to find a way.
Now this gets passed to a call service node and the data field looks like this.
{"brightness_pct":{{payload}}}
And now my slider controls the brightness. The reason behind all this is I have 3 RGB strips in one project and would like the one slider to control all three at the same time, also by doing this I can “sync” patterns across all three.
Truth be told, I use the light group to see if it’s on or off and turn them on individual.
I’ll link what I do later.
At the moment I’m struggling with the correct light color temperature!
Do made a long array with Kelvin colors in that I’m using atm.