Is there any way for HA to trigger Alexa to say something (something custom - as dictated by HA)?
What about Google Assistant?
What about the Google Assistant for hass.io?
I’m trying to determine what my options are for an automation that looks like this…
HA checks weather
HA sees that it’s likely to start raining in the next hour
HA checks window sensors and sees that the dining room and bedroom windows are open.
HA triggers Alexa/Google Assistant/Mycroft/_______ to say, “It’s going to rain soon. You might want to close the dining room and bedroom windows.”
I’m not sure about Alexa, but with the google home you can use tts.google_say with the data of {"message": "your message to speak", "entity_id":"the entity id of your google home"}.
You could also look into Amazon Polly, as it doesn’t take long to get bored with the way the Google Home speaks your text. Polly supports SSML which allows you to insert pauses, emphasis, pitch, rate etc.
There’s a free tier for a year, and after that you get charged per million characters, so it’s cheap but not free. I think. I’m still in the free year.
Check out this thread. If you aren’t afraid of a little coding you can use Appdaemon to send text to this and it will output it on the desired alexa unit.
Right now, I have mine telling me when the back door is opened if it’s after we have set the nighttime mode at the house. I open the door and Alexa pops up and says “the back door is open, please remember to close and lock it when you are done”.
VERY cool! I’m not afraid of coding (though I’m a python novice – I do a lot better when I have example code that I can paste and modify).I’m definitely going to look into that!
With that custom component linked to by @turboc there is no advanced coding required. It simply exposes your echo devices to HA as media players. Which allows you to use the standard TTS coding in yaml you may already be accustomed to.
example:
- alias: Weekly TTS Test
trigger:
platform: time
at: '12:15:00'
condition:
condition: time
weekday:
- wed
action:
- service: media_player.alexa_tts
data:
entity_id:
- media_player.computer_room_dot
- media_player.kitchen_dot
- media_player.livingroom_dot
#- media_player.master_bedroom_dot
message: "This is a weekly test of the announcing system"