Releases: scootaash/hass-wake-alarm
Release list
Minor adjustments from 0.5 release
What's Changed
- Keep the alarm at state PLAYING after the fade in so auto-dismiss and the card buttons work by @scootaash in #54
- Minor bug fixes
Full Changelog: 0.5.0...0.5.1
0.5.0 — More flexible alarms, script connections + a lots on reliability
🌅 Wake Alarm 0.5.0
Inspired by lots of great comments and ideas this is the biggest release I've shipped for Wake Alarm - more robust and some great new features. It now wakes you the way you want — a silent sunrise, a music-only alarm, or both; gated on whatever makes sense (presence, a bed sensor, a workday, link your own); with your own scripts woven in. And under the hood I gave it a load of reliability checks so the alarm always goes off (I hope!!).
✨ Highlights
- 🔦 Lights-only or 🎵 music-only Media players are now optional. Configure just lights for a silent sunrise, just speakers for a music alarm, or both. (#22)
- ⏰ Three script hooks, including a new "at alarm" one. Run your own automations before the light ramp starts, exactly at the alarm time (the new hook — coffee on, TTS greeting, blinds), and after (music ends / dismiss). All fire non-blocking, so a slow script never delays your wake-up. (#24)
- 🛏️ Condition-sensor gate. Only sound the alarm when a
binary_sensoris on — a bed sensor (only if you're actually in bed) or Home Assistant's Workday sensor (skip bank holidays). ANDs with presence. (#23) - 🎲 No more "same song every morning." A single speaker now shuffles and skips a random 1–4 tracks (silently, before the fade).
- 🛡️ Music and lights separated so the alarm always fires. Music now runs on its own independent timer — nothing in the light phase can stop it — plus restart catch-up if HA was down, and pinned DST behaviour.
- 🔎 Easier troubleshooting. Opt-in debug logging that prints a clean timeline, and a one-click Download diagnostics snapshot for bug reports.
🎁 Nice touches
- At-alarm precision — the new hook fires the instant the music starts (or the fire moment for a lights-only alarm), so "do X the moment I'm woken" finally has a home.
- Auto-dismiss is honoured even mid-snooze — a long snooze can't outlive your "stop after N minutes" setting.
- Friendlier card — clearer settings copy (auto-dismiss now says it counts from the music start), a dedicated Notifications section, and graceful UI when there's no speaker.
- Tested for real — the whole state machine runs against a real Home Assistant core with a frozen clock, so "does the alarm actually fire?" is a CI gate.
⬆️ Upgrading
Should be seamless. Your config entry migrates automatically (v2 → v5, all no-op steps) — nothing to re-toggle, and your lights/speakers/presence/notification settings and media selection are all preserved. Minimum Home Assistant: 2024.6.
🙏 Thanks
To be honest I wrote this for me so great to have community feedback. Thanks to everyone whose issues, enhancement requests, and forum feedback drove it. Most of what's here came straight from ideas and bug reports. 🙌
I built it with a big assist from Claude Code as an AI pair-programmer.
📋 Full changelog (appendix)
Added
- Media player is optional — lights-only or music-only alarms (#22). Pick at least one of lights / media players. With no speaker, the alarm runs the light ramp + standard notification and settles (urgent "speaker unavailable"/"no media" notices suppressed; snooze and auto-dismiss are music-only).
- Condition-sensor gate (#23). Optional
binary_sensorgate (bed sensor, Workday, etc.), checked at ramp-start and again at alarm time, ANDed with presence. - Before / at-alarm / after script hooks (#24). Three optional
script.*targets: before at ramp start (Lengthmin before the alarm), at-alarm exactly at the alarm time (music start, or the fire moment for lights-only), after at music end / dismiss / auto-dismiss (not on snooze). All non-blocking; receiveslug+nameas variables. - Restart catch-up. If HA is down across the alarm but boots back within the grace window (default 15 min), the alarm fires immediately on startup (music only); beyond that it rolls forward.
- Troubleshooting: debug logging + diagnostics. DEBUG logs across the scheduler/state machine, plus a config-entry Download diagnostics snapshot (person/notify targets redacted) showing the live schedule, state flags, and armed timers/tasks.
Changed
- Music is scheduled independently of the light ramp. Two separate timers (light ramp at
alarm_time − length, authoritative music atalarm_time); a failure anywhere in the light phase can no longer stop the alarm sounding. - Presence is re-checked at alarm time — gates lights (ramp start) and music (alarm time) independently.
- Single-player music now shuffles + random-skips like the Sonos group path, so the wake-up song varies; degrades gracefully on players without shuffle/next-track.
- The card hides music-only controls for a lights-only alarm (#46).
- A player failing mid-sequence no longer aborts the alarm (#45).
Fixed
- Unload/reload teardown race (#48) — a cancelled music task could re-arm timers and fire the after-script after teardown; teardown is now inert to those paths.
- Snooze during the ramp resumed ungrouped (#48) — now does a full music (re)start unless music was actually playing when snoozed.
- Card stuck on a transient resolve error (#48) — now retries (bounded) as the integration finishes loading.
- Mid-occurrence interference (#43, #44) — settings changes mid-fire are deferred so they can't double-fire; test buttons refused during the ramp→alarm gap.
- Auto-dismiss now fires during a snooze (#38); background tasks tracked + cancelled on unload (#35).
- Stranded alarm cycle when disabled during the ramp→alarm gap (#34).
- DST gap / fall-back alarm-time semantics pinned (#36).
- Card registration hardening (#19, #20, #37) — async version read, route claimed before await, executor
is_file(), and signed Music Assistant artwork URLs. - Ramp no longer restarts from zero when it finishes seconds before the alarm.
Migration
Config entry v2 → v5 (condition gate, before/after hooks, at-alarm hook) — all additive no-ops; nothing to re-toggle.
Tests / CI
HA-backed coordinator tests with a frozen clock; config_flow + migration suites (#39, #40); coverage reporting; min/latest HA matrix; HACS + hassfest validation.
0.3.0 — audit pass: schedule rearm, random Sonos track, MIT licence
Audit-driven cleanup pass. All changes are backwards-compatible; bumped to 0.3.0 because the volume of fixes is more than a patch warrants.
Fixed
- Schedule never rearmed after a natural fire. When the alarm ran end-to-end (ramp completes → music plays to fade-up → music completes), the coordinator dropped to IDLE but never called
async_recompute_schedule. Result:sensor.<slug>_next_alarmkept pointing at the just-fired (past) time and noasync_track_point_in_timewas armed for the next day until the user poked a dependency. Same root cause covered the early-return branches of_async_on_music_start(player unavailable / no media)._set_state(STATE_IDLE)now triggers the recompute on every transition into IDLE, regardless of how IDLE was reached. - Auto-dismiss timer was re-armed on every snooze resume. Each cycle restarted the timer at
auto_dismiss_minfrom the resume moment, so three snoozes effectively extended auto-dismiss by3 × snooze_min. The deadline is now captured at the first PLAYING transition and preserved across snooze cycles — N minutes after the alarm originally fired always means N minutes. - Tapping the mode tile during snooze disarmed the alarm. The tile showed
Music in M:SSand tapping disabledswitch.<slug>_enabled. Mode-tile tap is now a no-op while the alarm is active (ramping, playing, or snoozing); Snooze / Dismiss / Cancel ramp are the explicit controls. - Card instance-name was locale-fragile — it parsed the enabled-switch's
friendly_nameand stripped a literal "Enabled" suffix, which only works in English.sensor.<slug>_next_alarmnow carries the user-given instance name as aninstance_nameattribute and the card reads it from there. parse_action_idaccepted empty entry_ids.wake_alarm:snooze:was parsed as("snooze", ""), which could never resolve to a coordinator. Now rejected.
Changed
- Multi-Sonos: random track-skip on every fire and snooze resume. Sonos shuffle reorders the queue but doesn't pick a random starting track, so every alarm and every snooze used to begin on the same track from the configured favourite. The music sequence now skips 1–4 tracks forward (
media_next_track, random per fire) after the 5-second queue settle and before the fade, so the wake-up song is genuinely different each cycle. Single-player path is unchanged (it doesn't shuffle in the first place). - Volume slider displays as percentage (0–100%) instead of the raw 0.0–1.0 fraction. The underlying
number.<slug>_volumeentity still stores 0.0–1.0; the card does the multiply/divide. - Cancel-ramp button visible on the main view during ramping — used to be settings-only. Snooze / Dismiss are still always visible while active.
- Card ticker only runs during snooze. The 1Hz
requestUpdatethat drives the countdown used to run for the lifetime of every dashboard; it now starts when state transitions to SNOOZING and stops afterward. async_call_light_turn_onis now properly async (was a non-async def returning a coroutine — worked but read oddly).
Docs
LICENSEis now an actual MIT licence instead of an empty file.BRIEF.mdday-toggle entity IDs updated to the v2d1_mon..d7_sunscheme.
Upgrading
HACS → Wake Alarm → ⋮ → Redownload → pick 0.3.0 → restart HA. From 0.2.1 onward the versioned card URL handles cache-busting automatically.
0.2.0 — card UX, single-screen wizard, day reorder, device-card tidy, test notifications
Merge pull request #9 from scootaash/claude/light-ramp-music-sequence…
0.1.0 — initial release
Wake Alarm integration + Lovelace card. Single-install via HACS:
the integration ships the bundled card and registers it as a frontend
resource at /wake_alarm/wake-alarm-card.js, so users only add the
repo to HACS once (Integration category).