Feature Request: Use Actual SOC as Starting Point in Optimization
Problem
Currently, EMHASS uses the configured battery_minimum_state_of_charge and battery_maximum_state_of_chargevalues both as bounds and as hard limits for the initial SOC at the beginning of optimization.
This becomes problematic when the actual SOC is outside these limits — EMHASS assumes it’s at battery_minimum_state_of_charge or battery_maximum_state_of_charge, rather than using the true SOC from the battery.
Why this matters
In setups where EMHASS isn’t the only controller for the battery, this behavior results in incorrect forecasts and potentially suboptimal scheduling decisions.
Example use case
I use EMHASS to optimize my battery within the range of 30%–80% SOC. However, I’m also participating in the MFFR (Manual Frequency Restoration Reserve) market via Qilowatt/Kratt. These signals override EMHASS control:
-
MFFR UP events may discharge the battery below 30% (e.g., down to 5%)
-
MFFR DOWN events may charge the battery up to 100%
This is intentional — I want to reserve 0–30% for UP and 80–100% for DOWN commands.
But when this happens, EMHASS ignores the actual SOC and treats it as 30% or 80%, leading to an incorrect optimization baseline.
Visual Example
See attached chart:

You can clearly see that EMHASS assumes the SOC is at 30% when in reality it’s closer to 5%.
Desired Behavior
-
EMHASS should always use the real actual SOC from the sensor as the starting point for optimization — even if it’s outside the configured min/max SOC bounds.
-
The battery_minimum_state_of_charge and battery_maximum_state_of_charge should still be enforced as constraints on the future steps, but not as assumptions about the starting point.
Why this change is important
This improvement benefits all users who:
-
Manually charge or discharge the battery (e.g. for testing or off-grid prep)
-
Participate in demand response programs (MFFR, FFR, etc.)
-
Use multiple automation layers (Node-RED, scripts, manual control, etc.)
-
Experience unexpected SOC drift (e.g. from grid outages or power failures)
Suggested Implementation
-
Read the current SOC from the sensor, even if it’s below battery_minimum_state_of_charge or above battery_maximum_state_of_charge
-
If the initial SOC is out of bounds:
-
Use it as-is
-
Optionally log a warning
-
Only apply battery_minimum_state_of_charge and battery_maximum_state_of_charge as constraints within the optimization horizon
-
(Optional) Introduce a new setting, e.g.:
use_real_soc_as_initial: true
to allow opting out of this behavior if needed.
Feature Request: Use Actual SOC as Starting Point in Optimization
Problem
Currently, EMHASS uses the configured battery_minimum_state_of_charge and battery_maximum_state_of_chargevalues both as bounds and as hard limits for the initial SOC at the beginning of optimization.
This becomes problematic when the actual SOC is outside these limits — EMHASS assumes it’s at battery_minimum_state_of_charge or battery_maximum_state_of_charge, rather than using the true SOC from the battery.
Why this matters
In setups where EMHASS isn’t the only controller for the battery, this behavior results in incorrect forecasts and potentially suboptimal scheduling decisions.
Example use case
I use EMHASS to optimize my battery within the range of 30%–80% SOC. However, I’m also participating in the MFFR (Manual Frequency Restoration Reserve) market via Qilowatt/Kratt. These signals override EMHASS control:
MFFR UP events may discharge the battery below 30% (e.g., down to 5%)
MFFR DOWN events may charge the battery up to 100%
This is intentional — I want to reserve 0–30% for UP and 80–100% for DOWN commands.
But when this happens, EMHASS ignores the actual SOC and treats it as 30% or 80%, leading to an incorrect optimization baseline.
Visual Example
See attached chart:

Green: actual SOC
Red: forecast history
Blue: forecast going forward
You can clearly see that EMHASS assumes the SOC is at 30% when in reality it’s closer to 5%.
Desired Behavior
EMHASS should always use the real actual SOC from the sensor as the starting point for optimization — even if it’s outside the configured min/max SOC bounds.
The battery_minimum_state_of_charge and battery_maximum_state_of_charge should still be enforced as constraints on the future steps, but not as assumptions about the starting point.
Why this change is important
This improvement benefits all users who:
Manually charge or discharge the battery (e.g. for testing or off-grid prep)
Participate in demand response programs (MFFR, FFR, etc.)
Use multiple automation layers (Node-RED, scripts, manual control, etc.)
Experience unexpected SOC drift (e.g. from grid outages or power failures)
Suggested Implementation
Read the current SOC from the sensor, even if it’s below battery_minimum_state_of_charge or above battery_maximum_state_of_charge
If the initial SOC is out of bounds:
Use it as-is
Optionally log a warning
Only apply battery_minimum_state_of_charge and battery_maximum_state_of_charge as constraints within the optimization horizon
(Optional) Introduce a new setting, e.g.:
use_real_soc_as_initial: true
to allow opting out of this behavior if needed.