Adjustable Wake-up to Android alarm

Hi - just wanted to let you know that my test results have been positive so far. Automation works - switching on a couple of lights and the digital radio. Under condition of “at home” status of the mobile phone. :slight_smile:
No false alarm at midnight as of today.
Many thanks for your help. :+1:
BR
Achim

1 Like

Hey.
New user here. Have just installed v4 and noticed the blueprint is still running actions from alarms that are disabled.

Am running HA 2025.1.1.

Am I alone in this result or is it happening for others also?

Cheers

Blueprint is still running actions from alarms that are disabled? Same here. Seems to be a bug.
Best regards

Would it be possible to add a snooze alarm into this blueprint? Like turn on the lights when alarm sound and dim them when the snooze is hit and then full brighness when the next alarm after snoozing?

That would definitely be a nice feature, but it’s not straightforward to implement. On every Android device I’ve tested, “snoozing” is essentially just the alarm app creating a new alarm instance. That means the system updates the next‑alarm time, and Home Assistant only sees that updated timestamp.
In other words, from HA’s perspective there’s no difference between a user manually changing the alarm time and the alarm app scheduling a snooze. Both actions look identical in the sensor, which makes it very hard to reliably detect when a snooze actually happened.

1 Like

First: A link to this post would be great inside of the Blueprint description, to come back here more easy :wink:

since some days the blueprint doesn’t work anymore. I’m on the beta android app it worked for 2 years without problems, the trace doesn’t show any start of this automation since some days, the sensor is enabled and the sensor is showing the correct next alarm, any idea how to start searching the problem?

Thanks for the suggestion, I have added the link to the description in V5. The trigger source is your alarm entity, check in the developer tools if the entity you configured in your automation still exist and it has a state with the next alarm datetime, like so:

I know I already checked this, it’s every day Mo-Fr 6:30 and this alarm is shown in the developer tools

I just reimported the blueprint to V5 and disabled the old automation and created a new one. Will report next days.

1 Like

Very weird, Now the traces are back. I was now able to figure out was wrong. I use some if not conitions for my calendar. if not vacation, if not day in office and so on. One of this conditions switched from it not to state. No idea how this could happen, I haven’t changed anything for about one year in this blueprint.

I'm just looking if I want to switch from google to the Fruite side of life. Here it's sadly only working with some workaorunds, but your blueprint is absolute genius. I just need the option to choose a input_datetime. sensor as alarm. In Apple I need to work with this sensor to make it work. Is it possible that you add this option to choose as alarm time?

Hi, I am using this BP for years and it has been great so far. But a week ago it stopped working and I noticed the “alarm helper” has disappeared… I have no idea why. Anybody with the salle issue ?

Hi op00, thanks for this blueprint — it’s really useful.

I noticed it triggers deprecation warnings on recent Home Assistant versions
because it still uses the old trigger/action syntax. I fixed it locally and
wanted to share the corrected version in case you’d like to update the
original post.

Two things were changed:

  1. trigger: → triggers: and platform: time → trigger: time
  2. The actions: block used the old script style (sequence:/alias: as a
    mapping). It now uses the list form required by current HA.

Before:

trigger:
- platform: time
  at:
    entity_id: !input alarm_source
    offset: !input offset
  id: wake_up
conditions: !input conditions
actions:
  sequence: !input actions
  alias: Alarm Actions
mode: single
After:
triggers:
- trigger: time
  at:
    entity_id: !input alarm_source
    offset: !input offset
  id: wake_up
conditions: !input conditions
actions:
- alias: Alarm Actions
  sequence: !input actions
mode: single
The rest of the blueprint (the input: section) is fine and doesn't need
changes.
Tested on Home Assistant 2026.10.0 — no more warnings, behaviour is unchanged.
Thanks again for the blueprint!
1 Like

thanks a lot @Bekkenes. V6 is ready to be re-imported with your changes.

1 Like

Thanks for V6! Based on it, here’s a proposal that addresses some recurring requests. Fully backwards compatible: all new inputs default to the current behavior, so existing automations keep working without changes.

Changes:

  1. Allowed alarm apps (allowed_packages, optional, default: empty = all)
    Only runs if the Package attribute of the next alarm sensor matches one of the listed apps (e.g. com.google.android.deskclock). This prevents “ghost runs” triggered by calendar, reminder or automation apps that also register alarms with Android.
  2. Stale alarm guard (stale_guard, optional, default: off)
    At runtime it checks that the alarm sensor + offset still matches the current time (±90 s). If the alarm was disabled or moved after the trigger was scheduled, the actions are skipped. Implemented as a condition step with enabled: !input, so the user’s conditions input stays untouched.
  3. Alarm source: any timestamp sensor
    The entity filter is widened from integration: mobile_app to domain: sensor + device_class: timestamp. Phone next-alarm sensors still match. This also allows e.g. a template sensor based on an input_datetime for iOS users or manually set wake-up times.

