Hey everyone! I’ve been diving into the world of Home Assistant and wanted to share a fun project I’ve been working on—a countdown timer that announces every minute. I know a lot of you might be thinking, ‘Why would I need that?’ Well, let me walk you through my journey and how I made it happen!
The Problem
I’ve always wanted a timer that doesn’t just notify me once when it’s done but keeps me updated every minute. Imagine being able to say, ‘Hey Google, start a 10-minute timer and let me know every minute!’—sounds pretty handy, right? I decided to tackle this challenge and see if I could pull it off with Home Assistant.
The Solution
After some research and experimentation, I found a way to achieve this using scripts and templates. Here’s a step-by-step breakdown of what I did:
-
Setting Up the Input Number
- I created an input number entity called
input_number.countdown_minutes. This acts as a global variable to track the countdown. - You can access it under the Configuration > Helpers section.
- I created an input number entity called
-
Creating the Script
- I wrote a script named
countdown_timerthat runs every minute. Here’s what it does:- Announces the remaining time using text-to-speech.
- Decrements the countdown value by 1 each minute.
- When the countdown reaches 0, it resets to 5 and announces that time’s up!
- The script also includes a 58-second delay to ensure it runs every minute without overlapping.
- I wrote a script named
-
Adding a Template Switch
- To control the script easily, I created a template switch called
switch.countdown_timer. - This switch shows the current state of the script (running or stopped) and allows you to start or stop it with a single toggle.
- To control the script easily, I created a template switch called
-
Setting Up the Frontend
- I added both the input number and the switch to my dashboard for easy access.
- You can customize the layout to suit your preferences—whether it’s a simple card or a more elaborate display.
-
Integrating with Google Assistant
- For those of you who use Google Assistant, I’ve also included steps to expose the countdown timer scripts to Google.
- This means you can now control your countdown timer using voice commands like ‘Hey Google, start the 5-minute countdown!’
-
Routines for Voice Commands
- To make the voice commands even shorter, I set up routines in Google Assistant.
- Now, instead of saying ‘Turn on 5-minute countdown,’ I can simply say ‘5-minute countdown.’
The Results
I’ve been using this countdown timer daily, and it’s been a lifesaver! Whether I’m timing a task, cooking, or just needing a reminder, it’s always there to help. The best part? It’s completely customizable. You can adjust the countdown duration, the announcement message, and even the sound that plays at the end.
Tips and Tricks
- If you want to change the announcement language, you can modify the
languageparameter in the script. - You can also tweak the delay times to adjust how often the timer announces.
- For visual feedback, consider adding a notification or changing the state of a light when the countdown reaches certain milestones.
Final Thoughts
This project was a great way to dive deeper into Home Assistant’s scripting capabilities. It’s amazing how customizable everything is, and I can’t wait to see what other cool projects I can come up with next!
If you’ve found this guide helpful or if you have any questions, feel free to drop a comment below. I’d love to hear how you’re using countdown timers in your smart home setup!
Happy automating! ![]()