We have all been there. You get comfortable in bed, turn off the lights, and drift off to sleep, only to wake up the next morning realizing you forgot to lock the back door, take your vitamins, or put the leftovers away.
If you are running Home Assistant, you don’t need to rely on your own memory. You can use a simple automation to turn your Google Home (or any smart speaker) into a nagging—but helpful—assistant.
Here is a quick YAML script I use to make sure I never forget my specific nightly tasks.
The Code
alias: Send message to Google Home as an alarm
description: ""
triggers:
- trigger: time
at: "21:45:00"
conditions: []
actions:
- repeat:
count: 2
sequence:
- action: tts.speak
data:
cache: true
media_player_entity_id: media_player.bedroom_speaker
message: Keep the flour into the fridge, please
target:
entity_id: tts.google_translate_en_com
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
mode: single
How It Works
This automation is straightforward but effective:
- The Trigger: At exactly 9:45 PM (21:45), the automation wakes up.
- The Action: It uses the Text-to-Speech (TTS) service to broadcast a message to a specific speaker.
- The Loop: It repeats the message twice, with a 5-second pause in between. This ensures that if you missed it the first time because you were brushing your teeth, you’ll catch it the second time.
Making It Yours: What You Need to Change
You probably don’t need to be reminded to put flour in the fridge every night! If you copy and paste this code into your Home Assistant automations.yaml or the UI editor, make sure you update these four things:
- 1. The Time (
at: "21:45:00"): Change this to the time you usually wind down for the bed. If you go to sleep later, change this to23:00:00. - 2. The Media Player (
media_player.bedroom_speaker): This is the most important change. You must replacebedroom_speakerwith the actual Entity ID of your specific Google Home or Sonos device. You can find this in your HA settings under “Devices & Services.” - 3. The Message (
message: ...): Change “Keep the flour into the fridge” to whatever you actually need to remember.- Examples: “Check the front door lock,” “Take your medication,” or “Put the dishwasher on.”
- 4. The TTS Service (
entity_id: tts.google_translate_en_com): This code uses the standard Google Translate TTS. If you use Nabu Casa (Home Assistant Cloud) or a local option like Piper, you will need to change this entity ID to match your preferred text-to-speech engine.
Summary
Home automation doesn’t always have to be about complex motion sensors and lighting algorithms. Sometimes, the best automation is just a simple voice reminding you to do that one thing you always forget!
Leave a Reply
You must be logged in to post a comment.