fix(plant): review-gate fixes — level-based UPS re-polls, test hardening [#790 #344]
ci / lint (push) Successful in 55s
ci / config-check (push) Failing after 1m5s

Adversarial review verdict FAIL -> addressed: runtime-low + shutdown
chain re-poll /5 min (edge-crossing could miss a page mid-outage);
suppression stamp set after notify; plan body names all 7 hosts
explicitly; test fixes (pipefail SIGPIPE, comment-only assertion).
Reviewer P1 'tripp_lite slug' refuted with live entity registry
evidence (entity_id derives from name; sensor exists, 8f48730 aligned).
On-box ha core check passed with the changed files.

Review thread: #3
This commit is contained in:
2026-09-06 06:49:26 -05:00
parent b06ef7dbf0
commit d18e467484
3 changed files with 70 additions and 21 deletions
+16 -5
View File
@@ -79,14 +79,25 @@
- sensor.pfv_ups_runtime_minutes
- sensor.pfv_tripp_lite_runtime_minutes
below: 10
# 5-min level re-check: numeric_state alone fires only on the threshold
# CROSSING — a blip at that minute (or an HA restart mid-outage) would
# silence the page for the whole discharge. Level-based polling turns
# this into an escalation ladder while the outage persists.
- trigger: time_pattern
minutes: /5
conditions:
- condition: template
value_template: >-
{% set status_map = {
'sensor.pfv_ups_runtime_minutes': 'sensor.tsys1_ups_status',
'sensor.pfv_tripp_lite_runtime_minutes': 'sensor.tsys1_triplite_status'} %}
{{ states(status_map.get(trigger.entity_id, 'sensor.tsys1_ups_status'))
not in ['Online', 'OL', 'unknown', 'unavailable'] }}
{% set ns = namespace(hit=false) %}
{% for rt, st in [
('sensor.pfv_ups_runtime_minutes', 'sensor.tsys1_ups_status'),
('sensor.pfv_tripp_lite_runtime_minutes', 'sensor.tsys1_triplite_status')] %}
{% if is_number(states(rt)) and (states(rt) | float) < 10
and states(st) not in ['Online', 'OL', 'unknown', 'unavailable'] %}
{% set ns.hit = true %}
{% endif %}
{% endfor %}
{{ ns.hit }}
actions:
- action: notify.send_message
target: