diff --git a/csharp/App/SaliMax/src/Ess/Controller.cs b/csharp/App/SaliMax/src/Ess/Controller.cs index 5efacd03e..befeed857 100644 --- a/csharp/App/SaliMax/src/Ess/Controller.cs +++ b/csharp/App/SaliMax/src/Ess/Controller.cs @@ -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 {