Add export plan guard to block Deye export against plan.
Force PASSIVE/no-export when sell is negative or export_mode is NONE, and alert NEG_SELL_EXPORT in plan_actual_slot_guard when export still occurs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -58,6 +58,21 @@ Ověření: logy backendu kolem pokusu **nebo** `select id,status,created_at fro
|
||||
|
||||
---
|
||||
|
||||
## Exekuční pojistky exportu (AUTO)
|
||||
|
||||
Po `_build_setpoints`, před zápisem Modbus (`orchestrator.export_setpoints`):
|
||||
|
||||
| Guard | Podmínka | Efekt |
|
||||
|-------|----------|--------|
|
||||
| **`_apply_export_plan_guard`** | `effective_sell_price < 0` **nebo** (`export_mode = NONE` a `grid_setpoint_w ≥ 0`) | PASSIVE, `export_ban`, `grid_export_limit = 0`, vybíjení baterie do sítě vynulováno (`battery_w = max(0, …)`), `deye_physical_mode = PASSIVE` |
|
||||
| **`_apply_price_failsafe_guard`** | `is_predicted_price = true` | PASSIVE, všechny výkonové setpointy 0, žádný export |
|
||||
|
||||
Implementace: `backend/services/control/setpoints.py`. Ověření: `pytest backend/tests/test_control_export_plan_guard.py`.
|
||||
|
||||
**Poznámka:** PV B (nekontrolovatelné pole) může při záporné vykupní stále fyzicky exportovat — pojistka řídí Deye (baterie + řízené FVE A), ne mikroinvertory na GEN bez cut-off.
|
||||
|
||||
---
|
||||
|
||||
## Logika exportu
|
||||
|
||||
```python
|
||||
|
||||
Reference in New Issue
Block a user