Wake up to configurable actions at next alarm (android)

This blueprint wakes you up to your custom actions at your phones next alarm with an offset.
This is the more advanced version of https://community.home-assistant.io/t/wake-up-to-lights-at-next-alarm-android/438277

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

:sparkles: Features

  • Offset (how many seconds before the alarm goes off)
  • Select any action to run, e.g. turn on lights, play media, etc…
  • Only runs when a selected person is home (or any other location)

:wrench: Requirements

  • Android phone with mobile app
  • Next alarm sensor activated
  • Date and time helper entity

:hammer_and_wrench: Changelog

  • 2022-07-09: Added unit_of_measurement: “Seconds”

blueprint:
  name: Wake up to configurable actions at next alarm
  description:
    Wakes you up to configurable actions at your phones next alarm with
    an offset
  domain: automation
  input:
    offset:
      name: Offset
      description:
        Set a offset in seconds to the next alarm. When (before) the lights
        should turn on
      selector:
        number:
          min: 0.0
          max: 3600.0
          mode: box
          step: 1.0
          unit_of_measurement: "Seconds"
    alarm_source:
      name: Alarm Source
      description: Select the alarm source
      selector:
        entity:
          integration: mobile_app
          device_class: timestamp
          multiple: false
    alarm_helper:
      name: Alarm Helper
      description: Select the date time helper
      selector:
        entity:
          integration: input_datetime
          multiple: false
    location:
      name: Location
      description: Location where people need to be for the action(s) to run
      selector:
        entity:
          integration: zone
          multiple: false
    people:
      name: People
      description: Actions only when these people are home
      selector:
        entity:
          integration: person
          multiple: false
    actions:
      name: Actions
      description: Actions to run before alarm goes off
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/wake-up-to-configurable-actions-at-next-alarm-android/438300
variables:
  offset: !input offset
trigger:
  - platform: time
    at: !input alarm_helper
    id: wake_up
  - platform: state
    entity_id:
      - !input alarm_source
    id: helper_update
action:
  - choose:
      - conditions:
          - condition: trigger
            id: helper_update
          - condition: template
            value_template:
              '{{ trigger.to_state.state not in ["unknown","unavailable"]
              }}'
        sequence:
          - service: input_datetime.set_datetime
            data:
              timestamp: "{{ (as_timestamp(trigger.to_state.state) |int ) - (offset)}}"
            target:
              entity_id: !input alarm_helper
      - conditions:
          - condition: trigger
            id: wake_up
          - condition: zone
            entity_id: !input people
            zone: !input location
        sequence: !input actions
    default: []
mode: single

:construction: ToDo

  • :white_check_mark: ToDo list
  • :white_check_mark: Create my link to import the blueprint
  • :black_square_button: Spellcheck

🧑🏼‍🤝‍🧑🏻 Contributions

  • Very welcomed and please do
1 Like

I do not understand what should be: An auxiliary date and time object?
It’s empty there, and I can’t understand what I need to add? Time sensors from the home assistant cannot be selected there.