Alarm Clock as a package

i have below alarmclock
it use input_time ( this is actually updated by tasker on my android to always be the next alarm time of my phone )

i also have an condition on the automation so it only triggers between 22:30 and 12:30 because i have some other alarms as reminders of tasks, and no need for the bedroom lights to turn on/off for that.
Also a condition to see that i am actually home, no need for it to trigger when i am away on worktrip.

Then it:
1, start dimming up bedroom light 30 min before alarm
2, at alarm set light to 100%, start playing internet radio on the closest google home mini, turn on an automation that prevents me turning off the google home mini for 10 minutes.

In tasker on my phone i just made an “intent received” profile from event -> system
then in action i wrote “android.app.action.NEXT_ALARM_CLOCK_CHANGED”
and as a task i made HTTP post with:
server:port = https://
path = /api/services/input_datetime/set_datetime?api_password=
data / file = { “entity_id” : “input_datetime.next_alarm”, “time” : “%taskertime”, “date” : “%year-%month-%day” }
( the above variables are from tasker plugin called autoalarm )

group:
  alarmclock:
    name: Alarmclock
    control: hidden
    entities:
      - input_datetime.next_alarm
      - automation.alarmclock
      - automation.keep_morning_radio_on


input_datetime:
  next_alarm:
    name: Next phone alarm
    has_date: true
    has_time: true

automation old:
  #####################
  #
  #        Alarmclock
  #  start 30 min before alarm
  #
  #####################
  - alias: Alarmclock
    trigger:
      - platform: template
        value_template: "{{ (states('sensor.date') + ' ' + states('sensor.time')) == ( states.input_datetime.next_alarm.attributes.timestamp | int - (30*60) ) | timestamp_custom('%Y-%m-%d %H:%M', True) }}"
    condition: 
      # Only run between 22:30 and 12:30
      - condition: template
        value_template: "{{ states('sensor.time') >= '22:30'|timestamp_custom('%H:%M', True) or states('sensor.time') <= '12:30'|timestamp_custom('%H:%M', True) }}"
    
      # Only run automation if i'm home 
      - condition: state
        entity_id: binary_sensor.simon
        state: 'on'
    action:
      - service: light.turn_on
        entity_id: light.master_bedroom
        data_template:
          brightness_pct: 1
      
      - delay: '00:2:00'
      - service: light.turn_on
        entity_id: light.master_bedroom
        data_template:
          brightness_pct: 3
      
      - delay: '00:2:00'
      - service: light.turn_on
        entity_id: light.master_bedroom
        data_template:
          brightness_pct: 5
      
      - delay: '00:4:00'
      - service: light.turn_on
        entity_id: light.master_bedroom
        data_template:
          brightness_pct: 10
      
      - delay: '00:4:00'
      - service: light.turn_on
        entity_id: light.master_bedroom
        data_template:
          brightness_pct: 15
      
      ####### ~18 min before alarm rings #######
      
      - delay: '00:3:00'
      - service: light.turn_on
        entity_id: light.master_bedroom
        data_template:
          brightness_pct: 25
          
      - delay: '00:2:00'
      - service: light.turn_on
        entity_id: light.master_bedroom
        data_template:
          brightness_pct: 35
          
      - delay: '00:3:00'
      - service: light.turn_on
        entity_id: light.master_bedroom
        data_template:
          brightness_pct: 45
      
      ####### ~10 min before alarm rings #######
      
      - delay: '00:2:00'
      - service: light.turn_on
        entity_id: light.master_bedroom
        data_template:
          brightness_pct: 55
      
      - delay: '00:2:00'
      - service: light.turn_on
        entity_id: light.master_bedroom
        data_template:
          brightness_pct: 65
      
      - delay: '00:2:00'
      - service: light.turn_on
        entity_id: light.master_bedroom
        data_template:
          brightness_pct: 75
          
      - delay: '00:2:00'
      - service: light.turn_on
        entity_id: light.master_bedroom
        data_template:
          brightness_pct: 85
          
      ####### ALARM RINGS #######
      - delay: '00:2:00'
      
      - service: automation.turn_on
        entity_id: automation.keep_morning_radio_on
  
      - service: light.turn_on
        entity_id: light.master_bedroom
        data_template:
          brightness_pct: 100
      
      - delay: '00:00:02'
      - service: script.radio
      
      - delay: '00:00:01'
      - service: media_player.volume_set
        data:
          entity_id: media_player.kitchen_home_mini
          volume_level: '0.65'
      
      # make sure morning radio is on for atleast 10 min
      - delay: '00:10:00'
      - service: automation.turn_off
        entity_id: automation.keep_morning_radio_on



  #####################
  #
  # keep radio on during morning
  #
  #####################
  - alias: Keep morning radio on
    initial_state: false
    trigger:
      - platform: state
        entity_id: media_player.kitchen_home_mini
        from: 'playing'
        to: 'off'
      - platform: state
        entity_id: media_player.kitchen_home_mini
        from: 'playing'
        to: 'paused'
    condition: 
    action:
      - service: script.radio
      
      - delay: '00:00:02'
      - service: media_player.volume_set
        data:
          entity_id: media_player.kitchen_home_mini
          volume_level: '0.65'
