I’m trying to get a custom “good morning” routine going. The first thing I’m working on is a Google travel time sensor. I have that up and working, but I can’t use it in a template for TTS. It works as expected when testing the same message over the Notify component to my Pushbullet.
Google Home is speaking the template instead of the template value that should result from the template.
Example: Using the Services page to manually trigger this event
Domain: tts
Service: google_say
Service Data:
{
"cache": false,
"entity_id": "media_player.bedroom_home",
"message": "If you left now, it would take {{ states('sensor.travel_time') }} minutes to get to Work Location."
}
The {{ states('sensor.travel_time) }} template results in the number 18 (for 18 minutes). Instead of saying “eighteen” the Google home will say: “It will take states sensor dot travel underscore minutes to get to Work Location.”
However, as I said, when sending the same message over the Notify domain, the template gets evaluated to the number 18 as expected.
Am I missing anything here, or is this a limitation/bug with TTS right now?
Yes, I am. The daily briefing isn’t very useful, especially since it’s mostly designed for a single user. I want something that can trigger a few times automatically while my wife and I are getting ready in the morning to let us know how much we need to rush out the door to get to work on time. That, along with weather summary and any other information I can jam in there.
Currently trying out solution suggested by @rpitera
Nice! I currently just have an automation to start NPR in the morning, but getting the daily briefing stuff in there would be great too. Especially, like you said, it wouldn’t have to be just for me, could be for my wife’s commute too.
I don’t have an issue with using it within a script, but is there any reason why it can’t be used in the TTS service itself like I can use it in Notify?
No issue, I just did that while testing. I often test service calls via script so I can manually trigger; this way I know that the action will work and if the automation fails it narrows down the problem to either conditions or triggers.
I had it working just fine with data_template, but not anymore…altough the telegram notification is sending the value, this is my script:
notificar:
sequence:
service: tts.google_say
entity_id: media_player.oficina
data_template:
message: ‘{{ mensaje }}’
cache: false
Persistent and telegram says the correct value, but not TTS
Any ideas?
id: '1560719023217'
alias: AVISO CONSUSMO
trigger:
- above: '3000'
entity_id: sensor.general_power
for: 00:03:00
platform: numeric_state
condition: []
action:
- data:
message: Alerta de consumo de mas de 3000w por 3 minutos , el consumo actual
es {{states.sensor.general_power.state}} W
service: notify.teleg_ariel
- data:
message: Alerta de consumo de mas de 3000w por 3 minutos , el consumo actual
es {{states.sensor.general_power.state}} W
entity_id: media_player.google_home
service: tts.google_say