forked from home-IoT/hass-blueprints
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reminder_to_close_window_with_temp_sensor.yaml
107 lines (102 loc) · 2.77 KB
/
reminder_to_close_window_with_temp_sensor.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#
# Home Assistant Automation Blueprint
#
# Sends two notifications to close a window or door after opening it,
# if the temperature reading of a given sensor is below a certain degree.
#
# Revision 1
# Roozbeh Farahbod, Jan. 2021
#
blueprint:
name: 'Notification to Close a Window (custom sensor)'
description: Notification to close windows if it is cold outside
domain: automation
input:
contact_sensor:
name: Contact Sensor
description: 'The window or door sensor that triggers the automation.'
selector:
entity:
domain: binary_sensor
first_timer:
name: 'First timer'
description: 'The first notification timer (in minutes).'
default: 10
selector:
number:
min: 1
step: 1
max: 60
mode: slider
second_timer:
name: 'Second timer'
description: 'The second notification timer (in minutes).'
default: 15
selector:
number:
min: 1
step: 1
max: 60
mode: slider
temperature_sensor:
name: Temperature Sensor
description: 'The sensor used for reading the temperature.'
selector:
entity:
domain: sensor
device_class: temperature
temperature:
name: 'Temperature'
description: 'The outside temperature below which the notification should be sent.'
default: 20
selector:
number:
min: 0
step: 1
max: 25
mode: slider
device_identifier:
name: Device to notify
description: >
The device to receive the notification; it needs to run the official
Home Assistant app to receive notifications.
selector:
device:
integration: mobile_app
# We will have two triggers, for the two different reminders.
# However, a reminder will be ignored if the door or window is already closed by then.
trigger:
- platform: state
entity_id: !input contact_sensor
from: 'off'
to: 'on'
for:
hours: 0
minutes: !input first_timer
seconds: 0
- platform: state
entity_id: !input contact_sensor
from: 'off'
to: 'on'
for:
hours: 0
minutes: !input second_timer
seconds: 0
# Two conditions:
# 1. The door or window should still be open.
# 2. The outside temperature must be below the set value.
condition:
- condition: state
entity_id: !input contact_sensor
state: 'on'
- condition: numeric_state
entity_id: !input temperature_sensor
below: !input temperature
# Send a notification to the mobile device.
action:
- device_id: !input device_identifier
domain: mobile_app
type: notify
message: 'Time to close {{trigger.to_state.attributes.friendly_name}}.'
title: 'Close {{trigger.to_state.attributes.friendly_name}}!'
mode: single