Untouched: trigger, offset logic, conditions/actions inputs, mode, traces.

Side note: The description still says “Home Assistant version 2023.8.0 or higher”, while min_version is 2024.10.0. Might be worth aligning.

blueprint:
  name: Adjustable Wake-up to Android alarm
  description: "# Adjustable Wake-up to Android alarm V6.1\nWhen the specified __conditions__
    are satisfied, it runs these specified __actions__ prior the phone's next alarm\n
    \n## \U0001F527 Requirements:\n  - [Android app](https://play.google.com/store/apps/details?id=io.homeassistant.companion.android)
    installed on your phone\n  - Next alarm sensor activated in the app (HA App →
    Settings → Companion App → Manage Sensors → Next Alarm → enable)\n    [![Open
    your Home Assistant instance and show your helper entities.](https://my.home-assistant.io/badges/helpers.svg)](https://my.home-assistant.io/redirect/helpers/)
    \   \n  - Home Assistant version 2023.8.0 or higher\n\n## \U0001F4A1Some Inspiratios:
    **(at your own risk)**\n - If the sun has not risen yet, turn on the bedroom lights
    10 minutes before the phone alarm goes off\n - If person 1 is at home, switch
    on the TV and tune it to a news channel 30 minutes before the phone alarm rings\n
    - If person 2 is not at home, retrieve today's calendar events and announce them
    on the bedroom speaker 2 minutes before the alarm is set to go off\n - If the
    temperature outside is below 0°C, start warming up the car 45 minutes before the
    alarm is set to go off\n\n## \U0001F91DFeedback and Discussion\n  - [Home Assistant
    Forum](https://community.home-assistant.io/t/adjustable-wake-up-to-android-alarm/599838)\n"
  domain: automation
  author: op00
  homeassistant:
    min_version: 2024.10.0
  source_url: https://community.home-assistant.io/t/adjustable-wake-up-to-android-alarm/599838
  input:
    offset:
      name: Offset
      description: "Enter an offset for the next alarm. Specify when the action should
        run the alarm. Use negative values for hour, minutes and seconds\n\n -1:-22:-33
        = 1 hour 22 minutes and 33 seconds before alarm"
      selector:
        duration:
          enable_day: false
          enable_millisecond: false
          enable_second: true
      default:
        hours: 0
        minutes: -10
        seconds: -20
    alarm_source:
      name: Alarm Source
      description: "Select the alarm source\n\n _your Android phone's next alarm sensor,
        or any other timestamp sensor (e.g. a template sensor based on an input_datetime)_"
      selector:
        entity:
          filter:
          - domain: sensor
            device_class:
            - timestamp
          multiple: false
          reorder: false
    conditions:
      name: Conditions
      description: "Choose the circumstances under which the actions will or will
        not run\n\n _can be multiple or none_"
      default: []
      selector:
        condition: {}
    actions:
      name: Actions
      description: "Actions to run before alarm goes off\n\n _can be multiple_"
      default: []
      selector:
        action: {}
    allowed_packages:
      name: Allowed alarm apps (optional)
      description: "Only run if the alarm was set by one of these apps, matched against
        the `Package` attribute of the next alarm sensor (e.g. `com.google.android.deskclock`).
        Prevents runs triggered by calendar, reminder or automation apps that also
        register alarms.\n\n _leave empty to allow all apps_"
      default: []
      selector:
        text:
          multiple: true
    stale_guard:
      name: Stale alarm guard (optional)
      description: "Re-checks at runtime that the alarm sensor + offset still matches
        the current time (± 90 s). Skips the actions if the alarm was disabled or
        moved after the trigger was scheduled.\n\n _off by default_"
      default: false
      selector:
        boolean: {}
variables:
  alarm_entity: !input alarm_source
  alarm_offset: !input offset
  allowed_packages: !input allowed_packages
triggers:
- trigger: time
  at:
    entity_id: !input alarm_source
    offset: !input offset
  id: wake_up
conditions: !input conditions
actions:
- alias: Package filter
  condition: template
  value_template: "{{ allowed_packages | count == 0 or state_attr(alarm_entity,
    'Package') in allowed_packages }}"
- alias: Stale alarm guard
  enabled: !input stale_guard
  condition: template
  value_template: >-
    {% set a = states(alarm_entity) | as_datetime(none) %}
    {% if a is none %}false{% else %}
    {% set o = alarm_offset %}
    {% set d = as_timedelta(o) if o is string else
               timedelta(days=o.days | default(0) | float,
                         hours=o.hours | default(0) | float,
                         minutes=o.minutes | default(0) | float,
                         seconds=o.seconds | default(0) | float) %}
    {{ ((now() - (a + d)).total_seconds() | abs) < 90 }}
    {% endif %}
- alias: Alarm Actions
  sequence: !input actions
mode: single
trace:
  stored_traces: 21