Switch Timer Card is a custom Lovelace card for Home Assistant that provides a user-friendly interface to control a switch entity with added timer functionality. This card allows you to turn a switch ON or OFF and set a timer to automatically turn it off after a specified duration. It also features a collapsible design for a neat and organized UI.
switch-timer-card-preview.mov
Installation • Usage/Instructions • Configuration • Example configurations • Help • Donate
HACS manual configuration
- Go to HACS in Home Assistant.
- On the top right, click "Custom repositories".
- Enter the repository URL: https://github.com/joseluis9595/lovelace-switch-timer-card.git
- Search for "Switch Timer Card".
- Click Install!
Manual installation without HACS
- Download switch-timer-card.js from the latest release.
- Move this file to home assistant's
<config>/wwwfolder. - In home assistant, go to
Settings > Dashboards. - On the top right corner, click
Resources. - Add a new resource with the following:
- URL:
/local/switch-timer-card.js - Resource type: JavaScript module
- URL:
- Go to your dashboard, refresh your page and add your new switch-timer-card!
Before using the Switch Timer Card, you need to create a Timer Helper in Home Assistant. Follow these steps to set it up:
- Open your Home Assistant Configuration and navigate to "Configuration" > "Helpers."
-
Click the "+ Add Helper" button.
-
Choose "Timer" as the Helper type.
-
Fill in the details for your timer, including a name and an optional icon.
-
Save the Helper.
Now, you can add the Switch Timer Card to your Lovelace dashboard and configure it as follows:
type: custom:switch-timer-card
switch_entity: switch.your_switch_entity
timer_entity: timer.your_timer_entity
title: Title of the card-
switch_entity: Replaceswitch.your_switch_entitywith the entity ID of the switch you want to control. -
timer_entity: Replacetimer.your_timer_entitywith the entity ID of the timer helper you created in Home Assistant. -
title(optional): You can specify a title for the card if desired.
| Name | Type | Default | Description |
|---|---|---|---|
switch_entity |
string | Required |
Entity ID of the switch you want to control. |
timer_entity |
string | Required |
Entity ID of the timer helper used for this card. |
title |
string | - | Optional title for the card. Will use the switch_entity friendly name by default. |
buttons |
Button[] | - | Customizable array of buttons with different time lengths for the timer. |
Configuration for each button in switch-timer-card. You can configure the length of time with which the timer will start when pressing each button, plus manually configuring the text to display in the button if needed.
| Name | Type | Default | Description |
|---|---|---|---|
seconds |
number | - | Seconds to add to the timer. |
minutes |
number | - | Minutes to add to the timer. |
hours |
number | - | Hours to add to the timer. |
text |
number | - | Optional text to override the auto-generated human readable time. |
type: custom:switch-timer-card
title: Room radiator
switch_entity: switch.radiator
timer_entity: timer.test_timer
buttons:
- minutes: 30
- minutes: 60
- hours: 1
minutes: 30Need help using switch-timer-card, have ideas, or found a bug? Here's how you can reach out:
-
🐛 Found a bug or have a feature request?
Open an issue on GitHub so we can track and fix it. -
💬 Have questions, want to share feedback, or just chat?
Start a discussion on GitHub.
Your feedback helps make switch-timer-card better for everyone. Don’t hesitate to reach out!
If you enjoy using switch-timer-card and want to support its continued development, consider buying me a coffee (or a beer 🍺), or becoming a GitHub Sponsor!
Your support means a lot and helps keep the project alive and growing. Thank you! 🙌