-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathalerts.yaml
109 lines (103 loc) · 3.5 KB
/
alerts.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
108
109
fridge_freezer_temp:
name: Fridge/Freezer Temperature Alert
title: Fridge/Freezer Temperature Alert!
entity_id: binary_sensor.fridge_freezer_temp_alert
message: >
{% set message = "" %}
{% if is_state('binary_sensor.garage_fridge_temp_alert', 'on') %}
{% set message = message + "Garage Fridge: " + states('sensor.garage_fridge_temp') + " " %}
{% endif %}
{% if is_state('binary_sensor.garage_freezer_temp_alert', 'on') %}
{% set message = message + "Garage Freezer: " + states('sensor.garage_freezer_temp') + " " %}
{% endif %}
{{ message }}
skip_first: true
repeat:
- 10
- 15
- 20
- 25
- 30
data:
group: Alerts
tag: fridge_freezer_temp
notifiers:
mobile_app_pixel_3
storage_space_low:
name: Storage Space is Low
title: Storage Space is Low!
entity_id: binary_sensor.storage_alert
message: "Disk usage is at {{ trigger.to_state.state }}%"
repeat:
- 15
- 30
- 60
data:
clickAction: /lovelace-system-devices/system-devices
group: Alerts
tag: storage_space_low
notifiers:
mobile_app_pixel_3
time_to_upgrade:
name: Time to Upgrade Home Assistant
title: Time to Upgrade Home Assistant!
entity_id: binary_sensor.time_to_upgrade
message: 'The current version is {{ states("sensor.current_version") }} and the latest version is {{ states("sensor.latest_version") }}'
repeat: 1440
data:
clickAction: /lovelace-system-devices/system-devices
group: Alerts
tag: time_to_upgrade
notifiers:
mobile_app_pixel_3
{{ expand(states.binary_sensor)
| selectattr('attributes.device_class', 'eq', 'connectivity')
| rejectattr('entity_id', 'eq', 'binary_sensor.chris_phone_connected_to_g35')
| rejectattr('entity_id', 'eq', 'binary_sensor.chris_phone_connected_to_suburban')
| selectattr('state', 'eq', 'off')
| list | length > 0 }}
device_offline:
name: Device(s) Offline
title: >
{% set offlineDevices = expand(states.binary_sensor)
| selectattr('attributes.device_class', 'eq', 'connectivity')
| rejectattr('entity_id', 'eq', 'binary_sensor.chris_phone_connected_to_g35')
| rejectattr('entity_id', 'eq', 'binary_sensor.chris_phone_connected_to_suburban')
| selectattr('state', 'eq', 'off')
| list
%}
{% if offlineDevices | length == 0 %}
Devices Back Online!
{% elif offlineDevices | length == 1 %}
{{ offlineDevices | map(attribute='name') | first | replace(' Status', '') }} Offline!
{% else %}
Devices Offline!
{% endif %}
entity_id: binary_sensor.device_offline
state: "on"
message: >
{% set offlineDevices = expand(states.binary_sensor)
| selectattr('attributes.device_class', 'eq', 'connectivity')
| rejectattr('entity_id', 'eq', 'binary_sensor.chris_phone_connected_to_g35')
| rejectattr('entity_id', 'eq', 'binary_sensor.chris_phone_connected_to_suburban')
| selectattr('state', 'eq', 'off')
| list
%}
{% if offlineDevices | length == 1 %}
The {{ offlineDevices | map(attribute='name') | first | replace(' Status', '')}} is offline
{% else %}
The following devices are offline: {{ offlineDevices | map(attribute='name') | list | join(', ') | replace(' Status', '')}}
{% endif %}
done_message: "All devices are back Online!"
skip_first: true
repeat:
- 2
- 30
- 60
- 240
data:
clickAction: /lovelace-system-devices/system-devices
group: Alerts
tag: device_offline
notifiers:
mobile_app_pixel_3