1 Like

What do you mean editing the wake up time from the front end. i have it like this
image

when you add group.alarm_1 to your frontend groups

Sorry for the confusion. What I meant was that I had a “wake up alarm” automation that I triggered by setting a time as the trigger for that automation. What I didn’t like about that was if I wanted to wake up at 6:30 instead of 6:15 I had to open up my computer, adjust my automations.yaml and then save the file and reload the automations.

For the improved version of this I wanted to use parts of your code and setup an alarm clock / wake me up group in my frontend to easily allow me to adjust my exact wakeup time. I use the workday binary sensor and I don’t have any dimmable lights so I got rid of the offset, transitions, and weekday/weekend stuff but I’m having trouble getting it to trigger. I also moved the groups and automations into the package rather than listening them separately. Here is what my front end looks like and code is below.

#INPUTS
input_number:
    alarm_clock_hour:
        name: Hour
        icon: mdi:timer
        initial: 6
        min: 0
        max: 23
        step: 1
    alarm_clock_minutes:
        name: Minute
        icon: mdi:timer
        initial: 15
        min: 0
        max: 59
        step: 5
#     alarm_1_offset:
#         name: Transition
#         icon: mdi:blur-linear
#         initial: 15
#         min: 0
#         max: 60
#         step: 15

# input_boolean:
#     alarm_1_weekday:
#         name: Weekdays
#         initial: on
#         icon: mdi:calendar
#     alarm_1_weekend:
#         name: Weekends
#         initial: off
#         icon: mdi:calendar

#SENSORS
sensor:
    - platform: template
      friendly_name: sensor.alarm_clock_time
      sensors:
         alarm_clock_time:
              friendly_name: 'Alarm Clock Time'
              value_template: >-
                  {{ "%0.02d:%0.02d" | format(states("input_number.alarm_clock_hour") | int, states("input_number.alarm_clock_minutes") | int) }}
#     - platform: template
#       entity_id: sensor.alarm_1_time_minus_offset
#       sensors:
#          alarm_1_time_minus_offset:
#               friendly_name: 'Offset Time'
#               value_template: >-
#                   {{ '%0.02d:%0.02d' | format( ((((states('input_number.alarm_1_hour') | int)*60 + (states('input_number.alarm_1_minutes') | int) - (states('input_number.alarm_1_offset'))| int)/60)| int),(((((((((states('input_number.alarm_1_hour') | int)*60 + (states('input_number.alarm_1_minutes') | int) - (states('input_number.alarm_1_offset')) | int)/60)) - ((((states('input_number.alarm_1_hour') | int)*60 + (states('input_number.alarm_1_minutes') | int) - (states('input_number.alarm_1_offset')) | int)/60)| int))*100) | int)*60/100) | round) ) }}


