flexpool-rules 0.5.0

flexpool market rules: dated entries with registered sources, embedded at compile time. No I/O.
Documentation
# Alarm philosophy (D24) — the rationalised alarm types and the targets the alarm system is measured
# against. ISA-18.2 asks for every alarm: cause, consequence, operator action, time to respond and a
# priority; an indication without an operator action is an event, not an alarm.
# Delays remove chatter (ISA-18.2 §10, "alarm deadband and delay"); their values are flexpool's
# design choices, reviewed here like any other rule.

# ── Philosophy ───────────────────────────────────────────────────────────────────────────────────

[[rule]]
id          = "alarm.target-rate"
valid_from  = "2025-01-01"
source      = "eemua-191"
clause      = "Average alarm rate in normal operation: about one alarm per 10 minutes per operator is very likely acceptable"
count       = 1
window_secs = 600

[[rule]]
id          = "alarm.flood"
valid_from  = "2025-01-01"
source      = "isa-18-2-2016"
clause      = "Alarm flood: more than 10 alarms per 10 minutes per operator"
count       = 10
window_secs = 600

[[rule]]
id          = "alarm.chattering"
valid_from  = "2025-01-01"
source      = "isa-18-2-2016"
clause      = "Chattering alarm: one that repeatedly transitions between states; flexpool counts three raises within a minute"
count       = 3
window_secs = 60

[[rule]]
id          = "alarm.standing"
valid_from  = "2025-01-01"
source      = "isa-18-2-2016"
clause      = "Stale (standing) alarm: one that remains annunciated for more than 24 hours"
seconds     = 86400

[[rule]]
id          = "alarm.shelve-max"
valid_from  = "2025-01-01"
source      = "isa-18-2-2016"
clause      = "Shelving is a temporary, controlled suppression with a time limit; flexpool limits it to one shift (8 hours)"
seconds     = 28800

# ── Alarm types ──────────────────────────────────────────────────────────────────────────────────

[[rule]]
id         = "alarm.pool-availability"
valid_from = "2025-01-01"
source     = "isa-18-2-2016"
clause     = "Priority from consequence severity and time to respond: a pool that cannot deliver what it may have committed"
[rule.alarm]
priority        = 1
respond_minutes = 15
on_delay_secs   = 120
off_delay_secs  = 120
threshold       = "0.9"
title_de        = "{subject}: weniger als 90 % der Leistung mit aktuellen Werten"
title_en        = "{subject}: less than 90 % of its power with current values"
cause_de        = "Anlagen mit großer Nennleistung melden keine, veraltete oder unplausible Werte."
cause_en        = "Assets with large rated power report no, stale or implausible values."
consequence_de  = "Die verfügbare Flexibilität des Pools ist unbekannt; zugesagte Leistung kann ausbleiben."
consequence_en  = "The pool's available flexibility is unknown; committed power may not be delivered."
action_de       = "Betroffene Anlagen in Anlagen (Zustand) prüfen, Verbindungen in Integrationen prüfen, bei anhaltender Störung Zusagen des Pools mit dem Handel abstimmen."
action_en       = "Check the affected assets in Anlagen (status) and their connections in Integrationen; if it persists, agree the pool's commitments with trading."

[[rule]]
id         = "alarm.connection-down"
valid_from = "2025-01-01"
source     = "isa-18-2-2016"
clause     = "One alarm per cause: the connection, not each asset behind it (root-cause grouping)"
[rule.alarm]
priority        = 2
respond_minutes = 30
on_delay_secs   = 30
off_delay_secs  = 60
title_de        = "Verbindung {subject} getrennt"
title_en        = "Connection {subject} down"
cause_de        = "Gerät, Gateway oder Netzwerk zur Anlage nicht erreichbar."
cause_en        = "Device, gateway or network to the site unreachable."
consequence_de  = "Für alle Anlagen dieser Verbindung fehlen Werte; flexpool versucht es mit wachsenden Abständen erneut."
consequence_en  = "All assets behind this connection report nothing; flexpool keeps retrying with growing intervals."
action_de       = "Letzte Meldungen in Integrationen lesen; Standort oder Betreiber des Gateways kontaktieren."
action_en       = "Read the last messages in Integrationen; contact the site or the gateway's operator."

