-
-
Notifications
You must be signed in to change notification settings - Fork 499
Expand file tree
/
Copy pathprocessmonitor.yaml
More file actions
executable file
·164 lines (159 loc) · 6.87 KB
/
Copy pathprocessmonitor.yaml
File metadata and controls
executable file
·164 lines (159 loc) · 6.87 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
######################################################################
# @CCOSTAN - Follow Me on X
# For more info visit https://www.vcloudinfo.com/click-here
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# Process Monitor - Disk pressure alerting + Joanna dispatch
# Tracks Home Assistant root filesystem usage from the System Monitor integration.
# -------------------------------------------------------------------
# - Blog: https://www.vcloudinfo.com/2026/04/joanna-agent-engineer-home-assistant-infrastructure-dispatch.html
# Notes: Uses `sensor.disk_use_percent` for the root (`/`) filesystem.
# Notes: 80% usage writes an immediate activity note; Joanna reviews only after 10 minutes above threshold.
# Notes: Phone alerts happen only after Joanna dispatch and a short unresolved grace period.
# Notes: 90% usage opens a Repairs issue and dispatches Joanna for urgent triage.
######################################################################
automation:
- alias: "Self Heal Disk Use Alarm"
id: b16f2155-4688-4c0f-9cf8-b382e294a029
description: "Log elevated root disk usage immediately so transient pressure shows up in the digest."
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.disk_use_percent
above: 80
variables:
mount_path: "/"
disk_use: "{{ states('sensor.disk_use_percent') | float(0) | round(1) }}"
action:
- service: script.send_to_logbook
data:
topic: "SYSTEM"
message: "Disk usage exceeded 80% ({{ mount_path }}: {{ disk_use }}%). Monitoring for sustained pressure."
- service: tts.clear_cache
- alias: "Self Heal Disk Use Joanna Review"
id: processmonitor_disk_use_joanna_review
description: "Dispatch Joanna when elevated root disk usage remains above 80% for 10 minutes."
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.disk_use_percent
above: 80
for:
minutes: 10
variables:
mount_path: "/"
disk_use: "{{ states('sensor.disk_use_percent') | float(0) | round(1) }}"
trigger_context: "HA automation processmonitor_disk_use_joanna_review (Self Heal Disk Use Joanna Review)"
condition:
- condition: numeric_state
entity_id: sensor.disk_use_percent
below: 90
action:
- service: script.joanna_dispatch
data:
trigger_context: "{{ trigger_context }}"
source: "home_assistant_automation.processmonitor_disk_use_joanna_review"
summary: "Home Assistant root disk usage remained above 80% for 10 minutes"
entity_ids:
- "sensor.disk_use_percent"
diagnostics: >-
mount_path={{ mount_path }},
disk_use={{ disk_use }},
threshold=80,
sustained_for=10m
request: >-
Review Home Assistant disk growth and recommend safe cleanup actions.
Check recorder/database size, logs, cache, backups, and temporary files.
Do not restart Home Assistant or remove data unless explicitly requested.
- service: script.send_to_logbook
data:
topic: "SYSTEM"
message: >-
Disk usage remained above 80% for 10 minutes ({{ mount_path }}: {{ disk_use }}%).
Joanna review requested.
- delay: "00:05:00"
- condition: numeric_state
entity_id: sensor.disk_use_percent
above: 80
below: 90
- service: script.notify_engine
data:
value1: "Hard Drive Monitor:"
value2: "Joanna is reviewing sustained Home Assistant disk usage at {{ mount_path }}:{{ states('sensor.disk_use_percent') | float(0) | round(1) }}%."
value3: "No phone alert was sent until the issue stayed unresolved."
who: "carlo"
- alias: "Disk Use Alarm"
id: 1ce3cb43-0e27-4c53-acdd-d672396f3559
description: "Open a Repairs issue and dispatch Joanna when root disk usage becomes critical."
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.disk_use_percent
above: 90
variables:
issue_id: "processmonitor_disk_use_critical"
mount_path: "/"
disk_use: "{{ states('sensor.disk_use_percent') | float(0) | round(1) }}"
trigger_context: "HA automation 1ce3cb43-0e27-4c53-acdd-d672396f3559 (Disk Use Alarm)"
action:
- service: repairs.create
data:
issue_id: "{{ issue_id }}"
title: "Home Assistant disk usage critical"
severity: "error"
persistent: true
description: >-
Home Assistant detected critical disk pressure on {{ mount_path }}.
disk_use: {{ disk_use }}%
entity_id: sensor.disk_use_percent
- service: script.joanna_dispatch
data:
trigger_context: "{{ trigger_context }}"
source: "home_assistant_automation.disk_use_alarm"
summary: "Home Assistant root disk usage exceeded 90%"
entity_ids:
- "sensor.disk_use_percent"
diagnostics: >-
issue_id={{ issue_id }},
mount_path={{ mount_path }},
disk_use={{ disk_use }},
threshold=90
request: >-
Investigate critical Home Assistant disk usage and recommend or perform safe remediation if available.
Check recorder/database size, logs, cache, backups, and temporary files first.
Do not restart Home Assistant or prune/delete data unless explicitly requested.
- service: script.send_to_logbook
data:
topic: "SYSTEM"
message: >-
Disk usage exceeded 90% ({{ mount_path }}: {{ disk_use }}%).
Repair {{ issue_id }} opened and Joanna investigation requested.
- delay: "00:05:00"
- condition: numeric_state
entity_id: sensor.disk_use_percent
above: 90
- service: script.notify_engine
data:
value1: "Hard Drive Monitor:"
value2: "Critical Home Assistant disk usage is still active at {{ mount_path }}:{{ states('sensor.disk_use_percent') | float(0) | round(1) }}%."
value3: "Joanna has already been dispatched to investigate."
who: "carlo"
- alias: "Disk Use Alarm Recovery"
id: processmonitor_disk_use_alarm_recovery
description: "Clear the disk pressure repair once root filesystem usage has recovered."
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.disk_use_percent
below: 85
for:
minutes: 10
action:
- service: repairs.remove
continue_on_error: true
data:
issue_id: "processmonitor_disk_use_critical"
- service: script.send_to_logbook
data:
topic: "SYSTEM"
message: "Disk usage recovered below 85% on /. Repair processmonitor_disk_use_critical cleared."