Alfen Eve Pro EV chargepoint interface via TCP modbus

Hi @hollie

after your hint, I opened a ticket to Alfen TechSupport and I got this answer:

Currently, there is no “right setting” to use. MaxStationCurrent should be the value of the fuse that is protecting the charging station. Setting this value too high will allow the station to blow the fuse. A better setting to use would be Connector #1 maximum current (“main_normal_max_current_socket_1”). That will allow the station fuse to be protected by the charging station as set in MaxStationCurrent. Because Alfen does not have an official Home Automation interface, there is no other parameter to use for momentary changes of offered current

the HACS expose the ‘main_normal_max_current_socket_1’ parameter as ‘power_connector_max_current_socket_1’ so I’m now able to easily control the current via HA:

Dan

1 Like

Hi @hollie ,

Thank you so much for doing all the work and sharing it.
Couldn’t have figured it out without this.

For people wanting to do the conversion from the desired Amperage in float32 to the two int16 values: Home Assistant Jinja templates (Python) also support the pack and unpack functions. So this is the script I used:

alias: set_modbus_maxcurrent
variables:
  value_a: 0
sequence:
  - service: modbus.write_register
    data:
      address: 1210
      unit: 1
      hub: chargepoint
      value:
        - "{{ (value_a | pack(\">f\") | unpack(\">I\")) // 2**16 }}"
        - "{{ (value_a | pack(\">f\") | unpack(\">I\")) % 2**16 }}"
mode: single

I created an automation that calls this script, so everything is handled in Home Assistant. Some helper input booleans and numbers allow controlling the charging process from a dashboard.

Cheers,
Tars

1 Like

Hey @tars,

you’re welcome!

Very useful addition to this topic. I have just migrated the Perl script I wrote some time ago to a NodeRed flow in order to perform the calculations that determine how much power is available for the chargepoint based on a selected working mode (e.g. load with minimum current, peak shave, wait for solar, …).

I wrote a function in javascript to convert the current to the required register values for modbus, but your script is more elegant. Thanks for sharing!

Best regards,
Lieven.

1 Like

Hello,
Lot’s of information here… will be useful in the future
I’m looking into buying an Alfen Eve S-Line (with RFID reader).
I also want to read/control charging speed from HA.

But which license do I need to activate Modbus? is it the ‘Active loadbalancing’, or another one? (and can I buy it afterwards, or is this only possible for ‘installers’)

And maybe additional question for people having their ‘own’ system (not managed by employer or other CPO):
Is it possible to get a list of charging sessions from the device itself, or is there a (free) OCPP backend from Alfen who can provide this?
Grtz

Hey @abertier

regarding the license: please see this post earlier in the thread: Alfen Eve Pro EV chargepoint interface via TCP modbus - #13 by hollie

You can buy this afterwards, but you need to go via the channel where you bought the charge station, you cannot buy it form Alfen directly (at least I could not when I started this thread).

Greetz,
Lieven

I just acquired an Alfa Eve Single S charging station with Load Balancing enabled. It is running firmware version 6.5.0-4217. Browsing through this excellent thread to identify how to connect the charging station to HA, I noticed a persistent conclusion, unless I have missed something, that concurrent use of load balancing with P1 serial connection and Modbus TCP/IP for monitoring purposes would not be possible.
However, using ACE Service installer I identified the following possible settings with



Active Load Balancing ENABLED. Data source selection possible between Meter; Meter + EMS Monitoring and Energy Management system. Protocol selection possible between: Modbus TCP/IP; P1; Modbus RTU and TIC.
I assume that my requirement can be accomplished using the settings: “ Meter + EMS Monitoring” as source and “DSMR4.x” as protocol.
Unfortunately I can’t test this since my EV will not be delivered before March 2024.
Has anyone else used the above settings for the same objective? And could confirm validity?

Hello,
I found this in the thread:

[leeyuentuen] my integration is not using modbus but using http polling system

So if I undertand correctly, you can use your P1 (DSMR) for active load balancing and use http requests with GitHub - leeyuentuen/alfen_wallbox: Alfen wallbox - Home Assistant Component to monitor.

@leeyuentuen am I correct?

This Custom integration may be an option but using P1 and HA built in modbus integration to monitor would suffice. Hence no need for separate custom integration unless their are parameters available in the custom integration which you can’t find in the modbus list https://alfen.com/file-download/download/public/1610

that’s correct

1 Like

I think it is easier to use the https implementation, this way DSMR is still working.
And if you want you can configure all the things via http as you did via modbus I think…

Eve S-line is ordered… Thanks for the feedback and information in this thread !

Hi @hollie , lots of interesting stuff going on here, thanks!

I might have missed it, but in configuration.yaml I don’t see the entry for displaying the overall charge percentage when the car is charging.

Can you maybe point me how to accomplish this? I am still learning HA on the go.

Hey @ARTSRAY

the chargepoint does not have any indication of the charge percentage of the car battery. If you need that information you will need to get it via the API of your specific car.

Best regards,
Hollie

1 Like

Sadly still the case. Almost a year now I am in conflict with my supplier as they aren’t providing it/selling it. And Alfen is no help in this at all. A crappy system to be honest.

So if you buy one, buy one with the license included. My workplace forgot and I’m still dealing with it.

Hi there,

I managed already for long time to switch from 3 phase to 1 phase over modbus when I want to charge on solar, this to make maximum solar self consumption. Car is only charging on solar power from that moment.
But at sunset I want it to switch to 3 phase again and there’s the problem…
For some reason the Alfen refuses to go from 1 phase to 3 phase. Modbus says it has switched to three phase, but the power is not increasing so I’m pretty sure that the Alfen is not allowing it to switch to 3 phase.
It’s only when I stop the charging session and start a new one that my car is charging on 3 phase again.

So here’s the question (s):

  • Is there a possibility to reboot the charging station via modbus?
  • Is there an option to start/stop my charging session via an alternative way, so I can incorporate it in my automation perhaps?
  • Or anyone else who has experience with going from 1 phase to 3 phase in the same charging session?

I’;m experiencing the same.

Normally I can change from 1 phase to 3 phases and vice versa in one charging session. But occasionally that stops working.
When checking the chargepoint in ACE, I’m unable to change from 1 phase to 3 phases as well. It mentioned something I would need a license for that. The first time it scared me, as I thought the chargepoint had broken.

But when you reboot the unit, it comes back as a 3 phase charger and I’m able to switch between 1 and 3 phases again.

Hi, I’m reading and investigating this thread for some time. Getting ready to implement this in HA myself too.

For the moment I’m using the integration from @leeyuentuen mostly for monitoring purposes.
Last weekend I’ve updated my charge point to the latest Firmware: 6.5.0-4217

I’ve noticed that for the Load Balancing Data Source there is now an extra selection “Meter + EMS monitoring”, where before it was only “Meter” or “Energy Management System”. I haven’t tried yet, but I suppose this means that you can monitor from HA using Modbus while load balancing still works via P1?

I’m also experiencing exactly the same. I only found the following the manual which seems related:

Enabling solar charging will force the charging station to single phase charging.
Switching back to 3-phase charging after solar charging is disabled requires a reboot.

I haven’t found a way to reboot over modbus… So no real solution

1 Like

In my case, this shouldn’t be related as I’m not using that setting at all.

I am using charging mostly over solar-power but the logic for that is completely in HA. HA only tells the unit to charge in 1 phase or 3 phases and by how many amps.

Glad to see I am not the only one that suffers with the charging station not switching from 1 to 3 phase during a charging session. On tweakers forum I read that this should have been solved in 6.4.x. But for the moment I’m even on 6.5 and still facing the problem.