Add new daemons and debug scripts for Sigenergy and Oracle functionalities
- Implement `sigen_daemon.py` to poll Sigenergy plant metrics and store snapshots. - Create `web_daemon.py` for serving a web interface with various endpoints. - Add debug scripts: - `debug_duplicates.py` to find duplicate target times in forecast data. - `debug_energy_forecast.py` to print baseline energy forecast curves. - `debug_oracle_evaluations.py` to run the oracle evaluator. - `debug_sigen.py` to inspect stored Sigenergy plant snapshots. - `debug_weather.py` to trace resolved truth data. - `modbus_test.py` for exploring Sigenergy plants or inverters over Modbus TCP. - Introduce `oracle_evaluator.py` for evaluating stored oracle predictions against actuals. - Add TCN training scripts in `tcn` directory for training usage sequence models.
This commit is contained in:
@@ -22,6 +22,11 @@ class PowerStage(str, Enum):
|
||||
CONSERVE = "conserve"
|
||||
|
||||
|
||||
class ForecastKind(str, Enum):
|
||||
SOLAR = "solar"
|
||||
LOAD = "load"
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Observation:
|
||||
source: str
|
||||
@@ -80,3 +85,75 @@ class WeatherResolvedTruth:
|
||||
temperature_c: float | None
|
||||
shortwave_radiation_w_m2: float | None
|
||||
source: str
|
||||
cloud_cover_pct: float | None = None
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SigenPlantSnapshot:
|
||||
observed_at: datetime
|
||||
received_at: datetime
|
||||
source: str = "sigen_modbus"
|
||||
plant_epoch_seconds: int | None = None
|
||||
plant_ems_work_mode: int | None = None
|
||||
plant_running_state: int | None = None
|
||||
grid_sensor_status: int | None = None
|
||||
solar_power_w: float | None = None
|
||||
battery_soc_pct: float | None = None
|
||||
battery_soh_pct: float | None = None
|
||||
battery_power_w: float | None = None
|
||||
grid_power_w: float | None = None
|
||||
grid_import_w: float | None = None
|
||||
grid_export_w: float | None = None
|
||||
load_power_w: float | None = None
|
||||
plant_active_power_w: float | None = None
|
||||
accumulated_pv_energy_kwh: float | None = None
|
||||
daily_consumed_energy_kwh: float | None = None
|
||||
accumulated_consumed_energy_kwh: float | None = None
|
||||
raw_values: dict[str, int | float | str | bool | None] = field(default_factory=dict)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class PowerForecastPoint:
|
||||
target_at: datetime
|
||||
horizon_minutes: int
|
||||
expected_power_w: float
|
||||
p10_power_w: float
|
||||
p50_power_w: float
|
||||
p90_power_w: float
|
||||
confidence: float
|
||||
source: str
|
||||
model_version: str
|
||||
metadata: dict[str, Any] = field(default_factory=dict)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class PowerForecastRun:
|
||||
issued_at: datetime
|
||||
kind: ForecastKind
|
||||
source: str
|
||||
model_version: str
|
||||
points: list[PowerForecastPoint]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class NetPowerForecastPoint:
|
||||
target_at: datetime
|
||||
horizon_minutes: int
|
||||
expected_net_power_w: float
|
||||
safe_net_power_w: float
|
||||
p10_net_power_w: float
|
||||
p50_net_power_w: float
|
||||
p90_net_power_w: float
|
||||
solar_p50_power_w: float
|
||||
load_p50_power_w: float
|
||||
solar_p10_power_w: float
|
||||
solar_p90_power_w: float
|
||||
load_p10_power_w: float
|
||||
load_p90_power_w: float
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class NetPowerForecastRun:
|
||||
issued_at: datetime
|
||||
source: str
|
||||
points: list[NetPowerForecastPoint]
|
||||
|
||||
Reference in New Issue
Block a user