You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 257a7d0
Browse filesBrowse the repository at this point in the historyBrowse files
Update README to reflect current config values and scheduler behaviour (#28)
- Correct config code block: HEADROOM_TARGET_KWH 10.2→12.0, MORNING_HIGH_SOC_THRESHOLD_PERCENT 95→55, and four other stale values
- Update HEADROOM_TARGET_KWH description to battery-capacity formula (BATTERY_KWH × 0.5)
- Update MORNING_HIGH_SOC_THRESHOLD_PERCENT description to document 55% trigger and 10% gap above 45% floor
- Update quick examples and export-to-grid formula section to use 12.0 kWh
- Rewrite export-to-grid formula from old physics model to battery-capacity model
- Rewrite state machine flowchart: remove bogus PreRestoreMode save step, fix orphaned EvaluateToGreen reference, add auto-extension path, add mid-period high-SOC safety export node
- Update key state flows description to match revised flowchart
-`QUARTZ_RED_CAPACITY_FRACTION`: lower Quartz status threshold as a fraction of configured array capacity
341
341
-`QUARTZ_GREEN_CAPACITY_FRACTION`: upper Quartz status threshold as a fraction of configured array capacity
342
342
-`FORECAST_SOLAR_POWER_MULTIPLIER`: scalar applied to Forecast.Solar watts before period status/value normalization; use this to correct persistent local bias (for example, historical under-forecasting)
343
-
-`HEADROOM_TARGET_KWH`: fixed battery headroom target for Green periods (10.2 kWh = surplus capacity × 3 hours)
343
+
-`HEADROOM_TARGET_KWH`: fixed battery headroom target for Green periods (12.0 kWh = BATTERY_KWH × 0.5)
344
344
-`AMBER_HEADROOM_FRACTION`: fraction of battery capacity to maintain as free headroom before Amber periods (default `0.25`); `AMBER_HEADROOM_TARGET_KWH` is derived as `BATTERY_KWH * AMBER_HEADROOM_FRACTION`. Set to `0.0` to disable Amber headroom
345
345
-`ENABLE_PRE_CHEAP_RATE_BATTERY_BRIDGE`: when enabled, Evening decisions avoid charge-oriented behavior before cheap-rate starts if battery can bridge the expected load
346
346
-`ESTIMATED_HOME_LOAD_KW`: average household load estimate used to calculate whether current battery energy can cover consumption until cheap-rate begins
347
347
-`BRIDGE_BATTERY_RESERVE_KWH`: safety buffer to keep in battery when evaluating bridge sufficiency
348
348
-`MORNING_HIGH_SOC_PROTECTION_ENABLED`: enables high-SOC export protection rule for selected daytime periods
349
-
-`MORNING_HIGH_SOC_THRESHOLD_PERCENT`: SOC threshold for the high-SOC export protection rule
349
+
-`MORNING_HIGH_SOC_THRESHOLD_PERCENT`: SOC trigger threshold for the mid-period high-SOC safety export (default 55%, which is 10% above the 45% export floor set by `DAYTIME_TIMED_EXPORT_MIN_SOC_PERCENT`)
350
350
-`LIVE_CLIPPING_RISK_VALID_PERIODS`: comma-separated period codes where live clipping-risk Amber→Green promotion is active (`M`=Morning, `A`=Afternoon, `E`=Evening). Only applies to the intra-tick live solar check.
351
351
-`LIVE_CLIPPING_RISK_SOC_THRESHOLD_PERCENT`: SOC threshold for live clipping-risk Amber→Green promotion
352
352
-`LIVE_CLIPPING_RISK_SOLAR_TRIGGER_KW`: rolling live-solar kW threshold for live clipping-risk promotion
@@ -483,8 +483,8 @@ For night:
483
483
484
484
### Quick examples
485
485
486
-
- Green + headroom < 10.2 kWh -> `GRID_EXPORT` (insufficient space for incoming solar).
487
-
- Green + headroom >= 10.2 kWh -> Follow forecast mode (battery can absorb the solar).
486
+
- Green + headroom < 12.0 kWh -> `GRID_EXPORT` (insufficient space for incoming solar).
487
+
- Green + headroom >= 12.0 kWh -> Follow forecast mode (battery can absorb the solar).
-**Timed Export Override**: Once active (from pre-export or clipping), all normal scheduler decisions are skipped until the export window expires or SOC floor is reached (early exit)
-**Timed Export Override**: Once active (from pre-export, clipping, or high-SOC), all normal scheduler decisions are skipped until the export window expires or SOC floor is reached (early exit). The restore target mode is saved at export start, not at restore time.
592
+
-**Auto-Extension**: If the export window expires but SOC is still above the floor, the restore timestamp is bumped forward rather than restoring — this avoids immediately re-triggering the same export on the next tick.
2.**PERIOD-START**: Detects live clipping risk (solar near inverter ceiling) and promotes forecast status; applies final mode decision
596
+
1.**MID-PERIOD HIGH-SOC**: If the period has started and SOC is above the trigger threshold (55%) and the one-shot flag is not yet set, starts a bounded GRID_EXPORT down to the 45% floor; fires at most once per period
3.**PERIOD-START**: Detects live clipping risk (solar near inverter ceiling) and promotes forecast status; applies final mode decision
591
599
-**Live Clipping Promotion**: If Amber forecast but live solar is near ceiling and SOC is high, runtime system promotes it to Green for export decisions
592
600
-**Mode Application**: Switches inverter to decided mode via Sigen API and records telemetry
593
-
-**Restore**: Timed export windows track pre-export mode and automatically restore when complete
601
+
-**Restore**: Timed export windows automatically restore to the mode that was active when the export started
594
602
595
603
### Official OpenAPI integration (`integrations/sigen_official.py`)
596
604
@@ -664,10 +672,10 @@ The headroom target varies by forecast status:
The Amber target is a reduced fraction of the battery, reflecting that Amber days carry real but moderate solar risk — enough to warrant partial headroom, but not the full Green reserve. Setting `AMBER_HEADROOM_FRACTION = 0.0` disables Amber headroom entirely.
@@ -679,7 +687,7 @@ $$
679
687
680
688
then the system selects `GRID_EXPORT` to create battery space ahead of the solar period.
681
689
682
-
**Why this model is superior:** The old fraction-based model (0.25 × forecast) was fundamentally broken because it relied on ESB synthetic forecast categories (500W "Green" label) rather than real solar predictions. This led to ultra-small targets (0.375 kWh at SOC=100%) and essentially no early lead time. The physics model instead grounds the target in actual hardware constraints: *how much surplus power can the inverter not distribute?* This is deterministic, testable, and produces realistic lead times (~2 hours at SOC=100% for Green periods).
690
+
**Why this model is superior:** The old fraction-based model (0.25 × forecast) was fundamentally broken because it relied on ESB synthetic forecast categories (500W "Green" label) rather than real solar predictions. This led to ultra-small targets (0.375 kWh at SOC=100%) and essentially no early lead time. The fixed battery-capacity model instead grounds the target in the battery size itself: *what fraction of the battery must be free to absorb expected solar on a good day?* This is deterministic, testable, and produces realistic lead times (~2 hours at SOC=100% for Green periods).
0 commit comments