diff --git a/.gitignore b/.gitignore index 2fd8c78..bb87050 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ secrets.yaml known_devices.yaml +.HA_VERSION +.uuid +home-assistant.log +home-assistant_v2.db diff --git a/automation/alarmclock.yaml b/automation/alarmclock.yaml new file mode 100644 index 0000000..b0002f2 --- /dev/null +++ b/automation/alarmclock.yaml @@ -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: '' diff --git a/configuration.yaml b/configuration.yaml index f25d9d0..edc0732 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -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 diff --git a/input_boolean.yaml b/input_boolean.yaml new file mode 100644 index 0000000..c705477 --- /dev/null +++ b/input_boolean.yaml @@ -0,0 +1,4 @@ +alarmweekday: + name: Weekdays Only + initial: off + icon: mdi:calendar diff --git a/input_slider.yaml b/input_slider.yaml new file mode 100644 index 0000000..b51761b --- /dev/null +++ b/input_slider.yaml @@ -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 diff --git a/sensors/alarm.yaml b/sensors/alarm.yaml new file mode 100644 index 0000000..2aaf05a --- /dev/null +++ b/sensors/alarm.yaml @@ -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) }}' +