pvsyst_create_peak_shaving_variant
Creates a new PVsyst variant that switches native PeakShaving discharge to AfterSunset or an hour window, with dry-run preview and no source edits.
Instructions
[Loads & Storage] Preview or create a NEW variant that switches the native PeakShaving discharge strategy. Supported subset is the already-active native 8.1.6 PeakShaving profile: root Flags=$00080000 with no pvLoad, pvSystem Flags=$17000040/Grid plus the pinned battery hardware and temperature profile, and one directly owned pvGridStorage record holding Strategy=PeakShaving and ChargingStrategy=PVToGridMin. Stored SOC, AC power limits and efficiencies use the shared storage semantic validator, so valid scalar edits remain editable here instead of requiring the original sample's numeric constants. Pinned hardware/system limits remain unchanged; no sizing or dispatch model is offered. mode is the explicit discriminator: after_sunset writes DischStrategy=AfterSunset and drops HourBegDisch/HourEndDisch; hour_window writes DischStrategy=MinMaxHour and exactly two bare-integer hour endpoints that differ. Hour values are adapter-bounded to 0..23 and are not measured native GUI limits; the source record is checked against the same domain, so a saved NaN, fractional or unknown value stops instead of being overwritten. Only those three fields change: strategy, charging strategy, SOC, power limits, efficiencies, grid limit, root/system flags, battery hardware, geometry, loads and the orientation records stay at their verified values, and every other owning field set is compared exactly so unknown, nested or duplicated fields stop. A source with a load, P50/P90, saved horizon, explicit 3D scene or module layout is blocked. dry_run=true writes nothing; execution creates one NEW VC only and never edits the source PRJ/VC or its inputs, reusing existing store locking, path checks, read-back verification and no-overwrite semantics. variant_name/add_utf8_bom follow the existing display-name and BOM rules. native_consumption_verified stays false: hours are native hour slots only, endpoint inclusivity is not inferred, AfterSunset does not mean discharging solely in hours without irradiance, and creating this variant does not prove that this run consumes it. This tool never changes the grid power limitation or power factor; the pinned PLimGrid/PGridLim 200 belongs to this native profile only, and the profile's grid power limitation is apparent power in the native report, not an active-power edit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | ||
| project | Yes | ||
| discharge | Yes | ||
| new_variant | Yes | ||
| add_utf8_bom | No | ||
| variant_name | No | ||
| source_variant | Yes |