Skip to content

Grid voltage alert: report the voltage that tripped it - #77

Merged
AlexandrLisitsa merged 1 commit into
masterfrom
fix/grid-voltage-alert-text
Nov 2, 2026
Merged

AlexandrLisitsa merged 1 commit into
masterfrom
fix/grid-voltage-alert-text

Conversation

@AlexandrLisitsa

Copy link
Copy Markdown
Owner

Why

⚠️ Alert: Grid Voltage Out of Range waited 20 s after grid_condition_safe tripped and only then read the voltage. grid_safe's 300 s delayed_off keeps it unsafe long after a short spike, so the reading was usually back in range. On the night of 1–2 Nov:

Trip (UTC) What tripped it Alert said
01:50, 02:14, 03:13, 04:08, 04:13 250.0–253.5 V for a few seconds "Low 248/247 V" or "High 253 V"
05:33 9-second dropout to 2 V "Low 226 V"

What changed

  • The automation triggers on the trip itself and reads trip_volts first. grid_safe has a 5 s delayed_on, so that reading is the one that was out of range.
  • The 20 s hold moves into the actions, then grid_safe must still be unsafe. If grid_down is still on 20 s after the hold, the Grid Outage alert has already fired and the run stops. A shorter dropout pages as Low.
  • The title comes from trip_volts: High at 250 V or more, Low at 185 V or less, otherwise Out of Range.
  • Message: "Mains went to 252 V, outside 185-250 V (248 V now)."
  • ✅ Grid Voltage Normal is unchanged. Its condition still holds because last_triggered is the trip time, which is inside the spell.

Testing

  • check_automations.py section 2b covers the trigger, the order of the steps, each title and the message. All checks pass.
  • Already deployed to the box: its copy matched master before the copy, ha core check passed, and the reloaded config has the new actions.

🤖 Generated with Claude Code

The alert held grid_condition_safe unsafe for 20 s and only then read the
voltage. grid_safe's 300 s delayed_off keeps it unsafe long after a short
spike, so by then the grid was usually back: on the night of 1-2 Nov five
250-253 V spikes paged as "Low 248 V, outside 185-250 V", and a 9-second
dropout to 2 V paged as "Low 226 V".

- Trigger on the trip itself and read trip_volts first: grid_safe has a 5 s
  delayed_on, so that reading is the one out of range.
- The 20 s hold moves into the actions, then grid_safe must still be
  unsafe. If grid_down is still on 20 s after the hold the Grid Outage
  alert has fired and the run stops; a shorter dropout pages as Low.
- Title from trip_volts (High >= 250, Low <= 185, else Out of Range);
  message "Mains went to 252 V, outside 185-250 V (248 V now)".
- Grid Voltage Normal is unchanged: last_triggered is the trip time, still
  inside the spell.
- check_automations.py section 2b follows the new shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AlexandrLisitsa
AlexandrLisitsa merged commit a58aea0 into master Nov 2, 2026
7 checks passed
@AlexandrLisitsa
AlexandrLisitsa deleted the fix/grid-voltage-alert-text branch November 2, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant