Repository navigation
Expand file tree
/
Copy pathinfrastructure.yaml
More file actions
1603 lines (1554 loc) · 83 KB
/
Copy pathinfrastructure.yaml
File metadata and controls
1603 lines (1554 loc) · 83 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
######################################################################
# @CCOSTAN - Follow Me on X
# For more info visit https://www.vcloudinfo.com/click-here
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# Infrastructure - Observability, disk pressure, and Joanna review workflows
# Related Issue: 1936
# WAN/DNS/website/Docker host state normalized for dashboards, plus scheduled infrastructure reviews.
# Cloudflare video: https://youtu.be/-v1JkKwDrI8
# Cloudflare blog: https://www.vcloudinfo.com/2026/10/cloudflare-free-webhooks-home-assistant-website-alerts.html
# Video: https://youtu.be/F-PpsKkzcrM
# Blog: https://www.vcloudinfo.com/2026/08/home-assistant-internet-speed-monitoring-ookla.html
# -------------------------------------------------------------------
# Related Issue: 1584
# Related Issue: 1890
# Notes: Home dashboard consumes `infra_*` entities for exceptions-only alerts.
# Notes: Systems uses the highest active severity: critical overrides warning; no issues is healthy.
# Notes: Cloudflare alerts use an authenticated Nabu Casa webhook, persistent Repairs, and owned-resource-only Joanna dispatch.
# Notes: Certificate and unowned-domain alerts require human review; no Cloudflare DNS or security writes are authorized by an alert.
# Notes: Cloudflare delivery is webhook-only; origin recovery reuses reports from existing website probes.
# Notes: WAN outages require all four independent ICMP/HTTPS probes to fail continuously for 2 minutes.
# Notes: Continuous latency/loss determine WAN quality; Ookla throughput is a separate twice-daily capacity snapshot and never declares an outage.
# Notes: Severe quality turns critical after 30 minutes above 250 ms or 25% loss; moderate quality degradation requires 6 hours above 80 ms or 5% loss.
# Notes: Nightly Duplicati verification runs at 08:00 after the 05:30 Duplicati job and docker_14 reboot window.
# Notes: Duplicati transport/API errors are logged only; repairs are reserved for proven failed or stale backups.
# Notes: Duplicati failure Repairs enable a recovery poll that clears the Repair after a later successful run.
# Notes: Duplicati verification persists its result and latest successful backup time for the Docker storage dashboard.
# Notes: Monthly HA log hygiene review requests Telegram + public-safe GitHub issue follow-up only; Joanna must wait for approval before any changes.
# Notes: Numeric WAN telemetry exposes state_class so recorder can keep long-term statistics.
# Notes: Docker host root disk usage uses Glances-backed normalized sensors; raw Glances sensors are recorder/logbook-filtered.
# Notes: Disk-pressure dispatch allows bounded safe cleanup of disposable caches and old generated backup artifacts, but not live data or restarts.
# Notes: Warning-level Docker host disk pressure is Joanna-only; Repairs are reserved for critical pressure.
# Notes: Nebula Sync compares the docker_10 primary with the physical office-pi DNS replica and dispatches Joanna on sustained drift or endpoint loss.
# Notes: Promoted IoT DNS consistency compares primary/backup Pi-hole answers for reserved IoT host records.
# Notes: DNS probes retry brief resolver interruptions and filter transport diagnostics; timeout budgets also cover persistent resolver loss.
# Notes: Garage compute heat uses the shared sustained hottest-package thermal incident and telemetry health.
# Notes: Immediate website-down states create Repairs; the installed UptimeRobot integration exposes current state, not trend rollups.
# Notes: External IP uses the live ipify probe; website rollups include only configured UptimeRobot monitors.
# Notes: Bear Stone and website outages dispatch Joanna quietly; no direct phone alerts are sent.
# Notes: Dashboard aggregate issue count is live-only; its underlying degraded sensors retain actionable history.
# Notes: Dashboard aggregate issue count includes compact BearClaw scheduled-job warning/error health.
# Notes: Docker host maintenance is counted separately from container runtime health so pending packages and stale host reports surface on Systems.
# Notes: Home Water rollup includes Rheem faults/telemetry loss plus active Phyn alerts and valve closure.
# Notes: UPS health covers alarms, abnormal NUT states, and telemetry loss across all three devices; utility status remains separate.
# Notes: Sustained UPS faults create Repairs and dispatch Joanna once per changed incident; recovery clears them after two minutes.
# Notes: Dashboard health inventory is shared by count/details in infrastructure_health.jinja; Repairs provide an additional all-clear gate.
# Notes: Only the Eaton's sole low-voltage warning is acknowledged after 24 hours on confirmed mains with no RB/internal/other fault; raw NUT data is retained.
# Notes: The warning timestamp restores across restarts; an outage or different fault resets it, and verified healthy telemetry clears it after two minutes.
######################################################################
input_text:
infra_eaton_low_voltage_since:
name: "Eaton low voltage warning since"
max: 40
infra_eaton_nut_restart_incident:
name: "Eaton NUT restart incident"
max: 40
infra_ups_incident_signature:
name: "UPS incident signature"
max: 255
docker_17_disk_pressure_band:
name: "docker_17 disk pressure band"
max: 20
docker_14_disk_pressure_band:
name: "docker_14 disk pressure band"
max: 20
docker_69_disk_pressure_band:
name: "docker_69 disk pressure band"
max: 20
infra_nebula_sync_health_band:
name: "Nebula Sync health band"
max: 20
infra_pihole_iot_dns_health_band:
name: "Pi-hole IoT DNS health band"
max: 20
infra_duplicati_backup_verification_status:
name: "Duplicati backup verification status"
max: 20
input_boolean:
infra_duplicati_backup_repair_active:
name: "Duplicati backup repair active"
input_datetime:
infra_duplicati_backup_last_success:
name: "Duplicati backup last success"
has_date: true
has_time: true
command_line:
- sensor:
name: Infra WAN Packet Loss
unique_id: infra_wan_packet_loss
command: >-
ping -q -c 10 -W 1 1.1.1.1 2>/dev/null |
awk -F',' '/packet loss/ {gsub(/[^0-9.]/, "", $3); print $3; found=1}
END {if (!found) print "unknown"}'
scan_interval: 300
unit_of_measurement: "%"
state_class: measurement
value_template: "{{ (value | regex_replace('[^0-9.]', '')) or 'unknown' }}"
- sensor:
name: Infra WAN Latency Ms
unique_id: infra_wan_latency_ms
command: >-
ping -q -c 10 -W 1 1.1.1.1 2>/dev/null |
awk -F'/' '/^rtt|^round-trip/ {gsub(/[^0-9.]/, "", $5); print $5; found=1}
END {if (!found) print "unknown"}'
scan_interval: 300
unit_of_measurement: "ms"
state_class: measurement
value_template: "{{ (value | regex_replace('[^0-9.]', '')) or 'unknown' }}"
- sensor:
name: Infra WAN Reachability
unique_id: infra_wan_reachability
command: >-
/bin/bash -c 'ok=0; cf=down; google=down; quad9=down; https=down;
if ping -q -c 1 -W 1 1.1.1.1 >/dev/null 2>&1; then cf=up; ok=$((ok+1)); fi;
if ping -q -c 1 -W 1 8.8.8.8 >/dev/null 2>&1; then google=up; ok=$((ok+1)); fi;
if ping -q -c 1 -W 1 9.9.9.9 >/dev/null 2>&1; then quad9=up; ok=$((ok+1)); fi;
if curl -fsS --max-time 4 https://www.google.com/generate_204 >/dev/null 2>&1; then https=up; ok=$((ok+1)); fi;
status=partial; if [ "$ok" -ge 3 ]; then status=online; elif [ "$ok" -eq 0 ]; then status=offline; fi;
printf "{\"status\":\"%s\",\"checks_passed\":%s,\"checks_total\":4,\"cloudflare_icmp\":\"%s\",\"google_icmp\":\"%s\",\"quad9_icmp\":\"%s\",\"google_https\":\"%s\"}\n"
"$status" "$ok" "$cf" "$google" "$quad9" "$https"'
scan_interval: 60
value_template: "{{ value_json.status | default('unknown') }}"
json_attributes:
- checks_passed
- checks_total
- cloudflare_icmp
- google_icmp
- quad9_icmp
- google_https
- sensor:
name: Infra External IP Fallback
unique_id: infra_external_ip_fallback
command: "curl -fsS https://api.ipify.org || echo unknown"
scan_interval: 900
- sensor:
name: Infra Nebula Sync DNS Consistency
unique_id: infra_nebula_sync_dns_consistency
command_timeout: 40
command: >-
/bin/bash -c 'primary=192.168.10.10; secondary=192.168.10.100; host=GTG-PF45FK6F; fqdn=GTG-PF45FK6F.fordst.com; ip=192.168.10.117; q(){ dig +time=2 +tries=3 +short @"$1" "$2" A 2>/dev/null | sed "/^;/d" | tr -d "\r" | sort | tr "\n" "," | sed "s/,$//"; }; r(){ dig +time=2 +tries=3 +short @"$1" -x "$2" 2>/dev/null | sed "/^;/d" | tr -d "\r" | sed "s/\.$//" | sort | tr "\n" "," | sed "s/,$//"; }; p_short=$(q "$primary" "$host"); s_short=$(q "$secondary" "$host"); p_fqdn=$(q "$primary" "$fqdn"); s_fqdn=$(q "$secondary" "$fqdn"); p_rev=$(r "$primary" "$ip"); s_rev=$(r "$secondary" "$ip"); status=mismatch; if [ "$p_short" = "$ip" ] && [ "$s_short" = "$ip" ] && [ "$p_fqdn" = "$ip" ] && [ "$s_fqdn" = "$ip" ] && [ -n "$p_rev" ] && [ "$p_rev" = "$s_rev" ]; then status=ok; fi; printf "{\"status\":\"%s\",\"host\":\"%s\",\"expected_ip\":\"%s\",\"primary_short\":\"%s\",\"secondary_short\":\"%s\",\"primary_fqdn\":\"%s\",\"secondary_fqdn\":\"%s\",\"primary_reverse\":\"%s\",\"secondary_reverse\":\"%s\"}\n" "$status" "$host" "$ip" "$p_short" "$s_short" "$p_fqdn" "$s_fqdn" "$p_rev" "$s_rev"'
scan_interval: 300
value_template: "{{ value_json.status | default('unknown') }}"
json_attributes:
- host
- expected_ip
- primary_short
- secondary_short
- primary_fqdn
- secondary_fqdn
- primary_reverse
- secondary_reverse
- sensor:
name: Infra Pihole IoT DNS Consistency
unique_id: infra_pihole_iot_dns_consistency
command_timeout: 90
command: >-
/bin/bash -c 'primary=192.168.10.10; secondary=192.168.10.100; records="rachio.fordst.com=192.168.10.73 econet.fordst.com=192.168.10.92 dreame-vacuum.fordst.com=192.168.10.93 carlo-bed.fordst.com=192.168.10.95 lg-smart-fridge.fordst.com=192.168.10.96 tesla-blackbox-gw.fordst.com=192.168.10.97 bgw210.fordst.com=192.168.10.98"; q(){ dig +time=2 +tries=3 +short @"$1" "$2" A 2>/dev/null | sed "/^;/d" | tr -d "\r" | sort | tr "\n" "," | sed "s/,$//"; }; status=ok; checked=0; mismatch_count=0; mismatches=""; for record in $records; do host=${record%%=*}; ip=${record#*=}; p=$(q "$primary" "$host"); s=$(q "$secondary" "$host"); checked=$((checked+1)); if [ "$p" != "$ip" ] || [ "$s" != "$ip" ]; then status=mismatch; mismatch_count=$((mismatch_count+1)); mismatches="${mismatches}${host}:expected=${ip},primary=${p:-none},secondary=${s:-none};"; fi; done; if [ -z "$mismatches" ]; then mismatches=none; fi; printf "{\"status\":\"%s\",\"checked_records\":%s,\"mismatch_count\":%s,\"mismatches\":\"%s\",\"primary_dns\":\"%s\",\"backup_dns\":\"%s\"}\n" "$status" "$checked" "$mismatch_count" "$mismatches" "$primary" "$secondary"'
scan_interval: 300
value_template: "{{ value_json.status | default('unknown') }}"
json_attributes:
- checked_records
- mismatch_count
- mismatches
- primary_dns
- backup_dns
template:
- sensor:
- name: "Infra Eaton Display Status"
unique_id: infra_eaton_display_status
state: >-
{% from 'infrastructure_health.jinja' import eaton_low_voltage_policy %}
{% set policy = (eaton_low_voltage_policy | as_function)() %}
{{ 'Online' if policy.ignored else states('sensor.office_ups_eaton_550_status') }}
attributes:
active_alarm: >-
{% from 'infrastructure_health.jinja' import eaton_low_voltage_policy %}
{% set policy = (eaton_low_voltage_policy | as_function)() %}
{{ '' if policy.ignored else policy.raw_alarm }}
warning_acknowledged: >-
{% from 'infrastructure_health.jinja' import eaton_low_voltage_policy %}
{{ ((eaton_low_voltage_policy | as_function)()).ignored }}
raw_status: "{{ states('sensor.office_ups_eaton_550_status_data') }}"
raw_alarm: "{{ states('sensor.office_office_ups_eaton_3s_550_alarms') }}"
warning_since: "{{ states('input_text.infra_eaton_low_voltage_since') }}"
- name: "Infra External IP"
unique_id: infra_external_ip
state: "{{ states('sensor.infra_external_ip_fallback') | trim }}"
- name: "docker_17 Disk Used Percentage"
unique_id: docker_17_disk_used_percentage
unit_of_measurement: "%"
state_class: measurement
icon: mdi:harddisk
availability: "{{ states('sensor.docker17_disk_usage') not in ['unknown', 'unavailable', 'none', ''] }}"
state: "{{ states('sensor.docker17_disk_usage') | float(0) | round(1) }}"
- name: "docker_14 Disk Used Percentage"
unique_id: docker_14_disk_used_percentage
unit_of_measurement: "%"
state_class: measurement
icon: mdi:harddisk
availability: "{{ states('sensor.docker14_disk_usage') not in ['unknown', 'unavailable', 'none', ''] }}"
state: "{{ states('sensor.docker14_disk_usage') | float(0) | round(1) }}"
- name: "docker_69 Disk Used Percentage"
unique_id: docker_69_disk_used_percentage
unit_of_measurement: "%"
state_class: measurement
icon: mdi:harddisk
availability: "{{ states('sensor.docker69_disk_usage') not in ['unknown', 'unavailable', 'none', ''] }}"
state: "{{ states('sensor.docker69_disk_usage') | float(0) | round(1) }}"
- name: "Infra Website Down Count"
unique_id: infra_website_down_count
icon: mdi:counter
state: >-
{% set ids = [
'binary_sensor.bear_stone',
'binary_sensor.vcloudinfo_com',
'binary_sensor.www_kingcrafthomes_com'
] %}
{% set ns = namespace(count=0) %}
{% for id in ids %}
{% if expand(id) | count > 0 %}
{% set st = states(id) %}
{% if st in ['off', 'unknown', 'unavailable'] %}
{% set ns.count = ns.count + 1 %}
{% endif %}
{% endif %}
{% endfor %}
{{ ns.count }}
attributes:
monitored_entities: >-
{{ [
'binary_sensor.bear_stone',
'binary_sensor.vcloudinfo_com',
'binary_sensor.www_kingcrafthomes_com'
] }}
down_entities: >-
{% set ids = [
'binary_sensor.bear_stone',
'binary_sensor.vcloudinfo_com',
'binary_sensor.www_kingcrafthomes_com'
] %}
{% set ns = namespace(items=[]) %}
{% for id in ids %}
{% if expand(id) | count > 0 %}
{% set st = states(id) %}
{% if st in ['off', 'unknown', 'unavailable'] %}
{% set ns.items = ns.items + [id ~ '=' ~ st] %}
{% endif %}
{% endif %}
{% endfor %}
{{ ns.items }}
- name: "Infra Dashboard Active Issue Count"
unique_id: infra_dashboard_active_issue_count
icon: mdi:alert-circle-check-outline
state: >-
{% from 'infrastructure_health.jinja' import dashboard_active_entities %}
{% set active = dashboard_active_entities | as_function %}
{{ [active() | count, states('sensor.active_issues') | int(0)] | max }}
attributes:
active_entities: >-
{% from 'infrastructure_health.jinja' import dashboard_active_entities %}
{% set active = dashboard_active_entities | as_function %}
{{ active() }}
repair_count: "{{ states('sensor.active_issues') | int(0) }}"
severity: >-
{% from 'infrastructure_health.jinja' import dashboard_severity %}
{{ (dashboard_severity | as_function)() }}
count_policy: "Maximum of active health sources and Repairs; overlapping Repairs are not added twice."
- binary_sensor:
- name: "Home Water Problem"
unique_id: home_water_problem
device_class: problem
state: >-
{% set phyn_alerts = [
'binary_sensor.garage_phyn_battery_alert',
'binary_sensor.garage_phyn_freeze_warning_alert',
'binary_sensor.garage_phyn_high_pressure_alert',
'binary_sensor.garage_phyn_leak_alert',
'binary_sensor.garage_phyn_offline_leak_shutoff_alert',
'binary_sensor.garage_phyn_pinhole_leak_alert',
'binary_sensor.garage_phyn_recurring_flow_alert',
'binary_sensor.garage_phyn_temperature_alert'
] %}
{{ is_state('binary_sensor.rheem_wh_problem', 'on')
or expand(phyn_alerts) | selectattr('state', 'eq', 'on') | list | count > 0
or states('valve.phyn_shutoff_valve') in ['closed', 'closing'] }}
attributes:
active_entities: >-
{% set monitored = [
'binary_sensor.rheem_wh_problem',
'binary_sensor.garage_phyn_battery_alert',
'binary_sensor.garage_phyn_freeze_warning_alert',
'binary_sensor.garage_phyn_high_pressure_alert',
'binary_sensor.garage_phyn_leak_alert',
'binary_sensor.garage_phyn_offline_leak_shutoff_alert',
'binary_sensor.garage_phyn_pinhole_leak_alert',
'binary_sensor.garage_phyn_recurring_flow_alert',
'binary_sensor.garage_phyn_temperature_alert'
] %}
{% set active = expand(monitored)
| selectattr('state', 'eq', 'on')
| map(attribute='entity_id') | list %}
{% if states('valve.phyn_shutoff_valve') in ['closed', 'closing'] %}
{{ active + ['valve.phyn_shutoff_valve'] }}
{% else %}
{{ active }}
{% endif %}
- name: "Infra WAN Outage"
unique_id: infra_wan_outage
device_class: problem
delay_on: "00:02:00"
delay_off: "00:01:00"
state: "{{ is_state('sensor.infra_wan_reachability', 'offline') }}"
attributes:
evaluation_window: "2 minutes"
probe_policy: "all 4 probes failed"
- name: "Infra WAN Capacity Degraded"
unique_id: infra_wan_capacity_degraded
device_class: problem
availability: >-
{{ states('sensor.ookla_speedtest_download') not in ['unknown', 'unavailable', 'none', ''] and
states('sensor.ookla_speedtest_upload') not in ['unknown', 'unavailable', 'none', ''] }}
state: >-
{{ states('sensor.ookla_speedtest_download') | float(0) < 300 or
states('sensor.ookla_speedtest_upload') | float(0) < 300 }}
attributes:
source: "Ookla Speedtest CLI"
download_threshold_mbps: 300
upload_threshold_mbps: 300
last_test: "{{ states('sensor.ookla_speedtest_last_test') }}"
server: "{{ states('sensor.ookla_speedtest_server') }}"
freshness_entity: "binary_sensor.infra_wan_capacity_stale"
- name: "Infra WAN Capacity Stale"
unique_id: infra_wan_capacity_stale
device_class: problem
state: >-
{% set last_raw = states('sensor.ookla_speedtest_last_test') %}
{% if last_raw in ['unknown', 'unavailable', 'none', ''] %}
true
{% else %}
{{ as_timestamp(now()) - as_timestamp(last_raw, 0) > 50400 }}
{% endif %}
attributes:
freshness_limit: "14 hours"
schedule: "02:17 and 14:17 local"
- name: "Infra WAN Sustained Degradation"
unique_id: infra_wan_sustained_degradation
device_class: problem
delay_on: "06:00:00"
delay_off: "00:05:00"
state: >-
{% set loss_raw = states('sensor.infra_wan_packet_loss') %}
{% set lat_raw = states('sensor.infra_wan_latency_ms') %}
{% set invalid_values = ['unknown', 'unavailable', 'none', ''] %}
{% set valid = loss_raw not in invalid_values and lat_raw not in invalid_values %}
{% set loss = loss_raw | float(0) %}
{% set lat = lat_raw | float(0) %}
{{ valid and (loss > 5 or lat > 80) }}
- name: "Infra WAN Severe Degradation"
unique_id: infra_wan_severe_degradation
device_class: problem
delay_on: "00:30:00"
state: >-
{% set loss_raw = states('sensor.infra_wan_packet_loss') %}
{% set lat_raw = states('sensor.infra_wan_latency_ms') %}
{% set invalid_values = ['unknown', 'unavailable', 'none', ''] %}
{% set valid = loss_raw not in invalid_values and
lat_raw not in invalid_values %}
{% set loss = loss_raw | float(0) %}
{% set lat = lat_raw | float(0) %}
{{ valid and (loss > 25 or lat > 250) }}
- name: "Infra WAN Critical"
unique_id: infra_wan_critical
device_class: problem
state: >-
{{ is_state('binary_sensor.infra_wan_outage', 'on') or
is_state('binary_sensor.infra_wan_severe_degradation', 'on') }}
attributes:
severe_evaluation_window: "30 minutes"
severe_latency_threshold_ms: 250
severe_packet_loss_threshold_percent: 25
- name: "Infra WAN Quality Degraded"
unique_id: infra_wan_quality_degraded
device_class: problem
state: >-
{{ is_state('binary_sensor.infra_wan_critical', 'on') or
is_state('binary_sensor.infra_wan_sustained_degradation', 'on') }}
attributes:
evaluation_window: "6 hours"
latency_threshold_ms: 80
packet_loss_threshold_percent: 5
capacity_entity: "binary_sensor.infra_wan_capacity_degraded"
reachability_entity: "sensor.infra_wan_reachability"
severity_scale: "healthy | degraded | critical"
- name: "Infra DNS Pihole Degraded"
unique_id: infra_dns_pihole_degraded
device_class: problem
state: >-
{% set members = [
'switch.pi_hole',
'binary_sensor.pi_hole_status',
'switch.pi_hole_2',
'binary_sensor.pi_hole_status_2'
] %}
{{ expand(members) | rejectattr('state', 'eq', 'on') | list | count > 0 }}
attributes:
problem_entities: >-
{% set members = [
'switch.pi_hole',
'binary_sensor.pi_hole_status',
'switch.pi_hole_2',
'binary_sensor.pi_hole_status_2'
] %}
{{ expand(members) | rejectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}
- name: "Infra Nebula Sync Degraded"
unique_id: infra_nebula_sync_degraded
device_class: problem
state: >-
{% set dns_state = states('sensor.infra_nebula_sync_dns_consistency') | lower %}
{% set portainer_known = [
expand('binary_sensor.nebula_sync_status_2') | count > 0,
expand('sensor.nebula_sync_state_2') | count > 0,
expand('switch.nebula_sync_container_2') | count > 0
] | select('equalto', true) | list | count > 0 %}
{% set portainer_ok = [
is_state('binary_sensor.nebula_sync_status_2', 'on'),
(states('sensor.nebula_sync_state_2') | lower) == 'running',
is_state('switch.nebula_sync_container_2', 'on')
] | select('equalto', true) | list | count > 0 %}
{{ dns_state != 'ok' or (portainer_known and not portainer_ok) }}
attributes:
dns_consistency: "{{ states('sensor.infra_nebula_sync_dns_consistency') }}"
host: "{{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'host') }}"
expected_ip: "{{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'expected_ip') }}"
primary_short: "{{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'primary_short') }}"
secondary_short: "{{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'secondary_short') }}"
primary_fqdn: "{{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'primary_fqdn') }}"
secondary_fqdn: "{{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'secondary_fqdn') }}"
primary_reverse: "{{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'primary_reverse') }}"
secondary_reverse: "{{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'secondary_reverse') }}"
nebula_status: "{{ states('binary_sensor.nebula_sync_status_2') }}"
nebula_state: "{{ states('sensor.nebula_sync_state_2') }}"
pihole_secondary_status: "{{ states('binary_sensor.pi_hole_status_2') }}"
- name: "Infra Pihole IoT DNS Degraded"
unique_id: infra_pihole_iot_dns_degraded
device_class: problem
state: >-
{{ states('sensor.infra_pihole_iot_dns_consistency') | lower != 'ok' }}
attributes:
dns_consistency: "{{ states('sensor.infra_pihole_iot_dns_consistency') }}"
checked_records: "{{ state_attr('sensor.infra_pihole_iot_dns_consistency', 'checked_records') }}"
mismatch_count: "{{ state_attr('sensor.infra_pihole_iot_dns_consistency', 'mismatch_count') }}"
mismatches: "{{ state_attr('sensor.infra_pihole_iot_dns_consistency', 'mismatches') }}"
primary_dns: "{{ state_attr('sensor.infra_pihole_iot_dns_consistency', 'primary_dns') }}"
backup_dns: "{{ state_attr('sensor.infra_pihole_iot_dns_consistency', 'backup_dns') }}"
- name: "Infra UPS On Battery"
unique_id: infra_ups_on_battery
device_class: problem
state: >-
{% set statuses = [
states('sensor.garage_ups_status_data') | upper,
states('sensor.office_ups_eaton_550_status_data') | upper,
states('sensor.office_ups_cyberpower_status_data') | upper
] %}
{% set ns = namespace(on_battery=false) %}
{% for status in statuses %}
{% if 'OB' in status.split() %}
{% set ns.on_battery = true %}
{% endif %}
{% endfor %}
{{ ns.on_battery }}
attributes:
garage_status: "{{ states('sensor.garage_ups_status') }}"
office_status: "{{ states('sensor.office_ups_eaton_550_status') }}"
office_cyberpower_status: "{{ states('sensor.office_ups_cyberpower_status') }}"
- name: "Infra UPS Problem"
unique_id: infra_ups_problem
device_class: problem
state: >-
{% from 'infrastructure_health.jinja' import ups_issues %}
{% set issues = ups_issues | as_function %}
{{ issues() | count > 0 }}
attributes:
issues: >-
{% from 'infrastructure_health.jinja' import ups_issues %}
{% set issues = ups_issues | as_function %}
{{ issues() }}
on_battery: "{{ is_state('binary_sensor.infra_ups_on_battery', 'on') }}"
eaton_low_voltage_policy: >-
{% from 'infrastructure_health.jinja' import eaton_low_voltage_policy %}
{{ (eaton_low_voltage_policy | as_function)() }}
- name: "Infra Website Degraded"
unique_id: infra_website_degraded
device_class: problem
state: >-
{{ states('sensor.infra_website_down_count') | int(0) > 0 }}
- name: "Infra Website Uptime SLO Breach"
unique_id: infra_website_uptime_slo_breach
device_class: problem
state: >-
{% set ns = namespace(seen=false, breach=false) %}
{% for item in states.sensor %}
{% if item.entity_id is search('sensor\\.(vcloudinfo_com|kingcrafthomes_com|www_kingcrafthomes_com).*uptime_1d$') %}
{% if item.state not in ['unknown', 'unavailable', 'none', ''] %}
{% set ns.seen = true %}
{% if (item.state | float(100)) < 99 %}
{% set ns.breach = true %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{{ ns.seen and ns.breach }}
- name: "Infra Website Latency Degraded"
unique_id: infra_website_latency_degraded
device_class: problem
state: >-
{% set ns = namespace(seen=false, breach=false) %}
{% for item in states.sensor %}
{% if item.entity_id is search('sensor\\.(vcloudinfo_com|kingcrafthomes_com|www_kingcrafthomes_com).*avg_response_time_1d$') %}
{% if item.state not in ['unknown', 'unavailable', 'none', ''] %}
{% set ns.seen = true %}
{% if (item.state | float(0)) > 1.2 %}
{% set ns.breach = true %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{{ ns.seen and ns.breach }}
- name: "Infra Compute Degraded"
unique_id: infra_compute_degraded
device_class: problem
state: >-
{{ is_state('binary_sensor.docker_container_telemetry_degraded', 'on') or
states('binary_sensor.proxmox1_runtime_healthy') != 'on' or
states('binary_sensor.proxmox02_runtime_healthy') != 'on' or
states('binary_sensor.node_proxmox03_status') != 'on' or
is_state('binary_sensor.proxmox_garage_thermal_alert', 'on') or
is_state('binary_sensor.proxmox_garage_thermal_telemetry_degraded', 'on') }}
- name: "Infra Storage Degraded"
unique_id: infra_storage_degraded
device_class: problem
state: >-
{% set limits = {
'sensor.disk_use_percent': 80,
'sensor.carlo_nvr_volume_1_volume_used': 85,
'sensor.carlo_nas01_volume_1_volume_used': 85
} %}
{% set ns = namespace(degraded=false) %}
{% for entity_id, limit in limits.items() %}
{% set raw = states(entity_id) %}
{% if raw in ['unknown', 'unavailable', 'none', ''] or raw | float(0) > limit %}
{% set ns.degraded = true %}
{% endif %}
{% endfor %}
{{ ns.degraded }}
- name: "Infra External Monitoring Degraded"
unique_id: infra_external_monitoring_degraded
device_class: problem
state: >-
{{ is_state('binary_sensor.infra_website_degraded', 'on') }}
automation:
- alias: "Infrastructure - Eaton Low Voltage Grace Period"
id: infra_eaton_low_voltage_grace_period
description: "Persist the exact warning's onset; reset on a new outage/fault and retain it through short driver reconnects."
mode: queued
trigger:
- platform: state
entity_id:
- sensor.office_ups_eaton_550_status_data
- sensor.office_office_ups_eaton_3s_550_alarms
- binary_sensor.powerwall_grid_status
- platform: homeassistant
event: start
- platform: time_pattern
minutes: "/1"
condition:
- condition: template
value_template: "{{ expand('input_text.infra_eaton_low_voltage_since') | count > 0 }}"
variables:
policy: >-
{% from 'infrastructure_health.jinja' import eaton_low_voltage_policy %}
{{ (eaton_low_voltage_policy | as_function)() }}
started: "{{ states('input_text.infra_eaton_low_voltage_since') }}"
stable_recovery: >-
{{ policy.healthy and as_timestamp(now()) -
[as_timestamp(states.sensor.office_ups_eaton_550_status_data.last_changed),
as_timestamp(states.sensor.office_office_ups_eaton_3s_550_alarms.last_changed)] | max >= 120 }}
action:
- choose:
- conditions: "{{ (policy.reset_required or stable_recovery) and started != '' }}"
sequence:
- service: input_text.set_value
target:
entity_id: input_text.infra_eaton_low_voltage_since
data:
value: ""
- conditions: "{{ policy.eligible and policy.age_seconds is none }}"
sequence:
- service: input_text.set_value
target:
entity_id: input_text.infra_eaton_low_voltage_since
data:
value: "{{ now().isoformat() }}"
- alias: "Infrastructure - UPS Repair And Dispatch"
id: infra_ups_repair_and_dispatch
description: "Reconcile sustained UPS faults, durable Repairs, and deduplicated Joanna investigation."
mode: queued
trigger:
- platform: state
entity_id: binary_sensor.infra_ups_problem
for: "00:02:00"
- platform: homeassistant
event: start
- platform: time_pattern
minutes: "/5"
condition:
- condition: template
value_template: >-
{{ has_value('binary_sensor.infra_ups_problem') and
expand('input_text.infra_ups_incident_signature') | count > 0 and
as_timestamp(now()) - as_timestamp(states.binary_sensor.infra_ups_problem.last_changed) >= 120 }}
variables:
issues: "{{ state_attr('binary_sensor.infra_ups_problem', 'issues') | default([], true) }}"
eaton_policy: "{{ state_attr('binary_sensor.infra_ups_problem', 'eaton_low_voltage_policy') | default({}, true) }}"
mains_ready: >-
{{ eaton_policy.get('eligible', false) and is_state('binary_sensor.powerwall_grid_status', 'on') and
as_timestamp(now()) - as_timestamp(states.binary_sensor.powerwall_grid_status.last_changed) >= 300 }}
signature: >-
{{ (eaton_policy.get('first_seen', '') ~ '|' ~ mains_ready ~ '|' ~
issues | map(attribute='entity_id') | join(',') ~ '|' ~
issues | map(attribute='status_data') | join(',') ~ '|' ~
issues | map(attribute='alarm') | join(','))[:255] if issues | count > 0 else 'clear' }}
previous: "{{ states('input_text.infra_ups_incident_signature') }}"
summary: >-
{% for issue in issues %}
{{ issue.name }}: {{ issue.alarm or issue.status }}{{ '; ' if not loop.last else '' }}
{% endfor %}
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.infra_ups_problem
state: "on"
sequence:
- service: repairs.create
data:
issue_id: infra_ups_problem
title: "UPS requires attention"
description: >-
{{ summary }}. A reported charge percentage does not rule out a battery fault.
Joanna investigation requested. Keep this Repair open while the effective UPS health
reports an issue; only the exact guarded Eaton warning expires after 24 hours.
severity: error
persistent: true
- if: "{{ signature != previous }}"
then:
- service: script.joanna_dispatch
data:
trigger_context: "Sustained UPS fault or telemetry loss"
source: "home_assistant_automation.infra_ups_repair_and_dispatch"
notify_telegram: true
summary: "{{ summary }}"
entity_ids:
- binary_sensor.infra_ups_problem
- sensor.garage_ups_status_data
- sensor.office_ups_eaton_550_status_data
- sensor.office_ups_cyberpower_status_data
- sensor.office_office_ups_eaton_3s_550_alarms
- sensor.infra_eaton_display_status
- binary_sensor.powerwall_grid_status
- input_text.infra_eaton_low_voltage_since
- input_text.infra_eaton_nut_restart_incident
diagnostics: "{{ {'issues': issues, 'eaton_policy': eaton_policy, 'mains_ready': mains_ready} | tojson }}"
request: >-
Follow the Office Eaton UPS Warning playbook for that device. Investigate each UPS fault using current Home Assistant and raw NUT
status, ups.alarm, battery telemetry, and driver/monitor logs. Distinguish
utility interruption, hardware/battery fault, and telemetry failure.
Do not run a battery test, interrupt utility power, change outlets/shutdown
policy, power-cycle a UPS, or reboot its host. For the sole Eaton low-voltage warning,
one software-only Eaton driver restart per incident is authorized after five minutes
of confirmed utility grid power, UPS OL, no RB/internal/other fault, and immediate
pre-action rechecks. Record the incident before the attempt; verify fresh full-poll
telemetry afterward. Do not restart during an outage or when any guard is unknown.
If unchanged, report that the warning persists; HA acknowledges only this exact warning
after its saved 24-hour grace period with all guards still true. Never overwrite raw NUT
telemetry or remove other faults. Send Carlo a concise Telegram result
with the affected UPS, exact alarm, evidence, and any physical action needed.
During quiet hours retain the result for the morning briefing. An unresolved
alarm remains an open issue until genuine recovery or this narrowly approved HA acknowledgment.
- service: input_text.set_value
target:
entity_id: input_text.infra_ups_incident_signature
data:
value: "{{ signature }}"
- service: script.send_to_logbook
data:
topic: "UPS"
message: "{{ summary }}. Joanna investigation requested."
default:
- service: repairs.remove
continue_on_error: true
data:
issue_id: infra_ups_problem
- if: "{{ previous not in ['clear', 'unknown', 'unavailable', ''] }}"
then:
- service: script.send_to_logbook
data:
topic: "UPS"
message: >-
{% set policy = state_attr('binary_sensor.infra_ups_problem', 'eaton_low_voltage_policy') | default({}, true) %}
{{ 'Eaton low-voltage warning acknowledged after 24 hours with mains and fault guards confirmed; raw NUT warning remains available. UPS Repair cleared.'
if policy.get('ignored', false) else 'All monitored UPS devices report healthy utility status; UPS Repair cleared.' }}
- service: input_text.set_value
target:
entity_id: input_text.infra_ups_incident_signature
data:
value: "clear"
- alias: "Infrastructure - External IP Change Logbook"
id: infra_external_ip_change_logbook
description: "Log external IP changes into the Activity feed."
mode: queued
trigger:
- platform: state
entity_id: sensor.infra_external_ip
condition:
- condition: template
value_template: "{{ trigger.from_state is not none }}"
- condition: template
value_template: >-
{{ trigger.from_state.state not in ['unknown', 'unavailable', 'none', ''] and
trigger.to_state.state not in ['unknown', 'unavailable', 'none', ''] and
trigger.from_state.state != trigger.to_state.state }}
action:
- service: script.send_to_logbook
data:
topic: "NETWORK"
message: >-
External IP changed from {{ trigger.from_state.state }} to {{ trigger.to_state.state }}.
- alias: "Infrastructure - Website Down Repair And Dispatch"
id: infra_website_down_repair_and_dispatch
description: "Create/clear Repairs and dispatch Joanna when monitored websites are immediately down."
mode: queued
trigger:
- platform: state
entity_id: binary_sensor.infra_website_degraded
to: "on"
for: "00:05:00"
id: degraded
- platform: state
entity_id: binary_sensor.infra_website_degraded
to: "off"
id: recovered
variables:
down_count: "{{ states('sensor.infra_website_down_count') | int(0) }}"
down_entities: "{{ state_attr('sensor.infra_website_down_count', 'down_entities') | default([], true) | list }}"
down_summary: "{{ down_entities | join(', ') if (down_entities | count > 0) else 'none' }}"
action:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.id == 'degraded' and down_count > 0 }}"
sequence:
- service: repairs.create
data:
issue_id: infra_website_down
title: "Website availability degraded"
description: >-
{{ down_count }} monitored website
{{ 'entity is' if down_count == 1 else 'entities are' }} down:
{{ down_summary }}.
severity: error
persistent: true
- service: script.joanna_dispatch
data:
trigger_context: >-
HA automation infra_website_down_repair_and_dispatch
(Infrastructure - Website Down Repair And Dispatch)
source: "home_assistant_automation.infra_website_down_repair_and_dispatch"
summary: "Monitored website availability degraded ({{ down_count }} down)"
entity_ids:
- binary_sensor.infra_website_degraded
- sensor.infra_website_down_count
- binary_sensor.bear_stone
- sensor.bear_stone
- binary_sensor.vcloudinfo_com
- sensor.vcloudinfo_com
- sensor.wordpress_wp_state_2
- switch.wordpress_wp_container_2
diagnostics: >-
down_entities={{ down_summary }};
bear_stone_sensor={{ states('sensor.bear_stone') }};
bear_stone_binary={{ states('binary_sensor.bear_stone') }};
vcloudinfo_sensor={{ states('sensor.vcloudinfo_com') }};
vcloudinfo_binary={{ states('binary_sensor.vcloudinfo_com') }};
wordpress_state={{ states('sensor.wordpress_wp_state_2') }};
wordpress_switch={{ states('switch.wordpress_wp_container_2') }};
cloudflared_wp={{ states('switch.cloudflared_wp_container_2') }}.
request: >-
Investigate and resolve the monitored website outage. For
Bear Stone, start with public HTTPS reachability and the
Home Assistant/Cloudflare path. For
vcloudinfo.com, start with public HTTPS reachability,
wordpress_wp, wordpress_db, and cloudflared_wp telemetry.
Verify public HTTP 200 recovery before closing out. Do not
power-cycle unrelated infrastructure.
- service: script.send_to_logbook
data:
topic: "INTERNET"
message: "Website availability dispatch requested ({{ down_summary }})."
default:
- service: repairs.remove
continue_on_error: true
data:
issue_id: infra_website_down
- service: script.send_to_logbook
data:
topic: "INTERNET"
message: "Website availability recovered."
- alias: "Infrastructure - Website Uptime SLO Repair"
id: infra_website_uptime_slo_repair
description: "Create/clear Repairs issue when website 1-day uptime breaches SLO."
mode: queued
trigger:
- platform: state
entity_id: binary_sensor.infra_website_uptime_slo_breach
action:
- choose:
- conditions: "{{ trigger.to_state.state == 'on' }}"
sequence:
- service: repairs.create
data:
issue_id: infra_website_uptime_slo_breach
title: "Website uptime SLO breached"
description: >
At least one monitored website has uptime_1d below 99%.
Review Uptime Kuma entities on the Website Health dashboard.
severity: warning
persistent: true
default:
- service: repairs.remove
continue_on_error: true
data:
issue_id: infra_website_uptime_slo_breach
- alias: "Infrastructure - Website Latency Repair"
id: infra_website_latency_repair
description: "Create/clear Repairs issue when website response times degrade."
mode: queued
trigger:
- platform: state
entity_id: binary_sensor.infra_website_latency_degraded
action:
- choose:
- conditions: "{{ trigger.to_state.state == 'on' }}"
sequence:
- service: repairs.create
data:
issue_id: infra_website_latency_degraded
title: "Website latency degraded"
description: >
At least one monitored website reports avg_response_time_1d above 1.2s.
Review Uptime Kuma response-time entities on Website Health.
severity: warning
persistent: true
default:
- service: repairs.remove
continue_on_error: true
data:
issue_id: infra_website_latency_degraded
- alias: "Infrastructure - Nebula Sync Health Dispatch"
id: infra_nebula_sync_health_dispatch
description: "Dispatch Joanna when Nebula Sync stays degraded outside planned Docker maintenance."
mode: queued
trigger:
- platform: state
entity_id: binary_sensor.infra_nebula_sync_degraded
to: "on"
for: "00:10:00"
id: degraded
- platform: state
entity_id: binary_sensor.infra_nebula_sync_degraded
to: "off"
for: "00:02:00"
id: recovered
- platform: homeassistant
event: start
id: reconcile
- platform: time_pattern
minutes: "/30"
id: reconcile
variables:
issue_id: infra_nebula_sync_degraded
dns_state: "{{ states('sensor.infra_nebula_sync_dns_consistency') }}"
previous_band: "{{ states('input_text.infra_nebula_sync_health_band') | lower }}"
degraded: "{{ is_state('binary_sensor.infra_nebula_sync_degraded', 'on') }}"
nebula_status: "{{ states('binary_sensor.nebula_sync_status_2') }}"
nebula_state: "{{ states('sensor.nebula_sync_state_2') }}"
pihole_secondary_status: "{{ states('binary_sensor.pi_hole_status_2') }}"
action:
- choose:
- conditions:
- condition: template
value_template: "{{ degraded and previous_band != 'warning' }}"
- condition: state
entity_id: binary_sensor.docker_container_alerts_snoozed
state: "off"
sequence:
- service: repairs.remove
continue_on_error: true
data:
issue_id: "{{ issue_id }}"
- service: script.joanna_dispatch
data:
trigger_context: "HA automation infra_nebula_sync_health_dispatch (Infrastructure - Nebula Sync Health Dispatch)"
source: "home_assistant_automation.infra_nebula_sync_health_dispatch.warning"
summary: "Nebula Sync DNS consistency or container health is degraded"
entity_ids:
- sensor.infra_nebula_sync_dns_consistency
- binary_sensor.infra_nebula_sync_degraded
- binary_sensor.nebula_sync_status_2
- sensor.nebula_sync_state_2
- binary_sensor.pi_hole_status_2
diagnostics: >-
issue_id={{ issue_id }},
dns_consistency={{ dns_state }},
host={{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'host') }},
expected_ip={{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'expected_ip') }},
primary_short={{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'primary_short') }},
secondary_short={{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'secondary_short') }},
primary_fqdn={{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'primary_fqdn') }},
secondary_fqdn={{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'secondary_fqdn') }},
primary_reverse={{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'primary_reverse') }},
secondary_reverse={{ state_attr('sensor.infra_nebula_sync_dns_consistency', 'secondary_reverse') }},
nebula_status={{ nebula_status }},
nebula_state={{ nebula_state }},
pihole_secondary_status={{ pihole_secondary_status }},
primary_dns=192.168.10.10,
backup_dns=192.168.10.100
request: >-
Investigate Nebula Sync on docker_14 and the physical backup Pi-hole on office-pi.
Verify both Pi-holes answer the GTG-PF45FK6F short name, FQDN, and reverse lookup consistently.
Check nebula_sync container status, Docker health, recent sync logs, and primary/replica Pi-hole API reachability.
If confidence is high, perform safe remediation such as a one-time Nebula Sync run or restarting only the nebula_sync container.
Docker14 VM 101 power and placement are out of scope: do not start, stop, reboot, or migrate the VM.
If docker_14 is unreachable or VM 101 is stopped, report that blocker instead of changing VM power state.
Do not restart Pi-hole or change DHCP/custom DNS records unless diagnostics prove data drift and the action is safe.
Reply with resolved=true/false, root_cause, action_taken, verification, and next_action_required=true/false.
domain_hint: ops
lane_hint: joanna.ops
- service: script.send_to_logbook
data:
topic: "DNS"
message: >-
Nebula Sync DNS consistency is degraded ({{ dns_state }}); Joanna investigation requested without opening a Repair.
- service: input_text.set_value
target:
entity_id: input_text.infra_nebula_sync_health_band
data:
value: warning
- conditions: "{{ not degraded and previous_band in ['warning', 'unavailable'] }}"
sequence: