A comprehensive alarm clock integration for Home Assistant that provides powerful alarm clock functionality with entities, services, and automations.
This integration provides:
- π§ Custom Integration - Complete alarm clock functionality with entities, services, and automations
- π¨ Companion Card - Works with the separate Alarm Clock Card for beautiful UI
- ποΈ Flexible Scheduling - Set different alarm times and enable/disable for specific days of the week
- π€ Voice Control - Complete voice control using Home Assistant Voice Preview with room-specific targeting
- π Built-in Sound Support - Direct media player integration with built-in alarm sounds and custom URL support
- π¬ Script Integration - Execute Home Assistant scripts at three different stages:
- Pre-alarm: Run scripts before the alarm (e.g., gradually turn on lights)
- Alarm trigger: Run scripts when the alarm goes off (e.g., play music, announcements)
- Post-alarm: Run scripts after a delay to end the alarm (e.g., turn off music)
- π΄ Smart Snooze - Configurable snooze duration (1-30 minutes) and maximum snooze count
- π€ Auto-Dismiss - Automatically dismiss alarms after a specified time
- π― Multiple Entities - Creates time, switch, and sensor entities for full control
- π Rich Status - Real-time status updates with time until next alarm
- π Multi-language Support - Internationalization ready
- β° Large Time Display - Clear, easy-to-read time with next alarm information
- ποΈ Time Picker - Intuitive time selection interface
- π Day Toggles - Quick enable/disable for each day of the week
βΆοΈ Control Buttons - Snooze and dismiss buttons when alarm is active- π Script Display - Shows configured pre/post alarm scripts
- π¨ Status Animations - Visual feedback for alarm states
- βοΈ Card Editor - GUI configuration in Lovelace editor
- π± Mobile Responsive - Works perfectly on all screen sizes
- Open HACS in your Home Assistant instance
- Go to "Integrations"
- Click the "+ Explore & Download Repositories" button
- Search for "Alarm Clock"
- Click "Download"
- Restart Home Assistant
- Go to Settings β Devices & Services
- Click "+ Add Integration" and search for "Alarm Clock"
- Follow the configuration wizard
β Both Components Installed! The integration AND the Lovelace card are now available.
- Copy the
custom_components/alarm_clockfolder to your Home Assistantcustom_componentsdirectory - Copy the
www/alarm-clock-card/alarm-clock-card.jsfile to yourwww/alarm-clock-card/directory - Restart Home Assistant
- Add the card resource:
- Go to Settings β Dashboards β Resources
- Click "+ Add Resource"
- URL:
/local/alarm-clock-card/alarm-clock-card.js - Resource type: JavaScript module
- Go to Settings β Devices & Services
- Click "+ Add Integration" and search for "Alarm Clock"
- Follow the configuration wizard
The integration uses a GUI configuration flow with three steps:
- Name: Give your alarm clock a friendly name
- Default Alarm Time: Set the initial alarm time (can be changed later)
- Media Player Entity: Select a media player to play alarm sounds (optional)
- Alarm Sound: Choose from built-in sounds or custom URL:
- Classic Alarm Beep: Traditional alarm clock sound
- Gentle Chime: Soft bell chime for gentle wake-up
- Urgent Beep: More intense beeping for heavy sleepers
- Digital Alarm: Modern digital alarm sound
- Custom URL: Use your own sound file URL
- Alarm Volume: Volume level (0-100%, default: 50%)
- Repeat Sound: Whether to keep playing until dismissed (default: enabled)
- Pre-alarm Script: Optional script to run before the alarm
- Pre-alarm Minutes: How many minutes before the alarm to run the pre-alarm script (1-60)
- Alarm Script: Optional script to run when the alarm triggers (can be used alongside media player)
- Post-alarm Script: Optional script to run after the alarm to end it
- Post-alarm Minutes: How many minutes after the alarm to run the post-alarm script (1-120)
- Snooze Duration: How long each snooze lasts (1-30 minutes, default: 9)
- Maximum Snoozes: Maximum number of times the alarm can be snoozed (0-10, default: 3)
- Auto-dismiss Minutes: Automatically dismiss alarm after this time (5-120 minutes, default: 30)
- Default Enabled Days: Which days of the week the alarm is enabled by default
For each alarm clock instance, the following entities are created:
alarm_clock.{name}- Main alarm clock entity with state (off/armed/ringing/snoozed)time.{name}_alarm_time- Set the alarm time
switch.{name}_enabled- Enable/disable the alarmswitch.{name}_mondaythroughswitch.{name}_sunday- Enable/disable for each dayswitch.{name}_snooze- Snooze control (only available when ringing)
sensor.{name}_next_alarm- Shows the next scheduled alarm timesensor.{name}_status- Current alarm status with additional attributessensor.{name}_time_until_alarm- Time remaining until next alarm (in minutes)
number.{name}_snooze_duration- Adjust snooze duration (1-30 minutes)number.{name}_max_snoozes- Adjust maximum snooze count (0-10)
The integration supports comprehensive voice control through Home Assistant Voice Preview. Commands automatically target the alarm clock in the room where the voice command is issued.
- "Set alarm for 7:30 AM" β "Alarm set for 7:30 am"
- "Wake me up at six thirty" β Natural language time setting
- "Set bedroom alarm for 8:00 AM" β Room-specific targeting
- "I need to wake up at 6:00 AM" β Various natural expressions
- "Turn on alarm" β "Alarm enabled for 7:30 am"
- "Turn off my alarm" β "Alarm disabled"
- "Enable alarm" β Activate alarm with confirmation
- "Disable the alarm" β Deactivate alarm
- "Snooze" β "Alarm snoozed for 9 minutes"
- "Stop alarm" β "Alarm dismissed"
- "Dismiss alarm" β Stop ringing alarm
- "Turn off alarm" β Emergency stop
- "What time is my alarm?" β "Your alarm is set for 7:30 am and is currently enabled"
- "When is my alarm?" β Get next alarm time
- "Is my alarm on?" β Check enabled status
- "Alarm status" β Complete status report
- "Turn on alarm for Monday" β "Alarm enabled for Monday"
- "Enable alarm for weekdays" β Enable Mon-Fri
- "Turn off alarm for Saturday" β "Alarm disabled for Saturday"
- "Set alarm for weekdays" β Bulk day management
- Time Formats: "7:30", "7:30 AM", "seven thirty", "6:00 in the morning"
- Flexible Phrasing: Multiple ways to express the same command
- Context Awareness: Understands morning/evening context
Voice commands automatically target the alarm clock in the room where spoken:
- Bedroom: "Set alarm for 7:30 AM" β Sets bedroom alarm
- Kitchen: "Turn on alarm" β Enables kitchen alarm
- Living Room: "What time is my alarm?" β Queries living room alarm
- Office: "Snooze" β Snoozes office alarm
- Area Detection: Automatic room/area identification
- Device Fallback: Uses first available alarm if room-specific not found
- Name Targeting: "Set bedroom alarm" explicitly targets by name
- Multi-Room Support: Different alarms in different rooms
- Home Assistant Voice Preview enabled
- Area Assignment - Alarm clocks assigned to correct rooms
- Voice Assistant - Echo, Google Home, or HA built-in assistant
- Install alarm clock integration
- Assign alarm devices to rooms in HA
- Enable Voice Preview in HA settings
- Start using voice commands immediately
For complete voice control documentation, see VOICE_CONTROL.md.
The integration provides the following services:
Snooze the alarm for the configured duration.
service: alarm_clock.snooze
target:
entity_id: alarm_clock.bedroom_alarmDismiss the active alarm.
service: alarm_clock.dismiss
target:
entity_id: alarm_clock.bedroom_alarmSet the alarm time programmatically.
service: alarm_clock.set_alarm
target:
entity_id: alarm_clock.bedroom_alarm
data:
time: "07:30"Toggle alarm for a specific day of the week.
service: alarm_clock.toggle_day
target:
entity_id: alarm_clock.bedroom_alarm
data:
day: "monday"For the companion Lovelace card (available separately), after installation add it to your dashboard:
type: custom:alarm-clock-card
entity: alarm_clock.bedroom_alarmtype: custom:alarm-clock-card
entity: alarm_clock.bedroom_alarm
name: "Bedroom Alarm"
show_name: true
show_scripts: true
show_days: true
compact: false
theme: autoentity(required): The alarm clock entityname(optional): Custom name for the cardshow_name(optional): Show/hide the card name (default:true)show_scripts(optional): Show/hide script information (default:true)show_days(optional): Show/hide day toggles (default:true)compact(optional): Use compact layout (default:false)theme(optional): Theme mode (auto,light,dark, default:auto)
- β° Large Time Display - Shows current alarm time with next alarm info
- ποΈ Interactive Time Picker - Tap to adjust alarm time
- π Day Toggles - Quick enable/disable for each day
βΆοΈ Control Buttons - Snooze and dismiss when alarm is active- π Status Indicators - Visual feedback for alarm states
- π Script Information - Shows configured automation scripts
alias: "Bedroom Wake Up Lights"
description: "Gradually brighten lights 15 minutes before alarm"
sequence:
- service: light.turn_on
target:
entity_id: light.bedroom_lights
data:
brightness: 1
color_temp: 500
- repeat:
count: 15
sequence:
- delay: '00:01:00'
- service: light.turn_on
target:
entity_id: light.bedroom_lights
data:
brightness: "{{ (repeat.index * 17) | int }}"
color_temp: "{{ (500 - (repeat.index * 20)) | int }}"
mode: singlealias: "Morning Alarm Sound"
description: "Play music and make announcements"
sequence:
- service: media_player.volume_set
target:
entity_id: media_player.bedroom_speaker
data:
volume_level: 0.1
- service: media_player.play_media
target:
entity_id: media_player.bedroom_speaker
data:
media_content_id: "https://example.com/gentle-alarm.mp3"
media_content_type: "audio/mpeg"
- delay: '00:00:30'
- service: tts.speak
target:
entity_id: tts.google_en
data:
entity_id: media_player.bedroom_speaker
message: "Good morning! Today is {{ now().strftime('%A, %B %d') }}. The weather is {{ states('sensor.weather_temperature') }} degrees."
- repeat:
count: 10
sequence:
- delay: '00:00:30'
- service: media_player.volume_set
target:
entity_id: media_player.bedroom_speaker
data:
volume_level: "{{ (0.1 + (repeat.index * 0.05)) | round(2) }}"
mode: singlealias: "End Morning Alarm"
description: "Clean up after alarm dismissal"
sequence:
- service: media_player.media_stop
target:
entity_id: media_player.bedroom_speaker
- service: light.turn_on
target:
entity_id: light.bedroom_lights
data:
brightness: 255
color_temp: 250
- delay: '00:10:00'
- service: light.turn_off
target:
entity_id: light.bedroom_lights
data:
transition: 300
mode: singleYou can create multiple alarm clock instances for different rooms or purposes:
# Configuration for bedroom alarm
- platform: alarm_clock
name: "Bedroom Alarm"
# Configuration for kitchen alarm
- platform: alarm_clock
name: "Kitchen Alarm"automation:
- alias: "Disable Bedroom Alarm on Weekends"
trigger:
- platform: time
at: "23:00:00"
condition:
- condition: time
weekday:
- fri
action:
- service: switch.turn_off
target:
entity_id:
- switch.bedroom_alarm_saturday
- switch.bedroom_alarm_sundayautomation:
- alias: "Enable Bedroom Alarm for Work Week"
trigger:
- platform: time
at: "21:00:00"
condition:
- condition: time
weekday:
- sun
action:
- service: switch.turn_on
target:
entity_id:
- switch.bedroom_alarm_monday
- switch.bedroom_alarm_tuesday
- switch.bedroom_alarm_wednesday
- switch.bedroom_alarm_thursday
- switch.bedroom_alarm_friday- Check alarm enabled: Ensure
switch.{name}_enabledis on - Verify day settings: At least one day must be enabled
- Confirm alarm time: Check
time.{name}_alarm_timeis set correctly - Script validation: Ensure the alarm script exists and is valid
- Check logs: Look for errors in Home Assistant logs
- Entity verification: Confirm all entity IDs in scripts are correct
- Script testing: Test scripts manually to ensure they work
- Permission check: Ensure scripts have proper permissions
- Log analysis: Check Home Assistant logs for script execution errors
- Resource registration: Ensure card is registered in dashboard resources
- File path: Verify
/local/alarm-clock-card.jsexists and is accessible - Browser cache: Clear browser cache and hard refresh (Ctrl+F5)
- Console errors: Check browser developer console for errors
- Entity check: Ensure the alarm clock entity exists and is available
- WebSocket connection: Check Home Assistant WebSocket connection
- Browser compatibility: Ensure using a modern browser
- Card configuration: Verify card YAML configuration is correct
- Ensure Home Assistant time zone is configured correctly
- Check that alarm times account for daylight saving time changes
- Limit the number of alarm clock instances (recommended: β€ 5)
- Optimize scripts to avoid long-running operations
- If entities get out of sync, restart Home Assistant
- Check for conflicting automations that might interfere
Requirements:
- Node.js 16 or higher
- npm or yarn
# Install dependencies
cd ui
npm install
# Development build (with watch)
npm run dev
# Production build
npm run build
# Lint code
npm run lint
# Format code
npm run formatalarm-clock/
βββ custom_components/alarm_clock/ # Integration files
β βββ __init__.py # Integration setup
β βββ alarm_clock.py # Main alarm clock logic
β βββ config_flow.py # Configuration flow
β βββ const.py # Constants
β βββ manifest.json # Integration manifest
β βββ services.yaml # Service definitions
βββ ui/ # Lovelace card source
β βββ dist/ # Built files
β βββ *.ts # TypeScript source files
β βββ package.json # Dependencies
β βββ webpack.config.js # Build configuration
βββ hacs.json # HACS configuration
βββ README.md # This file
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
# Test the integration
pytest tests/
# Test the card
cd ui
npm test
# Type checking
npm run type-check- Home Assistant: 2023.1.0 or higher
- HACS: 1.6.0 or higher
- Python: 3.9 or higher
- Node.js: 16 or higher (for development)
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
- π¬ Community: Home Assistant Community
This project is licensed under the MIT License - see the LICENSE file for details.
- Home Assistant community for inspiration and support
- HACS for making installation seamless
- All contributors who help improve this integration
β If you like this integration, please star the repository!