├── README.md ├── automation └── wake_me_up.yaml ├── configuration.yaml ├── group.yaml ├── input_boolean.yaml ├── input_number.yaml └── sensors ├── template.yaml └── time_date.yaml /README.md: -------------------------------------------------------------------------------- 1 | # ha-alarmclock 2 | Example of creating an alarm clock in Home Asssitant 3 | 4 | Put this controls in your Home Assistant frontend and use it to trigger any automation such as alarm clock. 5 | 6 | ![Screenshot](https://community-home-assistant-assets.s3.amazonaws.com/original/1X/9a649afee3ffa5232844a45d24faab6868860b1c.png) 7 | -------------------------------------------------------------------------------- /automation/wake_me_up.yaml: -------------------------------------------------------------------------------- 1 | - alias: 'Wake Me Up' 2 | trigger: 3 | platform: template 4 | value_template: '{{ states.sensor.time.state == states.sensor.alarm_time.state }}' 5 | condition: 6 | condition: or 7 | conditions: 8 | - condition: and 9 | conditions: 10 | - condition: state 11 | entity_id: input_boolean.alarmweekday 12 | state: 'on' 13 | - condition: time 14 | weekday: 15 | - mon 16 | - tue 17 | - wed 18 | - thu 19 | - fri 20 | - condition: state 21 | entity_id: input_boolean.alarmweekday 22 | state: 'off' 23 | action: 24 | service: notify.notify 25 | data_template: 26 | message: 'Good morning. Time to Wake Up!' 27 | title: '' 28 | -------------------------------------------------------------------------------- /configuration.yaml: -------------------------------------------------------------------------------- 1 | ###################@@@@@################################# 2 | # # 3 | # Sample only. Put your complete configuration here # 4 | # # 5 | ######################################################### 6 | 7 | ### Sensors ### 8 | # Sensors are anything (hardware or software) that has a state. 9 | sensor: !include_dir_merge_list sensors 10 | 11 | ### Automation ### 12 | automation: !include_dir_merge_list automation 13 | 14 | ### Groups ### 15 | group: !include group.yaml 16 | 17 | ### Input Boolean ### 18 | # The input_boolean component allows the user to define boolean values that can be controlled via the frontend and can be used within conditions of automation. 19 | input_boolean: !include input_boolean.yaml 20 | 21 | ### Input Number ### 22 | input_number: !include input_number.yaml 23 | -------------------------------------------------------------------------------- /group.yaml: -------------------------------------------------------------------------------- 1 | default_view: 2 | view: yes 3 | entities: 4 | - group.alarmclock 5 | 6 | alarmclock: 7 | name: Wake Me Up 8 | entities: 9 | - automation.wake_me_up 10 | - sensor.alarm_time 11 | - input_number.alarmhour 12 | - input_number.alarmminutes 13 | - input_boolean.alarmweekday 14 | -------------------------------------------------------------------------------- /input_boolean.yaml: -------------------------------------------------------------------------------- 1 | alarmweekday: 2 | name: Weekdays Only 3 | icon: mdi:calendar 4 | -------------------------------------------------------------------------------- /input_number.yaml: -------------------------------------------------------------------------------- 1 | alarmhour: 2 | name: Hour 3 | icon: mdi:timer 4 | min: 0 5 | max: 23 6 | step: 1 7 | alarmminutes: 8 | name: Minutes 9 | icon: mdi:timer 10 | min: 0 11 | max: 59 12 | step: 5 13 | -------------------------------------------------------------------------------- /sensors/template.yaml: -------------------------------------------------------------------------------- 1 | - platform: template 2 | sensors: 3 | alarm_time: 4 | friendly_name: 'Time' 5 | value_template: '{{ "%0.02d:%0.02d" | format(states("input_number.alarmhour") | int, states("input_number.alarmminutes") | int) }}' 6 | -------------------------------------------------------------------------------- /sensors/time_date.yaml: -------------------------------------------------------------------------------- 1 | - platform: time_date 2 | display_options: 3 | - 'time' 4 | - 'date' 5 | - 'date_time' 6 | - 'time_date' 7 | - 'time_utc' 8 | --------------------------------------------------------------------------------