Skip to content

Feature proposal: Local Alarm on the device #467

@ChristianKuehnel

Description

@ChristianKuehnel

Hey folks,

I was thinking about contribution an alarm clock feature to the device. Something that is running locally on the ESP, that can then be triggered from HA via voice commands. So the alarm would be independent from HA, once it's set, similar to the timer.

For the first iteration I propose to set only a single alarm:

  • add a time source (e.g. platform homeassistant)
  • add a global int variable with the next alarm and a gobal bool variable if the alarm is active
  • once a minute, check if the alarm has expired and then trigger the sound, similar to the timer.
  • alarm can be configured through a actions from HA, something like:
    • set_alarm (set alarm to specific datetime)
    • stop_alarm (when it's alarming right now)
    • cancel_alarm (to cancel/disable an alarm that was set before)
    • expose current alarm as sensor (or something to HA), read-only
  • Persist alarm(s) ( restore_value: yes) during a power outage/restart/update/... (assuming we have enough space in the persistent storage?) to not lose the alarm in case of a restart of the device.
  • Once that works on the ESP, add the voice commands to the list of intents (https://github.com/OHF-Voice/intents) and integrate in Home Assistant Core.

In future iterations we could extend the functionality with:

  • add a snooze functionality (reset the alarm to x minutes in the future)
  • support multiple alarms (allow having more than one alarm, allow to cancel a specific one)

I'm happy to propose some implementation, but I wanted to hear you thoughts first.
Does that make sense?
Any better ideas?

Related discussions/requests:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions