<br>
# Optimize Self-Consumption -> Hold min SOC 

Initial State: `Optimize Self-Consumption`  
Target State:  `Hold min SOC`  

## Test Procedure

1. The system is brought to the `Optimize Self-Consumption` state by setting `Min SOC` lower than the current SOC (min. 5% lower)
2. `Min SOC` should not be lower than 10%
3. A production deficit is simulated by setting `Grid setpoint` to a negative value (-2000W)
4. Wait until the `SOC` stabilizes slightly above `Min SOC` 

## Expected Outcome

- The system first discharges the battery with 2000W.
- Somewhere between `Min SOC + 1%` and `Min SOC + 4%` the system changes into the `Hold min SOC` state.
- Once in this state, discharging is continuously throttled until it reaches 0W somewhere between `Min SOC + 0.1 %` and `Min SOC + 0.5 %`
- The system then starts to charge with low power (<300W) in order to compensate for thermal energy loss.
- The `SOC` stabilizes between `Min SOC` and `Min SOC + 0.5 %`
- The `SOC` does not fluctuate by more than 0.1% once it has stabilized
- Charging power does not fluctuate by more than 250W once it has stabilized


## Tested Outcome

The system reacted as expected and switched to `Hold min SOC` state once the SOC reached `Min SOC + 4%`. Once the state changed to  
`Hold min SOC`, the discharging power is throttled for around 40 minutes, where it then reached 0W at `Min SOC + 1 %`. When stabilized  
the system charges with low power (<75W) to compensate thermal losses. The fluctuations are within +/-50W range.

![Optimize Self-Consumption -> Hold min SOC](Test5.png)