Hi,
I’m trying to make an automation that talks to me at one of my media player at 05.55 every morning.
I have tts setup and it’s working but when I ad a sensor value to the message it won’t work.
I have tried the example from ha example and it’s not working either.
Can someone please post an example of this how to make it work.
Tts every day at Time 05.55
Entity_id: mediaplayer.bosekitchen
Message: Godmorning temperature outside is now “Sensor.temp” and there is “sensor.pellets” percent left in the storage. Have a nice day.
action:
- service: tts.your-tts-service
entity_id: media_player.bosekitchen
data_template:
message: "Godmorning temperature outside is now {{ states('sensor.temp') }} and there is {{ states('sensor.pellets') }} percent left in the storage. Have a nice day."
Replace tts.your-tts-service with whatever TTS service you’re using.
Hiu. Hoping someone can point me in the right direction. Trying for days to get google TTS to announce sensor battery voltage. I know I need to use a template but how? Where? In my HA automation I tried this:
action:
service: tts.google_translate_say
entity_id: media_player.bosekitchen
data_template:
message: “Battery voltage is {{ states(‘sensor.jk_bms3_total_voltage’) }} .”
But google tts reads the text and not the sensor value (‘sensor.jk_bms3_total_voltage’). Any help/suggestion appreciated
There are vague hints one needs to create the automation in configuration.yaml file. It’s easy peasy to get dev/tool template to convert sensor value to the correct sensor text value but then what do I do? Vague indeed.
service: tts.google_translate_say
data:
entity_id: media_player.livingroomhp
message: Hot water is {{states('sensor.rinnai_outlet_temperature') | round(0) }}.
Addind the period at the end of the line, when you are not using rounding, changes the reporting to sound different for numbers.
No period would report 80.0 as eighty point oh
Period would report 80.0 as eighty point zero
And if your media device is a homepod is your media device expect some issues over the long term.
If you are playing audio and you run your automation it will interupt your music , play you gTTs and not resume your music.
If you are not playing music it will play your gTTS and then leave your homepod in a “Playing” state even though it is not playing… The next time you try to play a gTTS it will not work to that Homepod mini unless you toggle for at least 200ms…A real pain to code around, but you can if you want to use seemless announcments.