delete not needed and added off grid mode.

This commit is contained in:
atef 2024-08-05 08:44:10 +02:00
parent cce3a6f9bd
commit b2655fd156
1 changed files with 13 additions and 2 deletions

View File

@ -10,7 +10,6 @@ namespace InnovEnergy.App.SaliMax.Ess;
public static class Controller
{
private static readonly Double BatteryHeatingPower = 200.0; // TODO: move to config
private static Boolean _hasAdditionalCalibrationChargeChecked = false;
private static Boolean _hasRepetitiveCalibrationChargeChecked = false;
private static DateTime _nextDayAt10Am = DateTime.Now;
@ -31,11 +30,23 @@ public static class Controller
{
var mode = s.SelectControlMode().WriteLine();
if (mode is EssMode.Off)
if (mode is EssMode.Off) // to test on prototype
{
if (s.StateMachine.State == 28 )
{
return new EssControl
{
LimitedBy = EssLimit.NoLimit,
Mode = EssMode.OffGrid,
PowerCorrection = 0,
PowerSetpoint = 0
};
}
return EssControl.Default;
}
// if we have no reading from the Grid meter, but we have a grid power (K1 is close),
// then we do only heat the battery to avoid discharging the battery and the oscillation between reach min soc and off mode
if (mode is EssMode.NoGridMeter)
return new EssControl
{