mirror of
https://github.com/Adam-Ant/home-assistant
synced 2024-11-05 03:56:22 +00:00
Initial Alarm Clock Implementation
This commit is contained in:
parent
6e33839f1e
commit
3a6b5c955b
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,2 +1,6 @@
|
||||
secrets.yaml
|
||||
known_devices.yaml
|
||||
.HA_VERSION
|
||||
.uuid
|
||||
home-assistant.log
|
||||
home-assistant_v2.db
|
||||
|
27
automation/alarmclock.yaml
Normal file
27
automation/alarmclock.yaml
Normal file
@ -0,0 +1,27 @@
|
||||
- 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: ''
|
@ -69,6 +69,10 @@ device_tracker:
|
||||
consider_home: 300
|
||||
track_new_devices: no
|
||||
|
||||
input_boolean: !include input_boolean.yaml
|
||||
|
||||
input_slider: !include input_slider.yaml
|
||||
|
||||
script: !include_dir_named scripts
|
||||
|
||||
automation: !include_dir_merge_list automation
|
||||
|
4
input_boolean.yaml
Normal file
4
input_boolean.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
alarmweekday:
|
||||
name: Weekdays Only
|
||||
initial: off
|
||||
icon: mdi:calendar
|
14
input_slider.yaml
Normal file
14
input_slider.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
alarmhour:
|
||||
name: Hour
|
||||
icon: mdi:timer
|
||||
initial: 9
|
||||
min: 0
|
||||
max: 23
|
||||
step: 1
|
||||
alarmminutes:
|
||||
name: Minutes
|
||||
icon: mdi:timer
|
||||
initial: 0
|
||||
min: 0
|
||||
max: 59
|
||||
step: 5
|
6
sensors/alarm.yaml
Normal file
6
sensors/alarm.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
- platform: template
|
||||
sensors:
|
||||
alarm_time:
|
||||
friendly_name: 'Time'
|
||||
value_template: '{{ "%0.02d:%0.02d" | format(states("input_slider.alarmhour") | int, states("input_slider.alarmminutes") | int) }}'
|
||||
|
Loading…
Reference in New Issue
Block a user