I am using the sonos_say script as described in the cookbook:
sonos_say:
alias: "Sonos TTS script"
sequence:
- service: sonos.snapshot
data:
entity_id: "{{ sonos_entity }}"
- service: sonos.unjoin
data:
entity_id: "{{ sonos_entity }}"
- service: media_player.volume_set
data:
entity_id: "{{ sonos_entity }}"
volume_level: "{{ volume }}"
- service: tts.google_translate_say
data_template:
entity_id: "{{ sonos_entity }}"
message: "{{ message }}"
language: 'de'
- delay: "{{ delay }}"
- service: sonos.restore
data:
entity_id: "{{ sonos_entity }}"
This is part of an automation in which I call the script:
- service: script.sonos_say
data:
sonos_entity: media_player.unnamed_room
volume: 0.5
message: "Test: Read the state of {{ ((states.sensor.netatmo_home.state)) }}"
delay: '00:00:15'
If I do this Google TTS creates an mp3 reading back “…states dot sensor dot…”. I read that to change this I have to change data to data_template when calling the google service which I do (see above), but somehow the template inside the template (because it gets passed to the service using the script) doesn’t render.
Can someone point me in the right direction for this?