TTS - google, what am i doing wrong?

If i use 2 different tts message like so the states command or even just putting the entity name in it doesn’t work (it just names the entity name)

service: tts.google_translate_say
data:
  entity_id: media_player.first_bathroom_tv
  message: >-
    {{ [ "There are currently
    {{counter.house_occupant_count}} people in the house, x awake and x
    sleeping", "The average outside temperature is
    {{sensor.average_outside_temperature}}"] |random }}

If i use one message but like this, it works fine. This works on Alexa tts as well.

service: tts.google_translate_say
data:
  entity_id: media_player.first_bathroom_tv
  message: >-
    Warning. The water might be cold.
    {{states('counter.bathroom_shower_use_total')}} showers have been taken
    today.

Obviously the difference here is {{ [ " " ] }} in the tts with multiple strings but i’m not sure how else to compose multiple strings.

You’re currently trying to next one set of {{ }} inside another. I haven’t seem any claims about this working, and given it is not, it doesn’t look supported. Instead you should do it like the following:

{{ [ "There are currently " +
    states('counter.house_occupant_count') + " people in the house, x awake and x
    sleeping", "The average outside temperature is " +
    states('sensor.average_outside_temperature')] |random }}
1 Like

Great, i’ll try that, thanks!