homeassistant/archive/packages/alarm.yaml.off

77 lines
1.6 KiB
Plaintext
Raw Normal View History

sensor:
- platform: template
sensors:
alarm_time:
friendly_name: "Time"
value_template: "{{ '%0.02d:%0.02d' | format(states('input_number.alarmhour') | int, states('input_number.alarmminutes') | int) }}"
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'time_date'
- 'time_utc'
automation:
- alias: 'Wake Me Up'
trigger:
platform: template
value_template: "{{ states.sensor.time.state == states.sensor.alarm_time.state }}"
condition:
condition: or
conditions:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.alarmweekday
state: 'on'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: state
entity_id: input_boolean.alarmweekday
state: 'off'
action:
service: notify.notify
data_template:
message: 'Good morning. Time to Wake Up!'
title: ''
group:
default_view:
view: yes
entities:
- group.alarmclock
alarmclock:
name: Wake Me Up
entities:
- automation.wake_me_up
- sensor.alarm_time
- input_number.alarmhour
- input_number.alarmminutes
- input_boolean.alarmweekday
input_boolean:
alarmweekday:
name: Weekdays Only
icon: mdi:calendar
input_number:
alarmhour:
name: Hour
icon: mdi:timer
min: 0
max: 23
step: 1
alarmminutes:
name: Minutes
icon: mdi:timer
min: 0
max: 59
step: 5