I have some Google Home devices that are media_player items; and I am able to create announcements using:
entity_id: media_player.kitchen_display
message: "This is an announcement"
Obviously; this works just fine as a regular automation; however, when I send this as a payload over NodeRed; the service is called; and I hear my display activate for something to happen - only nothing does.
My msg payload currently looks like this; although I am sure that it isn’t really correct (obviously it isn’t working):
What it is supposed to do is that when changes; to essentially ‘speak’ the new state as the announcement.
I have seen a few help sites suggest using data / data_template; but I am not sure which way is the best way to do it; or if I am even going about this correctly.
Note: <entity> is a placeholder for an actual entity; which using that template does report the correct state; the state is just not passed to be spoken over the TTS service call (google_tts.say).
I use a call service node with the following.
Domain: tts
Service: google_translate_say
Entity Id: speaker name
Data: {“message”:“A curb event is starting. Non essential electric items are being turned off”}
I just changed Data to:
{“message”:"{{states.sensor.power_solar.state}}"} and it announced the value of that sensor perfectly.
What sort of node are you using to have that input?
I just a call service node and fill in the boxes, but maybe take out the square braces to start with and see what that does.
I just exported mine to get the relevent info and it is formatted like this:
I see you have it solved, but did you have internal URL set to http://hassio:8123 or http://192.168.x.x:8123 (or appropriate address)?
I use the second and it works fine. Following that link you posted it seems to be very dependant on things being ‘just right’ and I think I may have been very lucky to get it working first time.
Because Google requires HTTPS / SSL using my external URL for both internal + external is what fixed it - the logs were showing me it was trying to use HTTP causing the failures when I need to use HTTPS.
Because of google tts changing usage rules frequently i finally decided to develop the “node-red-google-notify” node. Each voice message is stored in a cache folder thus you need google tts only when the voice message is played for the first time.
If you want to give a try here you can find more details about the node: https://flows.nodered.org/node/node-red-google-notify