1
0
mirror of https://github.com/Adam-Ant/home-assistant synced 2024-06-14 06:47:23 +00:00

Initial Alarm Clock Implementation

This commit is contained in:
Adam Dodman 2016-11-29 23:48:17 +00:00
parent 6e33839f1e
commit 3a6b5c955b
6 changed files with 59 additions and 0 deletions

4
.gitignore vendored
View File

@ -1,2 +1,6 @@
secrets.yaml
known_devices.yaml
.HA_VERSION
.uuid
home-assistant.log
home-assistant_v2.db

View 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: ''

View File

@ -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
View File

@ -0,0 +1,4 @@
alarmweekday:
name: Weekdays Only
initial: off
icon: mdi:calendar

14
input_slider.yaml Normal file
View 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
View 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) }}'