How to create the alarm clock in HASS?

If you’re interested, I streamlined the example you provided. This version is more compact than the original.

1. Input_Booleans and Input_Numbers

My version uses the same input_booleans and input_numbers as in the original example:

Click to reveal details
#configuration.yaml
input_boolean:
  wakestatus_1:
    name: Alarm 1
    icon: mdi:alarm
  wakeweekday_sun_1:
    name: Sunday
    icon: mdi:calendar
  wakeweekday_mon_1:
    name: Monday        
    icon: mdi:calendar
  wakeweekday_tue_1:
    name: Tuesday        
    icon: mdi:calendar
  wakeweekday_wed_1:
    name: Wednesday       
    icon: mdi:calendar
  wakeweekday_thu_1:
    name: Thursday       
    icon: mdi:calendar
  wakeweekday_fri_1:
    name: Friday        
    icon: mdi:calendar
  wakeweekday_sat_1:
    name: Saturday        
    icon: mdi:calendar

input_number:
  wakehour_1:
    name: Hour
    min: 00
    max: 23
    step: 1
    icon: mdi:alarm
  wakeminutes_1:
    name: Minutes
    min: 00
    max: 59
    step: 1

2. Sensors

It uses far fewer sensors:

#sensor:
- platform: template
  sensors:
    wake_time_1:
      friendly_name: 'Wake Time 1'
      value_template: "{{'{:02d}:{:02d}'.format(states('input_number.wakehour_1') | int, states('input_number.wakeminutes_1') | int) }}"

- platform: time_date
  display_options:
    - 'time'

3. Automation

Its automation is substantially more compact:

#automation:
- id: 'alarm_clock_123'
  alias: Wake 1
  trigger:
    platform: template
    value_template: "{{ states('sensor.time') == states('sensor.wake_time_1') }}"
  condition:
    condition: template
    value_template: >
      {% set today = 'input_boolean.wakeweekday_' ~ now().strftime("%a") | lower ~ '_1' %}
      {{ is_state('input_boolean.wakestatus_1', 'on') and is_state(today, 'on') }}
  action:
    service: switch.turn_on
    entity_id: switch.office_1

I found no need for the original example’s group, or some of its sensors, so they are not included here.

4. Lovelace UI

Finally, I used a combination of cards to create the following UI:

Screenshot from 2020-07-07 11-44-03

Click to reveal Lovelace card configuration
type: vertical-stack
cards:
  - type: entities
    entities:
      - entity: input_boolean.wakestatus_1
        name: Mode
      - entity: sensor.wake_time_1
        name: Wake Time
      - entity: input_number.wakehour_1
      - entity: input_number.wakeminutes_1
    title: Alarm Clock 1
    show_header_toggle: false
  - type: horizontal-stack
    cards:
      - type: button
        tap_action:
          action: toggle
        hold_action:
          action: none
        show_icon: true
        show_name: true
        entity: input_boolean.wakeweekday_sun_1
        name: Sun
        icon_height: 40px
      - type: button
        tap_action:
          action: toggle
        hold_action:
          action: none
        show_icon: true
        show_name: true
        entity: input_boolean.wakeweekday_mon_1
        name: Mon
        icon_height: 40px
      - type: button
        tap_action:
          action: toggle
        hold_action:
          action: none
        show_icon: true
        show_name: true
        entity: input_boolean.wakeweekday_tue_1
        name: Tue
        icon_height: 40px
      - type: button
        tap_action:
          action: toggle
        hold_action:
          action: none
        show_icon: true
        show_name: true
        entity: input_boolean.wakeweekday_wed_1
        name: Wed
        icon_height: 40px
      - type: button
        tap_action:
          action: toggle
        hold_action:
          action: none
        show_icon: true
        show_name: true
        entity: input_boolean.wakeweekday_thu_1
        name: Thu
        icon_height: 40px
      - type: button
        tap_action:
          action: toggle
        hold_action:
          action: none
        show_icon: true
        show_name: true
        entity: input_boolean.wakeweekday_fri_1
        name: Fri
        icon_height: 40px
      - type: button
        tap_action:
          action: toggle
        hold_action:
          action: none
        show_icon: true
        show_name: true
        entity: input_boolean.wakeweekday_sat_1
        name: Sat
        icon_height: 40px
15 Likes