Background
I am using Predbat with a Huawei inverter and a ~10 kWh home battery.
I also have one EV connected to Predbat. The EV is normally charged through Home Assistant and I want to use Predbat for the energy planning.
My intended behaviour is:
PV surplus should be used for the EV whenever possible.
When there is insufficient PV, I do not want the home battery to discharge into the EV.
I am fine with the EV taking power from the grid when there is insufficient PV.
However, I would like this behaviour to be conditional on the EV SOC. For example, if the EV is below 30% SOC, I may want grid charging to continue, but above 30% I would rather wait for PV/cheap charging opportunities.
I am therefore trying to understand whether this can be configured within Predbat, rather than building all EV charging logic externally in Home Assistant.
Problem
At the moment, when the EV is charging, Predbat reports:
Info: record_status Hold for car
Info: Completed run status Hold for car
and:
Disabling battery discharge whilst car 0 is charging
Car charging from battery is off, next slot for car 0 is 08-17 18:25:00 - 08-17 18:30:00
The relevant inverter state at that moment was:
Inverter 0 SoC: 9.59kW 99%, current charge rate 4400W, current discharge rate 0W, current battery power 0W, current battery voltage 52.0V, grid power 0W, load power 2407W, PV Power 589W
So the battery was at 99% SOC, PV production was only 589 W, and the house load was 2407 W.
The EV was charging at approximately 1.43 kW according to:
Dynamic load last period 1.43kW, status low, threshold_battery 4.4kWh, threshold_car 6.0kWh
Predbat then explicitly disabled battery discharge:
Disabling battery discharge whilst car 0 is charging
followed by:
Completed run status Hold for car
The plan also says:
Your car is currently charging.
The battery is currently at 99% and is in eco mode for the next 1 and a quarter hours.
Why I am asking
I understand why Predbat prevents the battery from discharging into the EV when car_charging_from_battery is disabled.
However, in this situation I am not sure this is the behaviour I actually want.
The battery is at 99%, PV is almost gone, and the EV is charging. Instead of using the available battery energy, Predbat effectively leaves the battery idle and the EV/home load is supplied from the grid.
I would like to control this more intelligently.
For example:
Case A — EV SOC < 30%
Allow grid charging, even when there is no PV, because I consider getting the EV above 30% a priority.
Case B — EV SOC >= 30%
Prefer PV surplus. If PV is insufficient, do not discharge the home battery into the EV and potentially wait for a cheaper charging slot.
Ideally I would like Predbat to make this decision dynamically based on:
EV SOC
PV surplus
current home battery SOC
import price
possibly a minimum EV SOC
possibly a configurable EV charging price threshold
Questions
Is Hold for car expected behaviour in this situation?
Is switch.predbat_car_charging_from_battery the correct setting controlling this behaviour?
Is there a Predbat parameter that allows me to define a minimum EV SOC before grid charging is allowed?
Could this be achieved by changing the effective EV charging/import price used by Predbat?
Would something like an EV charging threshold (for example, only consider grid charging attractive below 30% EV SOC) be a better approach?
Is there an existing Predbat configuration pattern for PV-first EV charging + conditional grid charging based on EV SOC?
If Predbat is not intended to handle this logic, what is the recommended way to implement it in Home Assistant?
Home Assistant automation
If this is better handled outside Predbat, I would also appreciate an example architecture for HA.
For example, would the recommended approach be:
Predbat
↓
determines cheap charging slots
↓
binary_sensor.predbat_car_charging_slot
↓
Home Assistant automation
↓
EV charger start/stop
with additional HA conditions such as:
EV SOC < 30%
AND
PV surplus insufficient
AND
import price < X
while ensuring that the home battery is not discharged into the EV?
I am particularly interested in the recommended way to combine Predbat's charging slots with my own HA automation, rather than fighting Predbat's internal car-charging logic.
The current Predbat documentation mentions car_charging_soc, car_charging_planned, car_charging_from_battery and binary_sensor.predbat_car_charging_slot, so I would like to understand which of these should be used for this type of setup.
Background
I am using Predbat with a Huawei inverter and a ~10 kWh home battery.
I also have one EV connected to Predbat. The EV is normally charged through Home Assistant and I want to use Predbat for the energy planning.
My intended behaviour is:
PV surplus should be used for the EV whenever possible.
When there is insufficient PV, I do not want the home battery to discharge into the EV.
I am fine with the EV taking power from the grid when there is insufficient PV.
However, I would like this behaviour to be conditional on the EV SOC. For example, if the EV is below 30% SOC, I may want grid charging to continue, but above 30% I would rather wait for PV/cheap charging opportunities.
I am therefore trying to understand whether this can be configured within Predbat, rather than building all EV charging logic externally in Home Assistant.
Problem
At the moment, when the EV is charging, Predbat reports:
Info: record_status Hold for car
Info: Completed run status Hold for car
and:
Disabling battery discharge whilst car 0 is charging
Car charging from battery is off, next slot for car 0 is 08-17 18:25:00 - 08-17 18:30:00
The relevant inverter state at that moment was:
Inverter 0 SoC: 9.59kW 99%, current charge rate 4400W, current discharge rate 0W, current battery power 0W, current battery voltage 52.0V, grid power 0W, load power 2407W, PV Power 589W
So the battery was at 99% SOC, PV production was only 589 W, and the house load was 2407 W.
The EV was charging at approximately 1.43 kW according to:
Dynamic load last period 1.43kW, status low, threshold_battery 4.4kWh, threshold_car 6.0kWh
Predbat then explicitly disabled battery discharge:
Disabling battery discharge whilst car 0 is charging
followed by:
Completed run status Hold for car
The plan also says:
Your car is currently charging.
The battery is currently at 99% and is in eco mode for the next 1 and a quarter hours.
Why I am asking
I understand why Predbat prevents the battery from discharging into the EV when car_charging_from_battery is disabled.
However, in this situation I am not sure this is the behaviour I actually want.
The battery is at 99%, PV is almost gone, and the EV is charging. Instead of using the available battery energy, Predbat effectively leaves the battery idle and the EV/home load is supplied from the grid.
I would like to control this more intelligently.
For example:
Case A — EV SOC < 30%
Allow grid charging, even when there is no PV, because I consider getting the EV above 30% a priority.
Case B — EV SOC >= 30%
Prefer PV surplus. If PV is insufficient, do not discharge the home battery into the EV and potentially wait for a cheaper charging slot.
Ideally I would like Predbat to make this decision dynamically based on:
EV SOC
PV surplus
current home battery SOC
import price
possibly a minimum EV SOC
possibly a configurable EV charging price threshold
Questions
Is Hold for car expected behaviour in this situation?
Is switch.predbat_car_charging_from_battery the correct setting controlling this behaviour?
Is there a Predbat parameter that allows me to define a minimum EV SOC before grid charging is allowed?
Could this be achieved by changing the effective EV charging/import price used by Predbat?
Would something like an EV charging threshold (for example, only consider grid charging attractive below 30% EV SOC) be a better approach?
Is there an existing Predbat configuration pattern for PV-first EV charging + conditional grid charging based on EV SOC?
If Predbat is not intended to handle this logic, what is the recommended way to implement it in Home Assistant?
Home Assistant automation
If this is better handled outside Predbat, I would also appreciate an example architecture for HA.
For example, would the recommended approach be:
Predbat
↓
determines cheap charging slots
↓
binary_sensor.predbat_car_charging_slot
↓
Home Assistant automation
↓
EV charger start/stop
with additional HA conditions such as:
EV SOC < 30%
AND
PV surplus insufficient
AND
import price < X
while ensuring that the home battery is not discharged into the EV?
I am particularly interested in the recommended way to combine Predbat's charging slots with my own HA automation, rather than fighting Predbat's internal car-charging logic.
The current Predbat documentation mentions car_charging_soc, car_charging_planned, car_charging_from_battery and binary_sensor.predbat_car_charging_slot, so I would like to understand which of these should be used for this type of setup.