#FRONT END
group:
    alarm_clock:
        name: Wake Me Up
        entities:
#             - sensor.time
            - sensor.alarm_clock_time
#             - sensor.alarm_1_time_minus_offset
            - input_number.alarm_clock_hour
            - input_number.alarm_clock_minutes
#             - input_number.alarm_1_offset
#             - input_boolean.alarm_1_weekday
#             - input_boolean.alarm_1_weekend

# AUTOMATIONS
automation:
  - id: alarm_clock_workday
    alias: Wake me up (workday)
    trigger:
    - platform: time
      minutes: /1
      seconds: 0
    condition:
    - condition: state
      entity_id: binary_sensor.workday_sensor
      state: 'on'
    - condition: template
      value_template: '{{ states.sensor.time.state == states.sensor.alarm_clock_time }}'
    action:
    - data:
        message: time to wakeup
      service: notify.ios_garrett_iphone
    - data: {}
      service: script.1544825537507

The package system is somewhat depreciated, you have to separate the files, then it will probably trigger. :smiley:

oh really? when did that happen? I have a door locks package that works great or at least I think it does.

I’m using a folder for both packages and then have packages: !include_dir_named packages in my config file.

That’s why I started the topic. Because I updated and the packed automation stopped working, now I am insecure.

ooooooohhhhhhh interesting.

There isn’t a way in the UI to test triggers by creating a fake event is there? Something similar to how you can call a service or set a state?

Looks like this is broken as of 0.86

I’m guessing:

Works now for me in packages recent hass.io version:

input_number:
    alarm_1_hour:
        name: Hours
        icon: mdi:timer
        initial: 7
        min: 0
        max: 23
        step: 1
    alarm_1_minutes:
        name: Minutes
        icon: mdi:timer
        initial: 0
        min: 0
        max: 59
        step: 1
    alarm_1_offset:
        name: Transition
        icon: mdi:blur-linear
        initial: 15
        min: 0
        max: 60
        step: 15

input_boolean:
    alarm_1_weekday:
        name: Weekdays
        initial: on
        icon: mdi:calendar
    alarm_1_weekend:
        name: Weekends
        initial: off
        icon: mdi:calendar

sensor:
    - platform: template
      friendly_name: sensor.alarm_1_time
      sensors:
         alarm_1_time:
              friendly_name: 'Alarm Time'
              value_template: >-
                  {{ "%0.02d:%0.02d" | format(states("input_number.alarm_1_hour") | int, states("input_number.alarm_1_minutes") | int) }}
    - platform: template
      entity_id: sensor.alarm_1_time_minus_offset
      sensors:
         alarm_1_time_minus_offset:
              friendly_name: 'Offset Time'
              value_template: >-
                  {{ '%0.02d:%0.02d' | format( ((((states('input_number.alarm_1_hour') | int)*60 + (states('input_number.alarm_1_minutes') | int) - (states('input_number.alarm_1_offset'))| int)/60)| int),(((((((((states('input_number.alarm_1_hour') | int)*60 + (states('input_number.alarm_1_minutes') | int) - (states('input_number.alarm_1_offset')) | int)/60)) - ((((states('input_number.alarm_1_hour') | int)*60 + (states('input_number.alarm_1_minutes') | int) - (states('input_number.alarm_1_offset')) | int)/60)| int))*100) | int)*60/100) | round) ) }}

group:
    alarm_1:
        name: Wake Me Up
        entities:
            - sensor.time
            - sensor.alarm_1_time
            - sensor.alarm_1_time_minus_offset
            - input_number.alarm_1_hour
            - input_number.alarm_1_minutes
            - input_number.alarm_1_offset
            - input_boolean.alarm_1_weekday
            - input_boolean.alarm_1_weekend





