-
Notifications
You must be signed in to change notification settings - Fork 0
/
blueprint_raid_status.yaml
138 lines (135 loc) · 3.94 KB
/
blueprint_raid_status.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
blueprint:
name: RAID Check Automation
description: Monitors RAID arrays and sends notifications about their status.
domain: automation
input:
time_after:
name: Time After
description: Start time for the automation.
default: "08:00:00"
selector:
time: {}
time_before:
name: Time Before
description: End time for the automation.
default: "22:00:00"
selector:
time: {}
raid_arrays:
name: RAID Arrays
description: List of RAID arrays to monitor.
default: ["sensor.raid_status_md0", "sensor.raid_status_md1"]
selector:
text: {}
priority:
name: Notification Priority
description: Priority of the notification.
default: 'low'
selector:
select:
options:
- 'low'
- 'high'
- 'max'
color:
name: Notification Color
description: Color of the notification.
default: green
selector:
text: {}
notification_icon:
name: Notification Icon
description: Icon of the notification.
default: mdi:harddisk
selector:
text: {}
channel:
name: Notification Channel
description: Channel of the notification.
default: updates
selector:
text: {}
persistent:
name: Persistent Notification
description: Whether the notification is persistent.
default: false
selector:
boolean: {}
visibility:
name: Notification Visibility
description: Visibility of the notification.
default: 'private'
selector:
select:
options:
- 'private'
- 'public'
- 'secret'
local_push:
name: Local Push Notification
description: Whether the notification is a local push notification.
default: true
selector:
boolean: {}
car_ui:
name: Car User Interface
description: Whether the notification is compatible with car user interfaces.
default: true
selector:
boolean: {}
timeout:
name: Notification Timeout
description: Timeout of the notification in seconds.
default: 60
selector:
number:
min: 1
max: 300
alert_once:
name: Alert Once
description: Whether the notification should only alert once.
default: true
selector:
boolean: {}
notification_service:
name: Notification Service
description: Service to send the notification.
default: notify.mobile_app_your_device
selector:
text: {}
trigger:
platform: state
entity_id: !input 'raid_arrays'
attribute: resync_status
from: "0"
condition:
- condition: time
after: !input 'time_after'
before: !input 'time_before'
action:
- service: !input 'notification_service'
data:
message: >-
{% set drives = !input 'raid_arrays' %} {% for drive in drives %}
{% set resync_status = state_attr(drive, 'resync_status') %}
{% set active_disks = state_attr(drive, 'active_disks') %}
{% set failed_disks = state_attr(drive, 'failed_disks') %}
{% if resync_status is not none and resync_status | int > 0 %}
Drive {{ drive }} is resyncing. Current resync status: {{ resync_status }}
{% endif %}
{% if active_disks is not none and failed_disks is not none %}
Drive {{ drive }} has {{ active_disks }} active disks and {{ failed_disks }} failed disks.
{% endif %}
{% endfor %}
title: "Homeassistant: Raid Check"
data:
priority: !input 'priority'
color: !input 'color'
notification_icon: !input 'notification_icon'
channel: !input 'channel'
persistent: !input 'persistent'
visibility: !input 'visibility'
local_push: !input 'local_push'
car_ui: !input 'car_ui'
timeout: !input 'timeout'
alert_once: !input 'alert_once'