Want your Google Home to announce something when you flip a switch? Here’s a simple automation that does exactly that.
What This Automation Does
This automation listens to your smart switch. Whenever you toggle it (turn it on or off), it triggers your Google Home speaker to say a message out loud. Simple as that! You can use it for confirmations, announcements, or just to add some voice feedback to your smart home.
The Code
yaml code
alias: New automation
description: ""
triggers:
- trigger: state
entity_id:
- switch.conbre_4_switches_module_switch_4
conditions: []
actions:
- action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.living_room_speaker
message: Hi
target:
entity_id: tts.google_translate_en_com
mode: single
How to Use It
- Copy the code above
- Go to Settings → Automations in Home Assistant
- Create a new automation and paste the code
- Change
switch.conbre_4_switches_module_switch_4to your switch entity ID - Change
media_player.living_room_speakerto your Google Home entity ID - Change the
messageto whatever you want it to say - Save and test!
That’s it! Now your home will talk to you.
Leave a Reply
You must be logged in to post a comment.