[[rule]]
id         = "alarm.asset-implausible"
valid_from = "2025-01-01"
source     = "isa-18-2-2016"
clause     = "Bad measurement quality is an alarm when it misleads operation"
[rule.alarm]
priority        = 2
respond_minutes = 60
on_delay_secs   = 60
off_delay_secs  = 60
title_de        = "Anlage {subject} meldet unplausible Werte"
title_en        = "Asset {subject} reports implausible values"
cause_de        = "Messwert außerhalb physikalischer Grenzen oder vom Gerät als ungültig markiert — Skalierung, Zuordnung oder Messung falsch."
cause_en        = "Value outside physical limits or marked invalid by the device — scaling, mapping or measurement wrong."
consequence_de  = "Die Anlage zählt in keiner Summe; ihr wahrer Zustand ist unbekannt."
consequence_en  = "The asset counts in no total; its true state is unknown."
action_de       = "Skalierung und Adressen in edge.toml prüfen; Messung am Standort prüfen lassen."
action_en       = "Check scaling and addresses in edge.toml; have the measurement checked on site."

[[rule]]
id         = "alarm.asset-offline"
valid_from = "2025-01-01"
source     = "eemua-191"
clause     = "Low-priority alarms for single items of plant; suppressed when their cause is already annunciated"
[rule.alarm]
priority        = 3
respond_minutes = 240
on_delay_secs   = 300
off_delay_secs  = 60
title_de        = "Anlage {subject} ohne Daten"
title_en        = "Asset {subject} without data"
cause_de        = "Die Anlage liefert keine Werte, ihre Verbindung ist aber nicht als getrennt gemeldet."
cause_en        = "The asset delivers no values although its connection is not reported down."
consequence_de  = "Die Anlage fehlt in den Summen ihres Pools."
consequence_en  = "The asset is missing from its pool's totals."
action_de       = "Im Laufe der Schicht klären: Anlage, Zuordnung oder Störung am Standort."
action_en       = "Clear up during the shift: the asset, its mapping or a fault on site."

[[rule]]
id         = "alarm.asset-stale"
valid_from = "2025-01-01"
source     = "eemua-191"
clause     = "Low-priority alarms for single items of plant"
[rule.alarm]
priority        = 3
respond_minutes = 240
on_delay_secs   = 300
off_delay_secs  = 60
title_de        = "Anlage {subject} meldet veraltete Werte"
title_en        = "Asset {subject} reports stale values"
cause_de        = "Der letzte Wert ist älter als erlaubt oder vom Gerät als fraglich markiert — häufig eingefrorene Messung."
cause_en        = "The last value is older than allowed or marked questionable by the device — often a frozen measurement."
consequence_de  = "Die Anlage zählt in keiner Summe."
consequence_en  = "The asset counts in no total."
action_de       = "Messung und Gerätezeit am Standort prüfen lassen."
action_en       = "Have the measurement and the device's clock checked on site."

[[rule]]
id         = "alarm.delivery-deviation"
valid_from = "2025-01-01"
source     = "isa-18-2-2016"
clause     = "Priority from consequence severity and time to respond: a deviation from the traded schedule still correctable in intraday trading"
[rule.alarm]
priority        = 2
respond_minutes = 15
on_delay_secs   = 0
off_delay_secs  = 0
threshold       = "0.1"
title_de        = "{subject}: Lieferung weicht vom Fahrplan ab"
title_en        = "{subject}: delivery deviates from the schedule"
cause_de        = "Die Leistung der Batterien weicht in der laufenden Viertelstunde voraussichtlich oder in der letzten um mehr als 10 % ihrer Leistung vom Fahrplan ab, oder weniger als 90 % der Batterien liefern Messwerte."
cause_en        = "The batteries' power is projected to deviate in the running quarter hour, or deviated in the last one, by more than 10 % of their power from the schedule, or less than 90 % of the batteries report values."
consequence_de  = "Der Bilanzkreis ist unausgeglichen; jede weitere Viertelstunde kostet zum Ausgleichsenergiepreis (reBAP)."
consequence_en  = "The balance group is out of balance; every further quarter hour is settled at the imbalance price (reBAP)."
action_de       = "In Buch unter Lieferung die betroffenen Anlagen und die Vorschläge für die nächste Stunde prüfen; im Intraday nachhandeln und den Ausfall der Anlage beheben lassen."
action_en       = "Check the affected assets and the proposals for the next hour in Buch under Lieferung; trade back in intraday and have the asset's outage fixed."