automation:
  - id: 'alarm_1_weekday'
    alias: Wake me up (weekday)
    trigger:
    - platform: time_pattern
      minutes: /1
      seconds: 0
    condition:
    - condition: state
      entity_id: input_boolean.alarm_1_weekday
      state: 'on'
    - condition: time
      weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
    - condition: template
      value_template: '{{ states.sensor.time.state == states.sensor.alarm_1_time_minus_offset.state  }}'
    action:
    #- data:
    #    message: Alarm ! Current time is {{ states.sensor.time.state }} and alarm is set to {{ states.sensor.alarm_1_time.state }} with an offset of {{ states.input_number.alarm_1_offset.state }} set to {{ states.sensor.alarm_1_time_minus_offset.state }} Weekdays ({{ states.input_boolean.alarm_1_weekday.state }} ) and Weekends ({{ states.input_boolean.alarm_1_weekend.state }} ) test {{ "%0.02d:%0.02d" | format(states("input_number.alarm_1_hour") | int, states("input_number.alarm_1_minutes") | int) }}
    #  service: notify.zchat
    - data: {}
      service: script.wakeup_sequence
  - id: 'alarm_1_weekend'
    alias: Wake me up (weekend)
    trigger:
    - platform: time_pattern
      minutes: /1
      seconds: 0
    condition:
    - condition: state
      entity_id: input_boolean.alarm_1_weekend
      state: 'on'
    - condition: time
      weekday:
      - sat
      - sun
    - condition: template
      value_template: '{{ states.sensor.time.state == states.sensor.alarm_1_time_minus_offset.state  }}'
    action:
    #- data:
    #    message: Alarm ! Current time is {{ states.sensor.time.state }} and alarm is set to {{ states.sensor.alarm_1_time.state }} with an offset of {{ states.input_number.alarm_1_offset.state }} set to {{ states.sensor.alarm_1_time_minus_offset.state }} Weekdays ({{ states.input_boolean.alarm_1_weekday.state }} ) and Weekends ({{ states.input_boolean.alarm_1_weekend.state }} ) test {{ "%0.02d:%0.02d" | format(states("input_number.alarm_1_hour") | int, states("input_number.alarm_1_minutes") | int) }}
    #  service: notify.zchat
    - data: {}
      service: script.wakeup_sequence 
      
      
script:
  'wakeup_dim':
    alias: wakeup_dim
    sequence:
    - data:
        brightness: '0'
        entity_id:
        - light.lamp_kitchen1
        - light.lamp_kitchen2
        - light.lamp_kitchen3
        - light.lamp_dinning1
        - light.lamp_dinning2
        - light.lamp_dinning3
        - light.office_lamp_new
        - light.lamp_couch
        - light.bedroom_lamp1
        - light.bedroom_lamp2
        - light.hallway_lamp_new
        kelvin: '2200'
        transition: '0'
      service: light.turn_on
    - data:
        brightness: '0'
        entity_id:
        - light.gateway_light_286c07fa2642
        - light.yeelight_rgb_34ce008d0d2f
        rgb_color:
        - 255
        - 169
        - 92
      service: light.turn_on
    - data:
        brightness_pct: '0'
        entity_id:
        - light.colour_bulb
        rgb_color:
        - 255
        - 169
        - 92
        transition: '0'
      service: light.turn_on
  'wakeup_bright':
    alias: wakeup_bright
    sequence:
    - data_template:
        brightness: '255'
        kelvin: '2700'
        transition: '{{(states(''input_number.alarm_1_offset'') | int ) *60}}'
        entity_id:
        - light.lamp_kitchen1
        - light.lamp_kitchen2
        - light.lamp_kitchen3
        - light.lamp_dinning1
        - light.lamp_dinning2
        - light.lamp_dinning3
        - light.office_lamp_new
        - light.lamp_couch
        - light.bedroom_lamp1
        - light.bedroom_lamp2
        - light.hallway_lamp_new
      service: light.turn_on
    - data_template:
        brightness: '255'
        transition: '{{(states(''input_number.alarm_1_offset'') | int ) *60}}'
        entity_id:
        - light.colour_bulb
        rgb_color:
        - 255
        - 169
        - 92
      service: light.turn_on
  'wakeup_sequence':
    alias: wakeup_sequence
    sequence:
    - data:
        message: Alarm ! Current time is {{ states.sensor.time.state }} and alarm is set to {{ states.sensor.alarm_1_time.state }} with an offset of {{ states.input_number.alarm_1_offset.state }} set to {{ states.sensor.alarm_1_time_minus_offset.state }} Weekdays ({{ states.input_boolean.alarm_1_weekday.state }} ) and Weekends ({{ states.input_boolean.alarm_1_weekend.state }} ) 00:{{ states.input_number.alarm_1_offset.state | int }}:00
      service: notify.zchat
    - data: {}
      service: script.wakeup_dim
    - delay: 00:00:02
    - service: script.wakeup_bright
    - delay: '00:{{ states.input_number.alarm_1_offset.state | int }}:00'
    - data: {}
      service: script.play_wakeup_music
2 Likes

I modified the automation to allow you to select any day of the week. Code is below if you’re interested.

input_number:
  alarm_1_hour:
name: Hours
icon: mdi:timer
initial: 5
min: 0
max: 23
step: 1
  alarm_1_minutes:
name: Minutes
icon: mdi:timer
initial: 40
min: 0
max: 59
step: 1
  alarm_1_offset:
name: Transition
icon: mdi:blur-linear
initial: 10
min: 0
max: 60
step: 5

input_boolean:
  alarm_1_enable:
name: "Enable Alarm"
#    initial: on
  alarm_1_mon:
name: Monday
#    initial: on
icon: mdi:calendar
  alarm_1_tue:
name: Tuesday
#    initial: on
icon: mdi:calendar
  alarm_1_wed:
name: Wednesday
#    initial: on
icon: mdi:calendar
  alarm_1_thu:
name: Thursday
#    initial: on
icon: mdi:calendar
  alarm_1_fri:
name: Friday
#    initial: on
icon: mdi:calendar
  alarm_1_sat:
name: Saturday
#    initial: off
icon: mdi:calendar
  alarm_1_sun:
name: Sunday
#    initial: off
icon: mdi:calendar    


sensor:
  - platform: time_date
friendly_name: current_time_for_alarm_1
display_options:
  - 'time'
  - platform: template
sensors:
  alarm_1_time:
friendly_name: 'Alarm Time'
value_template: >-
  {{ "%0.02d:%0.02d" | format(states("input_number.alarm_1_hour") | int, states("input_number.alarm_1_minutes") | int) }}
  - platform: template
sensors:
  alarm_1_time_minus_offset:
friendly_name: 'Offset Time'
value_template: >-
  {{ '%0.02d:%0.02d' | format( ((((states('input_number.alarm_1_hour') | int)*60 + (states('input_number.alarm_1_minutes') | int) - (states('input_number.alarm_1_offset'))| int)/60)| int),(((((((((states('input_number.alarm_1_hour') | int)*60 + (states('input_number.alarm_1_minutes') | int) - (states('input_number.alarm_1_offset')) | int)/60)) - ((((states('input_number.alarm_1_hour') | int)*60 + (states('input_number.alarm_1_minutes') | int) - (states('input_number.alarm_1_offset')) | int)/60)| int))*100) | int)*60/100) | round) ) }}

group:
  alarm_1:
name: Work Alarm
entities:
- input_boolean.alarm_1_enable
- sensor.alarm_1_time
- sensor.alarm_1_time_minus_offset
- input_number.alarm_1_hour
- input_number.alarm_1_minutes
- input_number.alarm_1_offset
- input_boolean.alarm_1_mon
- input_boolean.alarm_1_tue
- input_boolean.alarm_1_wed
- input_boolean.alarm_1_thu
- input_boolean.alarm_1_fri
- input_boolean.alarm_1_sat
- input_boolean.alarm_1_sun


automation:
- id: alarm_1
  alias: 'Work Alarm'
  trigger:
- platform: time_pattern
  minutes: '/1'
  seconds: 00
  condition:
- condition: template
  value_template: "{{ states.sensor.time.state == states.sensor.alarm_1_time_minus_offset.state  }}"
- condition: state
  entity_id: input_boolean.alarm_1_enable  
  state: 'on'
- condition: or
  conditions:
- condition: and
  conditions:
    - condition: state
      entity_id: input_boolean.alarm_1_mon
      state: 'on'
    - condition: time
      weekday: 
        - mon
- condition: and
  conditions:
    - condition: state
      entity_id: input_boolean.alarm_1_tue
      state: 'on'
    - condition: time
      weekday: 
        - tue
- condition: and
  conditions:
    - condition: state
      entity_id: input_boolean.alarm_1_wed
      state: 'on'
    - condition: time
      weekday: 
        - wed
- condition: and
  conditions:
    - condition: state
      entity_id: input_boolean.alarm_1_thu
      state: 'on'
    - condition: time
      weekday: 
        - thu
- condition: and
  conditions:
    - condition: state
      entity_id: input_boolean.alarm_1_fri
      state: 'on'
    - condition: time
      weekday: 
        - fri
- condition: and
  conditions:
    - condition: state
      entity_id: input_boolean.alarm_1_sat
      state: 'on'
    - condition: time
      weekday: 
        - sat             
- condition: and
  conditions:
    - condition: state
      entity_id: input_boolean.alarm_1_sun
      state: 'on'
    - condition: time
      weekday: 
        - sun               

  action:
  - data: {}
service: script.bedroom_sunrise

indent preformatted text by 4 spaces
1 Like

I found my issue, i was using
trigger:
platform: time
minutes: /1
seconds: 0

Rather then
- platform: time_pattern
minutes: /1
seconds: 0

all checks are now passing thanks guys

Hi - is this currently the best/most developed wake up alarm for Home Assistant? I couldn’t really find a great deal else.

I’m interested in using your code (thank you) is there any way to repair the YAML idents or is it just a case of going through it line by line and adding? Happy to do so if that’s the way! :slight_smile:

alarm_1.yaml (4.4 KB)

Here’s the yaml file. You need to make sure the platform time sensor is somewhere in your homeassistant setup.

  • platform: time_date
    display_options:
    • ‘time’
1 Like

FYI: For persistant Settings between HA restarts, just remove initial setting:

input_number:
  alarm_weekday_hour:
    name: Hours
    icon: mdi:timer
#    initial: 7            <--------------- disable me ;-)
    min: 0
    max: 23
    step: 1
#    mode: box

input_boolean:
  alarm_weekday_enabled:
    name: Weekdays
#    initial: off           <--------------- disable me ;-)

EDIT: It may also depend if you have recorder component enabled in HA configuration:

# https://www.home-assistant.io/components/recorder/
recorder:

Struggeled with this some time myself, here is copy and paste :wink:

sensor:
  - platform: time_date
    display_options:
      - 'time'

I’ve noticed the alarm is sometimes triggered on point but most of the time one minute late.

Even with:

automation:
  - id: 'alarm_clock_weekday'
    alias: Alarm Clock Weekday
    trigger:
    - platform: time_pattern
      minutes: /1
      seconds: 1           <--------------------------- 0, 1 or 5 makes no differents
      ...

This is my Version. No fancy Fade. Alarm Setting for Weekdays and Weekend.

Works as a package.
Tested on HA 0.88.1 - 0.89.2 and Lovelace.

automation:
  - id: 'alarm_clock_weekday'
    alias: Alarm Clock Weekday
    trigger:
    - platform: time_pattern
      minutes: /1
      seconds: 1
    condition:
    - condition: state
      entity_id: input_boolean.alarm_weekday_enabled
      state: 'on'
    - condition: time
      weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
    - condition: template
      value_template: '{{ states.sensor.time.state == states.sensor.alarm_weekday_time.state }}'
    action:
      entity_id: switch.sonoffbasic1
      service: switch.turn_on
  - id: 'alarm_clock_weekend'
    alias: Alarm Clock Weekend
    trigger:
    - platform: time_pattern
      minutes: /1
      seconds: 1
    condition:
    - condition: state
      entity_id: input_boolean.alarm_weekend_enabled
      state: 'on'
    - condition: time
      weekday:
      - sat
      - sun
    - condition: template
      value_template: '{{ states.sensor.time.state == states.sensor.alarm_weekend_time.state }}'
    action:
      entity_id: switch.sonoffbasic1
      service: switch.turn_on

input_number:
  alarm_weekday_hour:
    name: Hours
    icon: mdi:timer
#    initial: 8
    min: 0
    max: 23
    step: 1
#    mode: box
  alarm_weekday_minutes:
    name: Minutes
    icon: mdi:timer
#    initial: 0
    min: 0
    max: 59
    step: 1
#    mode: box
  alarm_weekend_hour:
    name: Hours
    icon: mdi:timer
#    initial: 10
    min: 0
    max: 23
    step: 1
#    mode: box
  alarm_weekend_minutes:
    name: Minutes
    icon: mdi:timer
#    initial: 0
    min: 0
    max: 59
    step: 1     
#    mode: box

input_boolean:
  alarm_weekday_enabled:
    name: Weekdays
#    initial: off
    icon: mdi:calendar
  alarm_weekend_enabled:
    name: Weekend
#    initial: off
    icon: mdi:calendar

sensor:
  - platform: template
    sensors:
      alarm_weekday_time:
          friendly_name: 'Alarm Time Weekdays'
          value_template: >-
              {{ "%0.02d:%0.02d" | format(states("input_number.alarm_weekday_hour") | int, states("input_number.alarm_weekday_minutes") | int) }}
      alarm_weekend_time:
          friendly_name: 'Alarm Time Weekend'
          value_template: >-
              {{ "%0.02d:%0.02d" | format(states("input_number.alarm_weekend_hour") | int, states("input_number.alarm_weekend_minutes") | int) }}
  - platform: time_date
    display_options:
      - 'time'

# Optional
#group:
#  alarm_1:
#    name: Alarm Clock
#    entities:
#      - input_boolean.alarm_weekday_enabled
#      - sensor.alarm_weekday_time
#      - input_number.alarm_weekday_hour
#      - input_number.alarm_weekday_minutes
#      - input_boolean.alarm_weekend_enabled
#      - sensor.alarm_weekend_time
#      - input_number.alarm_weekend_hour
#      - input_number.alarm_weekend_minutes
#      - sensor.time

# If not enabled elsewhere:
#  time:
#    name: Time
#    entities:
#      - time_date.time
1 Like

I think you might like this :
Universal Persistent Timer
It can add a timer to anything including multiple scripts, lights etc. with separate start and stop actions, and will resume in the event of downtime and requires no programming skills once installed. All lights, switches etc can be accessed from auto populated lists; and you can specify days of the week, repetitions, intervals, and much more. Timers can be paused, backed up and give activation notifications etc.
https://youtu.be/rUeTIU1uAP0

@skalavala, I could not load your package, I get the following error:

Invalid config for [automation]: required key not provided @ data['action']. Got None
required key not provided @ data['trigger']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/automation/

I added the custom component input_label.py, what could I be doing wrong?

Would please share your configuration on the last line of the alarm_1.yaml?

action:

  • data: {}
    service: script.bedroom_sunrise

I would like to use a similar setup whereby my light increases incrementally in brightness half an hour before the alarm :slight_smile:

i’m getting errors on the sensor from @bott0r
when checking the config i get these messages.
what can i do about it?

Invalid config for [sensor.template]: [friendly_name] is an invalid option for [sensor.template]. Check: sensor.template->friendly_name. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.template/
Invalid config for [sensor.template]: [entity_id] is an invalid option for [sensor.template]. Check: sensor.template->entity_id. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.template/

someone that can help me?