I want to implement an automation to controll the charging of an EV.
The EV does not provide a setting for the max. SoC of the battery… so it will always charge to 100%…
my automation should stop charging, when the SoC reached a configured percentage.
This percentage will be defined within an input_number helper.
So basically, the automation should be like:
if device.Wallbox is charging
conditions:
if selected vehicle is A
AND
SOC is Above state(‘input_number.A_charge_limitation’)
how could this be done?
I can’t use the value of a sensor / helper in the ABOVE setting of the device / entity I am using to get the current SoC of the vehicle.
What does the automation do? I’d have thought you want one automation to turn charging on, and one to turn it off.
Sounds like you’re thinking of an automation as something that is continually running whilst the charger is active — that’s not a good way to build them. Think of them as triggering off an event happening, evaluating some conditions, doing something then finishing.
Trigger on SoC going over your threshold value, check the wall charger is charging that vehicle, turn charger off.
Something like this, with entity IDs invented as you haven’t supplied them:
alias: Turn charger off at SoC threshold
triggers:
- trigger: numeric_state
entity_id: sensor.car_a_soc
above: input_number.soc_limit
conditions:
- condition: state
entity_id: binary_sensor.wallbox_charging
state: 'on'
- condition: state
entity_id: sensor.charging_car
state: "A"
actions:
- action: switch.turn_off
target:
entity_id: switch.charger
The charging will start automatically, but it should stop, when the ev soc reached the value defined in the helper.
Unfortunately, the Integration / Car does not provide this by default, so I wanted to build that around the given options.
helper “input_number.ev_soc_limitation” => f.e. 80%
if the wallbox is charing, check if current SoC is below the value of the helper.
If current SoC is equal (or higher) than the value of the helper, set the wallbox to “stop”