Home Assistant Call Service Node (Node-Red), help please

I recently got TTS over Alexa working thanks to Finity in this thread.

In the Services tab:
Service: media_player.alexa.tts
Service Data: {“entity_id”:“media_player.steve”,“message”:“Hello”}

This works just fine.

However I can’t get the Home Assistant Call Services node in Node-Red to work.

If I put the data directly into the node, I get an error (“Unknown Service”).

Has anyone gotten this Service Node working with the media_player.alexa.tts service?

Is there another vector to get Alexa commands into an automation in Home Assistant?

I have. Service for me is just “Alexa_tts”. drop the media_player in front of it.

Thanks, but I am still getting an API error. What domain did you use?

media_player… I did have to fully restart Node-Red after adding it though.

Restart did it. Many thanks.

My project is a “dinner bell”, where my wife can tell Alexa to “set dinner to 10” and my function makes a string to send to all Alexa nodes “Dinner in 10 minutes”.

The noise background in the kitchen is so high that Alexa “Drop-In” and “Announce” features are hard to understand.

You’ve been a huge help already, but could I bother you to look at my flow and offer help in formatting my JSON data?

[{“id”:“3d1b6c46.d8cd94”,“type”:“debug”,“z”:“f3845211.e5e57”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“false”,“x”:590,“y”:1040,“wires”:[]},{“id”:“8467736c.043be”,“type”:“inject”,“z”:“f3845211.e5e57”,“name”:"",“topic”:"",“payload”:"",“payloadType”:“date”,“repeat”:"",“crontab”:"",“once”:false,“onceDelay”:0.1,“x”:220,“y”:980,“wires”:[[“54ce1ae2.f6ff74”]]},{“id”:“89be4127.473d1”,“type”:“api-call-service”,“z”:“f3845211.e5e57”,“name”:"",“server”:“1a3c51f6.4b493e”,“service_domain”:“media_player”,“service”:“alexa_tts”,“data”:"",“render_data”:false,“mergecontext”:"",“x”:660,“y”:980,“wires”:[[“1ee5b425.6e184c”]]},{“id”:“54ce1ae2.f6ff74”,“type”:“function”,“z”:“f3845211.e5e57”,“name”:"",“func”:“msg.data={“message”:“Hello, world.”};\nreturn msg;”,“outputs”:1,“noerr”:0,“x”:370,“y”:980,“wires”:[[“89be4127.473d1”,“3d1b6c46.d8cd94”]]},{“id”:“1ee5b425.6e184c”,“type”:“debug”,“z”:“f3845211.e5e57”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“x”:880,“y”:900,“wires”:[]},{“id”:“1a3c51f6.4b493e”,“type”:“server”,“z”:"",“name”:“Home Assistant- Raspberry”,“legacy”:true,“hassio”:true,“rejectUnauthorizedCerts”:true}]

JSON is my Achille’s Heel- I just can’t grasp it

Sure, I will take a look when I get home so that I can replicate.

1 Like

Change your function node to
msg.payload={data: {“message”:“Hello World”}};
return msg;

The call service node will take the msg.payload variable as default if you do not put anything in the DATA field in node properties.

Does that help?

Substantially. It works now. Seriously, I just can’t getobjects though it is the most basic fundamental of Java.