I followed this link (changed to Google backend) to set up Sonos TTS:
I setup this automation:
alias: Sleep_tobeupdated
description: ''
trigger:
- platform: time
at: input_datetime.time_sleep
condition: []
action:
- service: input_boolean.turn_on
data: {}
entity_id: input_boolean.is_sleeping
- service: light.turn_on
entity_id: light.all_lights
data: {}
- service: input_boolean.turn_on
data: {}
entity_id: input_boolean.is_home
- service: script.sonos_say
data:
sonos_entity: media_player.library
volume: 0.3
message: {{"You have set wake up time to be " ~ states.input_datetime.time_wake.attributes.hour ~ ":" ~states.input_datetime.time_wake.attributes.minute}}
delay: '00:00:10'
mode: single
When I run the script, it reads out “object object none” from my Sonos speaker. “message” is sometimes automatically changed by system to be something like this (from my memory, I cannot reproduce it):
message:
[object][object]: None
In other times, it is automatically changed to Null
When I use the Template editor from Developer, the text is correct and string value is returned:
I feel that value_template may be the way to go, but I consulted the official documentation on Templating and there is no example for such use case.
Thanks. Revan