Alfen Eve Single-Pro EV chargepoint controller via Node-Red

A while ago I wanted to have more control over my Alfen ChargePoint.
The firmware didn’t allow charging with ‘solar only’, and there was no ‘power-charge’ mode, to force hi-power charging if needed.

Then I stumbled on the topic from @hollie who started the same a while ago. : https://community.home-assistant.io/t/alfen-eve-pro-ev-chargepoint-interface-via-tcp-modbus
So if you’re more into scripts & automation, please check that topic !

Starting from his project, and the replies on that, I wanted to implement this fully in Node-Red.
In my case, I’m using 1fase 230V 32A charging (max 7.4kW)

What is needed :

  • A switch, for enabling power-charging : input_boolean.power_charge
  • Max powercharge current : input_number.max_powercharge_current : (0…32A) defines the max total current that can be drawn from the net during charge
  • Car Charge Ampere : input_number.car_charger_ampere : (in my case 5…30A) the values that are valid for sending to the chargepoint

Why 5A? when it’s below 6A but not 0A, the car won’t charge, but will stay ‘active’ and just pause the charging process.

in your configuration.yaml, you need to add the modbus part, and a template to make the chargepoint levels readable (credits @hollie )

template:
  - sensor:
      - name: mode3_sanitized
        state: "{{states('sensor.laadpaal_mode3_state').replace('\0','') }}"
      - name: chargepoint_status
        state: >
          {% set m3 = states('sensor.mode3_sanitized') %}
          {% if m3 in ['A', 'E'] %} available
          {% elif m3 in ['B1', 'B2', 'C1', 'D1'] %} connected
          {% elif m3 in ['C2', 'D2'] %} charging
          {% else %} {{ m3 }}
          {% endif %}

modbus:
  - name: laadpaal
    type: tcp
    host: 192.168.x.x
    port: 502
    sensors:
      - name: laadpaal_name
        slave: 200
        address: 100
        count: 17
        data_type: string
      - name: laadpaal_temperature
        slave: 200
        address: 1102
        data_type: float32
        unit_of_measurement: °C
      - name: laadpaal_active_max_current
        slave: 200
        address: 1100
        data_type: float32
        unit_of_measurement: A
      - name: laadpaal_real_power_sum
        slave: 1
        address: 344
        data_type: float32
        unit_of_measurement: W
      - name: laadpaal_mode3_state
        slave: 1
        address: 1201
        count: 5
        data_type: string
        scan_interval: 5
      - name: laadpaal_actual_applied_maxcurrent
        slave: 1
        address: 1206
        data_type: float32
        unit_of_measurement: A
      - name: laadpaal_modbus_maxcurrent
        slave: 1
        address: 1210
        data_type: float32
        unit_of_measurement: A
      - name: laadpaal_socket1_current_valid_time
        slave: 1
        address: 1208
        data_type: uint32
        unit_of_measurement: s

The flow :

  • Flow starts every 20sec
  • first check if car is connected (sensor.chargepoint_status)
  • If not connected, do nothing
  • if connected, check if powercharge button (input_boolean.power_charge) is active an send state to flow.powerbutton for use later
  • Poll my digital meter
  • take an average of the last 3 readings (to filter out small spikes)
  • powerbutton NOT active :
  • set ‘set power level’ switch node (ampere) -2 -1 +1 +2, according to injected or consumed power
  • powerbutton active :
  • Check Powercharge current set in UI (input_number.max_powercharge_current) and use it in flow
  • translate current to power (in my case current x 230)
  • make negative
  • create array with powercharge power & DM power
  • add them togehter to create a value that allows us to draw the extra power from the net
  • inject this into the ‘set power level’ switch node
  • set ‘set power level’ switch node (ampere) -2 -1 +1 +2, according to injected or consumed power
  • read currecnt state of ‘input_number.car_charger_ampere’
  • create float32 value from current (credits : @DelfuegoNL)
  • write float32 value to charger over modbus

If you have questions, better flows, please respond, this is still version 0.1 beta, so I’m testing it, but it looks like it’s working :

My dashboard looks like :

Node red flow :


6 Likes

Node-Red code can be downloaded here as a ZIP :
https://fiten.eu/Alfen__ChargePoint_nodered.zip

1 Like

With this setup I managed to get it fully working.Light color is solar power, dark color is the charging power.
As soon as I inject more then 1400W the charger starts, and the power goes to the car.

I manage to change as soon as there is a peak in consumption :

Hi Erwin,

Thank a lot for your node-red integration and json file, this has helped me to implement something similar and it works,

Thanks thanks thanks!

1 Like

Hi Erwin,

Thanks for your post and node-red code. I am trying to get this up and running myself, but very new in HA and Node Red.

Now, when I import your node-red code, my installation does not recognize the calculator-nodes.
Any idea how I can install those on my system?

Thanks!
Ronny

Unfortunately the note red flow seems to be offline, was hoping to give it a test since my EV is arriving next week and Aflen is already installed. Would it be possible to share it again?

Thank you for your great contribution.

I’ve put the (updated) node-red script back online.
Now (for belgium) with also the Capacity Tarif in mind.
And estra button is ‘CapTar’. When enabling this one, the script reads the max capacity value for this month from the DM, then it uses this value added with the solar power that’s left. So you can charge faster, without pushing your monthly capacity tarif up.

1 Like

I managed to get it to work, thanks for the flow!
To try and change it so it can pull 3000W max from the net (I know that a monthly peek is above 2.5 but we never got one below 3 so might as well use it), is it just toying around with the values in “Set power level Charger”?
I’ve set it to 1: 3000 for example.

I can send you an updated flow, where you have 2 choices :
image
You can set an extra ‘amperage’ to use from the net (PowerCharge), OR, you can use the max value from your current monthly peak as a max, so it uses as much power from the net, without exceeding the monthly peak you have at that point ?

the “Set power level Charger” is only a switch node to check if the Amperage can be updated with 1 or 2 at a time, it doesn’t change the power from the net.

Thanks for the reply, I only messed around a bit with it before going to bed as the car started and stopped charging constantly in short bursts. But I might have just used a wrong value somewhere, so I am re-evaluating those now.
I also couldn’t use monthly peek yet, as I use a separate DSMR-reader for my smart meter. But since I see monthly peek is only on the roadmap for december 2024 I am migrating to the Home Assistant integration.

Hi,

I still seem to be hitting a bug. Since it’s finally another sunny day I had the ability to test.

I think I am using a wrong input somewhere, just not sure.

Currently injecting about 1.2kW to the net. Yet the car won’t charge above 6A at the moment.

When I follow the flow in nodered, “DSMR poll” shows -1271.501.
image
The average I get: -1277 . That sounds about right.
Currently not using CapTar button or Powercharge yet, so going directly to Set power Level charger it passes by the Set Charger +2 every time.

Input_number.car_charger_ampere is 16, haven’t seen it otherwise yet (as it doesn’t change the charging speed)
image

A debug of the modbus shows the following output:
image

So I wonder if it is a bug in the script, or a bug in my charging station at the moment.

With CapTar these are the outputs: