Need help turning YAML into Node-Red

I have code that works in YAML but when I try to make the equivalent block in Node-Red I get confused. anyone able to help?

action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.googlehome9271
message: “Hi!”
target:
entity_id: tts.google_translate_en_com

Data

{
   "entity_id":"media_player.googlehome9271",
   "message":"Hi!",
   "cache": true
}

There’s a weird error with this:
“NoConnectionError: NoConnectionError”
I also don’t have a “google_en_com” but “google_translate_en_com”

Do you have anything else in nodered? Are other flows working? In the server drop down box, is there more than one server?

Everything else works, and I only have 1 server. I tried again and it gave me a ““HomeAssistantError: required key not provided @ data[‘media_player_entity_id’]””

Change the data to

{
   "media_player_entity_id":"media_player.googlehome9271",
   "message":"Hi!",
   "cache": true
}

Works like a charm. Thank you!

1 Like