Google_say tts wont speak

Hey everybody. My progress with Node-red is coming along nicely, I think. I am still having a hard time grasping Javascript, but that is another issue entirely.

My current issue is twofold: first, in my current automation, I am wanting to send a tts message through my google home mini when it is either sunset or sunrise. When I activate the automation with an inject node, the google home mini makes that little noise like it has a notification, but does not actually say anything. The telegram message that is also connected to the change node works just fine. Am I missing something in the change node or somewhere else that is making the google home miss the tts?

My second problem is that the sun events are not triggering the automation itsself. I guess I just don’t know what I need to put in front/behind the switch node in order for it to keep moving down the line.

[{"id":"de71a745.f58518","type":"server-state-changed","z":"9003fcc3.08f48","name":"Sun Entity","server":"645806a.fd431f8","version":1,"entityidfilter":"sun.sun","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":100,"y":40,"wires":[["c4c4ed31.97008"]]},{"id":"c4c4ed31.97008","type":"switch","z":"9003fcc3.08f48","name":"Sunrise or Sunset?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"sunset","vt":"str"},{"t":"eq","v":"sunrise","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":150,"y":140,"wires":[["ebc8160b.25bed8"],["183c5643.7a5f7a"]]},{"id":"f190f933.617fe8","type":"inject","z":"9003fcc3.08f48","name":"Test","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":40,"wires":[["ebc8160b.25bed8"]]},{"id":"9ff4f2f4.c1a3d","type":"api-call-service","z":"9003fcc3.08f48","name":"Announce on speaker","server":"645806a.fd431f8","service_domain":"tts","service":"google_say","data":"{\"entity_id\":\"media_player.living_room_google_home\",\"language\":\"en-us\",\"message\":\"{{payload}}\"}","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":660,"y":240,"wires":[[]]},{"id":"ebc8160b.25bed8","type":"change","z":"9003fcc3.08f48","name":"Set Message Text","rules":[{"t":"set","p":"payload","pt":"msg","to":"Sunset has started!  Don't forget to turn on the front porch light!","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":100,"wires":[["7690fdc2.78e154","1da13c0e.57b884"]]},{"id":"7690fdc2.78e154","type":"api-call-service","z":"9003fcc3.08f48","name":"Send Telegram","server":"645806a.fd431f8","service_domain":"notify","service":"telegram","data":"{\"message\":\"{{payload}}\"}","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":640,"y":100,"wires":[[]]},{"id":"83a74068.eea6e","type":"inject","z":"9003fcc3.08f48","name":"Test","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":240,"wires":[["183c5643.7a5f7a"]]},{"id":"183c5643.7a5f7a","type":"change","z":"9003fcc3.08f48","name":"Set Message Text","rules":[{"t":"set","p":"payload","pt":"msg","to":"Sunrise has started!  Dont forget to turn off the front porch light!","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":180,"wires":[["5b890380.c927bc","9ff4f2f4.c1a3d"]]},{"id":"5b890380.c927bc","type":"api-call-service","z":"9003fcc3.08f48","name":"Send Telegram","server":"645806a.fd431f8","service_domain":"notify","service":"telegram","data":"{\"message\":\"{{payload}}\"}","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":640,"y":180,"wires":[[]]},{"id":"1da13c0e.57b884","type":"api-call-service","z":"9003fcc3.08f48","name":"Announce on speaker","server":"645806a.fd431f8","service_domain":"tts","service":"google_say","data":"{\"entity_id\":\"media_player.living_room_google_home\",\"language\":\"en-us\",\"message\":\"{{payload}}\"}","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":660,"y":40,"wires":[[]]},{"id":"645806a.fd431f8","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

Regarding the TTS problem; I’ve been having similar issues but managed to solve them with the help of other community members. It turns out the tts.google_say service no longer works and you have to use tts.google_translate_say. I have no idea how or when this happened, but that’s the way it seems to be now. My tts config looks like this:

# Text to speech
tts:
  - platform: google_translate
    language: 'nl'
    base_url: https://XXXXX.duckdns.org

Hope this helps!

Try this node it should be easyer to configure and also supports queueing notifications.

https://flows.nodered.org/node/node-red-google-notify