Load balancing current to EV-charger

no still geting extra keys not allowed @ data[‘trigger’]

is it written as an automation or script?

it is workig good now as a automtion an not a script

It is automation. Glad you have it working now.

Hi, Thanks for your automation, this works great !

I’ll have to make some adjustments for my needs, as I’ve got a Hyundai Kona and a Renault Zoé, the first charges on a single phase, and the second on 3 phases, so I want the Kona to be alble to take the maximum curent the breaker allowes : 30A, and adjust charge current depending on the load on the L1 phase.
For the Zoé, I’d like to take advantage of the maximum wattage my energy subscription can provide : 18 KVA, so 26 Amps max on each phase, and adjust current depending on the charge on any phase … I’ll try to figure out something and will post here if I find anything usefull, but with your base it should be pretty easy.

Hi all,

I’m trying to get this automation work.
Unfortunately I get an error message.

First of all: within the developer tab and actions I can change the current during charging.

Is there a code specialist :wink: who could help me?

#############################################################

I use the original code and in bolt the entities which need to be changed.
The Easee charger doesn’t have a number entitie…
Maybe: (easee.set_circuit_dynamic_limit) but that one doesn’t work…

The picture below shows within the developer which works when click on execute:

So which entity_id I have to use? for the number.go_echarger_XXXXX_am
In the code below I use ZZZZZZZZZZZZZZZZZZZZZZ for the entitie above

The lay-out isn’t perfect but thats not the problem

#############################################################

alias: LoadBalancing auto
description: Control EV charger amps to avoid overcurrent
triggers:
  - entity_id:
      - sensor.electricity_meter_current_phase_l1
      - sensor.electricity_meter_current_phase_l2
      - sensor.electricity_meter_current_phase_l3
    trigger: state
conditions:
  - condition: state
    entity_id: sensor.go_echarger_XXXXXX_car (*sensor.ehxhdwww_status*)
    state: charging
    enabled: true
actions:
  - data:
      value: >
        {% set min_charge_current = 6 %} {% set max_charge_current = 16 %} {%
        set max_total_current = 25 %}

        {% set c1 = states('sensor.electricity_meter_current_phase_l1')|float %}
        {% set c2 = states('sensor.electricity_meter_current_phase_l2')|float %}
        {% set c3 = states('sensor.electricity_meter_current_phase_l3')|float %}
        {% set measured_current = [c1, c2, c3] | select('is_number') |
        map('float') | max | default(none) %}

        {% set current_charger_setting =
        states(*'ZZZZZZZZZZZZZZZZZZZZZZ*')|float %} 

        {% set new_current = max_total_current - measured_current +
        current_charger_setting %} {% if new_current > max_charge_current %}
          {% set new_current = max_charge_current %}
        {% endif %} {% if new_current < min_charge_current %}
          {% set new_current = min_charge_current %}
        {% endif %}

        {{ new_current|round(0, 'floor') }}
    target:
      entity_id: *ZZZZZZZZZZZZZZZZZZZZZZ* 
    action: number.set_value
mode: single
max: 3

I’ve been building a small project on the side to universally tackle this problem, basically a “universal EV charger load balancer”. I’m currently using it myself to control my Easee Charger Lite via Home Assistant, based on DSMR data already collected by HASS. It’s still in very very early testing, but the idea is to support more chargers and energy input sources over time.

I came across this thread and noticed there are quite a few people here, like me, who either don’t want to use off-the-shelf solutions like the Easee Equalizer (or other vendor product), or simply can’t for one reason or another.

Some of the things I’m aiming for:

  • Load balancing between multiple chargers, regardless of brand
  • (Smart) Phase control
  • Better self-consumption of solar, if preferred
  • Support for dynamic pricing to charge when it’s cheap

Right now it’s just me testing it, as I just finished up the rough scaffold, but I’d love to hear from others who might want to try it or share what kind of features and setups they’d need. The more input, the better.

Anyone interested in testing along and sharing some feedback as well as their use-cases? The repository can be found here: GitHub - dirkgroenen/hass-evse-load-balancer: Adjusts your EV Charger's current using existing sensors - no vendor lock-in, no extra devices., but feel free to DM or email me as well.

1 Like