Composable Alarm Clock creates virtual alarm-clock devices in Home Assistant that users explicitly define. Rather than auto-discovering devices, this integration provides a centralized platform where you:
- Create and manage multiple alarms in one place
- Define alarm times, enabled states, and target actions
- Build automations and helpers around a consistent alarm entity structure
- Dynamically determine when to set the next alarm based on a unified alarm registry
Each virtual alarm has:
- A daily alarm time
- An enabled toggle
- Optional target entities and target services to activate when due
This is ideal for "alarm panels" in Home Assistant dashboards (for example, kids' rooms), while allowing parents to monitor whether alarms are set and enabled.
Key benefit: A unified alarm registry makes it simple to build helpers, automations, and logic around your alarms—all from a single, easy-to-query set of entities.
- Alarm management panels for family members or guests
- Automation helpers that reference alarm state to determine next wake-up time
- Dynamic scheduling based on multiple alarm entities
- Multi-target activation (lights, speakers, notifications) when alarms trigger
- Service-based alarm control from scripts, automations, and dashboards
- Async integration code in
custom_components/hacomposablealarmclock - One integration entry that can host many virtual alarms
- Persistent storage + local scheduling for alarm due events
- Dynamic entities per alarm:
switchfor enabled/disabledtimefor alarm timebuttonfor manual trigger-nowsensorfor next due, last triggered, configuration, and status
- Workspace-level summary entity:
sensorfor workspace overview (alarm count + compact alarm snapshot list)
- Service actions to create, update, delete, and trigger alarms
- Unified action-based service in Devices and Services:
hacomposablealarmclock.alarm_manage - Flow-first alarm management from integration options (add/edit/delete/clone/toggle)
- Event emission when alarms are due:
hacomposablealarmclock_alarm_triggered - Diagnostics output with stored alarm definitions
- Repairs issue + fix flow when enabled alarms have no targets
- Tests using
pytest-homeassistant-custom-component - Dynamic cleanup of remnant entities and devices
- Clone this repository.
- Create a Python virtual environment.
- Install development dependencies:
pip install -r requirements-dev.txt
- Run tests:
pytest
- Run linting:
ruff check .
- Run typing checks:
mypy custom_components tests
- Create a Home Assistant test config directory, for example
./config. - Copy
custom_components/hacomposablealarmclockinto your HA config underconfig/custom_components/. - Start Home Assistant.
- Go to Settings -> Devices & services -> Add integration.
- Add "Composable Alarm Clock" and complete setup.
- Open the integration Options to manage alarms with guided forms.
This repository includes a dashboard template at:
docs/LOVELACE_DASHBOARD.yaml
What it includes:
- Flow-aligned alarm management controls using
hacomposablealarmclock.alarm_manage - Buttons for legacy services (
create_alarm,update_alarm,delete_alarm,trigger_alarm) - Visualization cards for workspace overview and per-alarm status/timeline
How to use:
- Open Home Assistant and create a new dashboard (or edit an existing one in YAML mode).
- Copy the contents of
docs/LOVELACE_DASHBOARD.yamlinto the dashboard YAML. - Replace each
REPLACE_...entity placeholder with real entity IDs from Developer Tools -> States. - Update sample
alarm_id, names, times, and targets to match your environment.
This repository also includes a custom dashboard strategy scaffold:
docs/lovelace_strategy/hacomposablealarmclock-dashboard-strategy.js
This strategy can appear under Home Assistant's Add dashboard dialog (Community dashboards) once loaded as a frontend module resource.
Setup guide:
docs/lovelace_strategy/README.md
-
hacomposablealarmclock.alarm_manage- Unified action-based service for Devices and Services.
- Actions:
create,update,upsert,delete,enable,disable,trigger_now,list. - Optional
config_entry_idtargets a specific integration entry. - Supports
dry_run: trueto validate changes without persisting.
-
hacomposablealarmclock.create_alarm- Creates or replaces one virtual alarm.
-
hacomposablealarmclock.update_alarm- Updates an existing virtual alarm.
-
hacomposablealarmclock.delete_alarm- Deletes a virtual alarm and removes its per-alarm entities and device.
-
hacomposablealarmclock.trigger_alarm- Triggers a virtual alarm immediately.
When an alarm is due (or manually triggered), the integration:
- Fires event
hacomposablealarmclock_alarm_triggered - Calls
homeassistant.turn_onfor configured target entities - Calls any configured target services (
domain.service)
This lets you fan out to lights, speakers, scripts, scenes, and mobile notification services.
Service inputs are validated before alarms are stored or triggered:
- Alarm IDs and names must be non-empty.
- Alarm times must be valid daily times in
HH:MMorHH:MM:SSformat. - Target services must use
domain.serviceformat. - Update, delete, and trigger actions return a translated validation error when the alarm does not exist.
On setup, the integration reconciles stored alarm definitions with Home Assistant's entity and device registries. Stale per-alarm entities or devices left behind by earlier versions or interruptions are automatically cleaned up.
Home Assistant requires all tier rules below the target tier to be met.
- Bronze: baseline UI setup, tests, docs, unique IDs.
- Silver: robust runtime behavior, reauth, unloading, ownership, high coverage.
- Gold: diagnostics, translation quality, reconfiguration, strong docs.
- Platinum: strict typing, async dependency model, injected websession.
This scaffold includes a practical implementation for many rules and records exemptions in:
custom_components/hacomposablealarmclock/quality_scale.yamldocs/QUALITY_SCALE.mdbranding/README.md
Local branding directory layout is included in this repository under:
brands/custom_integrations/hacomposablealarmclock/
To use local branding in Home Assistant before upstream publication, copy the repository brands folder into your Home Assistant config directory.
- Discovery protocols are not implemented (devices are user-created).
- Brand images are included locally and can be used via the local
brandsfolder, but are not yet published tohome-assistant/brands.
MIT