Complete reference for Solar Energy Management (SEM).
- Configuration Options
- Charging Modes
- SOC Zone Strategy
- Night Charging
- Battery Discharge Protection
- Surplus Distribution
- Peak Load Management
- Tariff Integration
- Solar Forecast
- Observer Mode
- Sensors Reference
- Daily Energy Reset
All settings are accessible via Settings > Devices & Services > Solar Energy Management > Configure.
| Setting | Description |
|---|---|
ev_connected_sensor |
Binary sensor — is the EV plugged in? |
ev_charging_sensor |
Binary sensor — is charging active? |
ev_charging_power_sensor |
Power sensor (W) — current charging power |
ev_charger_service |
HA service to set current (e.g., keba.set_current) |
ev_charger_service_entity_id |
Entity ID passed to the charger service |
ev_current_sensor |
Current sensor (A) — optional, for actual amperage |
ev_session_energy_sensor |
Session energy (kWh) — optional |
ev_total_energy_sensor |
Cumulative energy (kWh) — optional |
| Setting | Default | Description |
|---|---|---|
update_interval |
10s | Control loop frequency (10-300s) |
power_delta |
— | Minimum power change to trigger update (50-3000W) |
current_delta |
— | Minimum current change threshold (1-10A) |
soc_delta |
— | Battery SOC change sensitivity (1-20%) |
daily_ev_target |
10 kWh | Target daily EV energy from night charging (5-100 kWh) |
min_solar_power |
500W | Config floor below which SEM won't even attempt to start the charger. Keep well below the hardware minimum of your charger (~4140 W on 3-phase, ~1380 W on 1-phase). Slider range 0–5000 W. |
max_grid_import |
— | Maximum grid import power during solar charging (0-2000W) |
ev_charging_mode |
pv |
Charging mode: pv (solar only), minpv (Min+PV), off (disabled) |
ev_ramp_rate_amps |
2 | Max current change per 10s cycle during solar charging |
| Setting | Default | Description |
|---|---|---|
battery_priority_soc |
30% | Below: all solar to battery, EV blocked |
battery_minimum_soc |
— | Absolute minimum discharge floor |
battery_resume_soc |
— | Hysteresis resume threshold |
battery_buffer_soc |
70% | Above: battery can discharge for EV |
battery_auto_start_soc |
90% | Above: start EV even without surplus |
battery_assist_max_power |
4500W | Maximum battery discharge for EV (1000-10000W) |
battery_capacity_kwh |
— | Total battery capacity (5-100 kWh) |
battery_discharge_protection_enabled |
true | Protect battery during night charging |
battery_max_discharge_power |
5000W | Maximum battery discharge rate (500-10000W) |
battery_discharge_control_entity |
— | Number entity to control inverter discharge limit |
| Setting | Default | Description |
|---|---|---|
enable_keba_notifications |
true | Show status on KEBA display |
enable_mobile_notifications |
false | Send push notifications |
mobile_notification_service |
— | Which notify service to use |
| Setting | Default | Description |
|---|---|---|
load_management_enabled |
false | Enable peak load management |
target_peak_limit |
5 kW | Target peak power limit (1-15 kW) |
warning_peak_level |
— | Warning threshold (1-15 kW) |
emergency_peak_level |
— | Emergency shedding threshold (1-20 kW) |
critical_device_protection |
— | Protect critical loads from shedding |
| Setting | Default | Description |
|---|---|---|
observer_mode |
false | Read-only mode — no hardware control |
forecast_night_reduction |
false | Reduce night target based on solar forecast |
daily_home_consumption_estimate |
18 kWh | Fallback for first 7 days of month |
SEM supports three EV charging modes, configured via ev_charging_mode:
The EV charges only from solar surplus. SEM calculates available power every 10 seconds and adjusts the charging current accordingly (6-32A range).
- If surplus is below the minimum threshold (~4140W for 3-phase at 6A), charging pauses
- Current changes are ramp-limited (default +-2A per cycle) to avoid oscillation
- evcc-style enable/disable delays prevent rapid on/off cycling
Guarantees a minimum charging current (6A) from the grid and adds any solar surplus on top.
- The EV always charges at least at 6A, even without sun
- Solar surplus increases the current above 6A
- No enable delay — charging starts immediately when the EV connects
- Use this when you need the car charged by a specific time
EV charging is disabled. SEM continues monitoring but does not control the charger.
SEM uses a four-zone model to decide how the battery and EV share solar energy. The battery's state of charge (SOC) determines which zone is active:
SOC 100% ─────────────────────────────
│ Zone 4: FULL ASSIST │ Battery always helps EV
SOC 90% ─── battery_auto_start_soc ──
│ Zone 3: DISCHARGE ASSIST │ Battery gradually helps EV
SOC 70% ─── battery_buffer_soc ──────
│ Zone 2: SURPLUS ONLY │ EV gets solar surplus only
SOC 30% ─── battery_priority_soc ────
│ Zone 1: BATTERY PRIORITY │ All solar → battery, EV waits
SOC 0% ─────────────────────────────
All solar production goes to the battery. The EV is blocked entirely — the battery needs to reach a usable level first.
The EV receives only pure solar surplus — power that would otherwise be exported. The battery continues charging normally and is never discharged to help the EV. If surplus is below the charger's minimum (~4140W on 3-phase), the EV waits.
The battery begins discharging to supplement solar for the EV. The assist power scales linearly: 50% of max at SOC 70%, up to 100% at SOC 90%. Combined with solar surplus, this often pushes the EV above its minimum charging threshold.
Full battery assist (default 4500W). The EV starts charging even without solar surplus — the battery alone can push the EV above its minimum threshold.
Once battery-assist mode activates (Zone 3 or 4), it stays active even if SOC drops back into Zone 2, all the way down to battery_assist_floor_soc (default 60%). This prevents on/off cycling when the SOC hovers near a zone boundary.
- SOC 30-69% — Battery charges from solar. EV waits (surplus usually below 4140W minimum)
- SOC hits 70% — Battery assist kicks in (~2250W). Combined with surplus, EV may start charging
- SOC hits 90% — Full 4500W battery assist. EV charges near maximum
- SOC drops below 70% — Hysteresis keeps assist active (EV still charging)
- SOC drops below 60% — Assist stops. EV falls back to solar-only surplus
- Conservative setup — Set
battery_priority_socto 70% to ensure the battery is nearly full before the EV gets anything. Good if you have high evening self-consumption. - Aggressive EV charging — Lower
battery_priority_socto 20% andbattery_buffer_socto 50% to start EV charging earlier. - Small battery — Reduce
battery_assist_max_powerto avoid draining a small battery too quickly.
Night charging starts automatically when night mode activates (after sunset + 10 minutes, or 20:30, whichever comes first).
- SEM starts the charger at 10A
- Each 10s cycle, SEM adjusts current (+-2A ramp, minimum 8A floor) based on peak load management
- SEM tracks remaining energy via the daily EV counter
- Charging stops when the daily EV target is reached (default 10 kWh)
The daily EV target uses sunrise-based reset — the counter resets at sunrise, not midnight. This means a night charging session from 22:00 to 06:00 stays in a single daily bucket.
When switch.sem_forecast_night_reduction is ON, SEM reduces the night target based on expected solar production the next day:
- Weekday: conservative reduction (car leaves ~17:00, only 20% of surplus expected)
- Weekend: aggressive reduction (car connected all day, 70% of surplus expected)
- Summer: can reduce night target to 0 if solar covers everything
During night charging, the home battery should only power home consumption — not the EV. SEM enforces this by setting the inverter's discharge limit to match real-time home consumption.
- Updated every 10 seconds to track actual home load
- 100W hysteresis to avoid frequent changes
- Full discharge capability restored when night charging ends or EV disconnects
- Requires a Huawei Solar inverter (or compatible) with a
numberentity for discharge limit control
Every device registered in SEM has a control mode that determines how SEM is allowed to interact with it. This is the most important setting for each device — it defines the boundary between what SEM controls and what the user controls.
| Mode | SEM turns ON? | SEM turns OFF (peak)? | Use case |
|---|---|---|---|
| off | Never | Never | Monitoring only (coffee machine, lights you don't want managed) |
| peak_only | Never | Yes, when peak limit reached | Devices that should stay under user control, but SEM can shed to protect the grid limit (towel heaters, general appliances) |
| surplus | Yes, when solar surplus available | Yes, when surplus drops or peak limit reached | Devices you want SEM to actively control based on solar (hot water heater, pool pump) |
Default for all devices: peak_only — SEM will never proactively turn on a device unless you explicitly set it to surplus mode.
Use the solar_energy_management.update_device_config service:
service: solar_energy_management.update_device_config
data:
device_id: energy_dashboard_heizband
property: control_mode
value: surplusThe mode is persisted across restarts.
EV charging is managed separately by the coordinator's dedicated EV control system (not by the surplus controller). The EV charger's control mode setting does not affect EV charging behavior.
SEM distributes solar surplus across devices that are in surplus mode by priority (1 = highest, 10 = lowest):
- Read available surplus (solar - home - battery charge)
- Subtract regulation offset (default 50W export buffer)
- Iterate surplus-mode devices by priority
- Activate if surplus >= device minimum power
- Variable-power devices get proportional allocation
- When surplus drops: LIFO (lowest priority first) deactivation
Devices in peak_only or off mode are never activated by the surplus controller. They can only be shed by peak load management.
When using dynamic tariffs (Tibber, Nordpool, aWATTar), surplus distribution becomes price-aware: during cheap or negative price periods, SEM adds virtual surplus to encourage activation of surplus-mode devices.
SEM monitors rolling 15-minute average power and progressively sheds loads to stay under your target peak limit. Only devices in peak_only or surplus mode can be shed. Devices in off mode are never touched.
| State | Behavior |
|---|---|
| Normal | No action — all devices run freely |
| Warning | Alert — approaching peak limit |
| Shedding | Automatic device shedding by reverse priority |
| Emergency | All non-critical loads shed immediately |
When the peak drops back below the target, SEM restores devices only if they were ON before shedding. Devices that were already off are not turned on.
Enable via integration options. Requires controllable devices with switch entities.
Configure a single fixed import/export rate. SEM uses this for cost tracking.
Connect Tibber, Nordpool, or aWATTar for real-time pricing. SEM automatically:
- Enables price-responsive surplus distribution
- Identifies cheap/expensive price windows
- Creates
sensor.sem_tariff_price_level(cheap / normal / expensive) - Creates
sensor.sem_tariff_next_cheap_startfor automation triggers
Install Solcast PV Solar or Forecast.Solar for forecast-based features:
sensor.sem_forecast_today_kwh— expected total production today (kWh)sensor.sem_forecast_tomorrow_kwh— expected total production tomorrow (kWh)sensor.sem_forecast_remaining_today_kwh— expected remaining production today (kWh)sensor.sem_charging_recommendation— suggested charging strategy- Forecast-based night target reduction
- Smart battery redirect decisions in the flow calculator
When running two HA instances against the same hardware (e.g., prod + test), enable Observer Mode on the test instance.
SEM continues to:
- Read all sensors
- Calculate energy, flows, costs
- Update all sensor entities
SEM skips:
- All charger service calls
- Battery discharge limit changes
- Device shedding commands
Enable via Settings > Devices & Services > Solar Energy Management > Configure > Observer Mode, or via switch.sem_observer_mode.
sensor.sem_solar_power— current solar productionsensor.sem_grid_power— grid export (positive) / import (negative). Same convention SEM uses internally and reads from Huaweipower_meter_wirkleistung. NOT the HA Energy Dashboard convention.sensor.sem_battery_power— battery charge (positive) / discharge (negative). Pass-through from the source inverter sensor.sensor.sem_grid_import_power— always ≥ 0, derived fromgrid_powersensor.sem_grid_export_power— always ≥ 0, derived fromgrid_powersensor.sem_ev_power— current EV charging powersensor.sem_home_consumption_power— total home power draw (excludes EV)
sensor.sem_daily_solar_energy— today's solar productionsensor.sem_daily_grid_import_energy— today's grid importsensor.sem_daily_grid_export_energy— today's grid exportsensor.sem_daily_ev_energy— today's EV charging energysensor.sem_monthly_*— monthly equivalents
sensor.sem_flow_solar_to_home_power— solar power used by homesensor.sem_flow_solar_to_ev_power— solar power to EVsensor.sem_flow_solar_to_battery_power— solar power to batterysensor.sem_flow_grid_to_ev_power— grid power to EVsensor.sem_flow_battery_to_home_power— battery power to home
sensor.sem_daily_costs— today's grid import costsensor.sem_daily_export_revenue— today's feed-in revenuesensor.sem_daily_savings— today's solar savingssensor.sem_monthly_*— monthly equivalents
sensor.sem_self_consumption_rate— % of solar used locallysensor.sem_autarky_rate— % of consumption from solar+batterysensor.sem_pv_performance_vs_forecast— actual yield vs Solcast/Forecast.Solar predictionsensor.sem_pv_daily_specific_yield— kWh per kWp installedsensor.sem_pv_estimated_annual_degradation— long-term PV health
sensor.sem_charging_state— current charging statesensor.sem_charging_strategy— active strategy (solar_only, battery_assist, etc.)sensor.sem_available_power— power available for EV (W)sensor.sem_calculated_current— target charging current (A)sensor.sem_session_energy— current/last session energy (kWh)sensor.sem_session_solar_share— % of session energy from solarsensor.sem_session_cost— current/last session costsensor.sem_session_duration— session duration (min)
sensor.sem_forecast_today_kwh— today's forecast (kWh)sensor.sem_forecast_tomorrow_kwh— tomorrow's forecast (kWh)sensor.sem_forecast_remaining_today_kwh— remaining today (kWh)sensor.sem_charging_recommendation— suggested strategy
sensor.sem_peak_margin— headroom before peak limit (kW)sensor.sem_consecutive_peak_15min— rolling 15-min average power (kW)sensor.sem_loads_currently_shed— number of devices currently shed
SEM resets daily energy counters at sunrise, not midnight. This is intentional:
- Night charging sessions (22:00-06:00) stay in a single daily bucket
- Monthly totals derive from sunrise-based dates
- This may not align with utility billing periods that reset at midnight
The sunrise time comes from HA's sun.sun entity (fallback: 06:00 if unavailable).



