Alfen Eve Pro EV chargepoint interface via TCP modbus

Were you already able to solve this?
I have the same issue. When the EMS suddenly sets the current from 25 to 5 or so, the charging stops.
But I don’t understand where the sudden drop comes from, because my node-red script only lowers 1A each loop, do you have an idea?

When the power gradually lowers it’s no problem
image

Erwin

I’m sorry but I have no soluties yet.

Not sure what is going wrong in your setup but if you lower your max current with 1A every cycle then you go from 25 to 5 in milliseconds (one cycle just takes milliseconds).

The problem is that lowering the actual current is done by your car’s charging system. Communication between the car and the charger is lowtech and very slow. So the charger stops charging because it thinks the car is not responding and the car thinks it has enough time left to lower charging current.

A solution can be to lower the charging current in steps of max 3A (=50% of 6A) and wait xx (don’t know how long is needed) seconds before making the next step.

Still you then have the risk of blowing your fuses because of sudden overcurrent.

THat’s just my problem, I only poll once every 30 seconds. So it can only go down by 2A every minute. I did this, because I saw the charger doesn’t respond immediately, AND the car needs some time to adjust :



So I’m not sure where the sudden drop comes from

Erwin

I was checking the ACE installer for some ‘time out’ settings, and found this one :


Did you already try to increase this value ?
Because (at my side) the current always drops to the ‘safe current’ I have set.
Because I only poll every 60sec, if an modbus write goes wrong, nor not fast enough, the 60 sec limit is reached, and maybe the system sees that as ‘no connection’ and drops to the Safe Current?
I’m not at home now, but I’m going to try it later.

I also sent a support request to Alfen, to see if they can tell me why this is happening.

Erwin

Hi,

this thread got me started to manage my Alfen charger through HA. With the information above I’ve managed to send the grid return power to the car all in HA.
Next step is to set up an automation to do the actual load balancing to maximize charging speed and for current protection, but there is one thing that I don’t understand, how are the phases handled by the chargepoint?

  1. Modbus register 1210 sets the maximum current. Is the same value then applied to all 3 phases? This limits the maximum power from the grid when one phase is already used.
  2. The alfen modbus manual https://alfen.com/file-download/download/public/1610 shows that you can set the individual SCN Max Current per Phases, however I can’t get them to work. I probably need a license to use the SCN registers.
  3. Does anybody know how how the P1 balancing works? I’d like to replicate through modbus.

Thank you in advance.

regards,

Jasper

1 Like

In case anybody is interested in converting the amps to a float32 in HA:

[ {{ '0x%04x' % unpack(pack(states('sensor.modbus_maxcurrent') | float(0), ">f"), ">h") | abs }}, {{ '0x%04x' % unpack(pack(states('sensor.modbus_maxcurrent') | float(0), ">f"), ">h", offset=2) | abs }}]

this should do the trick. I found this solution in another thread, the endians are switched, I’ve adjusted just that in the script above. source:

3 Likes

Thanks @bartland for sharing your scripts, I got it working here. I did adjust some small things, because I ran into a float error. This was due to the fact if I set the Wattage at an exact boundary of the automation. I also added some higher level ampere loading so I can charge at 3X 16A. Below my current automation:

- alias: Wattage has changed = define Ampère
  id: 'fefe7ddf-8730-4d3e-af5c-0e6b18b9ede5'
  description: ''
  trigger:
  - platform: state
    entity_id: input_number.car_charger_watt
  condition: []
  action:
  - service: input_number.set_value
    target:
      entity_id: input_number.car_charger_ampere
    data:
      value: >-        
          {% set W = states("input_number.car_charger_watt") | float %}
          {% if 0.9 < W < 1.5 %} 6
          {% elif 1.5 <= W < 1.8 %} 7
          {% elif 1.8 <= W < 2 %} 8
          {% elif 2 <= W < 2.2 %} 9
          {% elif 2.2 <= W < 2.5 %} 10
          {% elif 2.5 <= W < 2.7 %} 11
          {% elif 2.7 <= W < 2.9 %} 12
          {% elif 2.9 <= W < 3.2 %} 13
          {% elif 3.2 <= W < 3.4 %} 14
          {% elif 3.4 <= W < 3.6 %} 15
          {% elif 3.6 <= W < 3.8 %} 16
          {% elif 3.8 <= W < 4.5 %} 6
          {% elif 4.5 <= W < 5.2 %} 7
          {% elif 5.2 <= W < 5.9 %} 8
          {% elif 5.9 <= W < 6.6 %} 9
          {% elif 6.6 <= W < 7.3 %} 10
          {% elif 7.3 <= W < 8.0 %} 11
          {% elif 8.0 <= W < 8.7 %} 12
          {% elif 8.7 <= W < 9.4 %} 13
          {% elif 9.4 <= W < 10.1 %} 14
          {% elif 10.1 <= W < 10.7 %} 15
          {% elif 10.7 <= W < 11.1 %} 16
          {% endif %}
  mode: single

Hi DelfuegoNL,

I’ve some unknown nodes calculator and looptimer witch nodes do i need to install?

Hi Jaimy,

I think I used these:
node-red-contrib-looptimer
node-red-contrib-calc

Best regards,

Luuk

1 Like

Anybody knows if this also works for an Eve Single S-line ?
Thank you.

Hi Koen,

Yes, this will work on an Eve Single S-line. I have one myself.

Best regards,

Luuk

1 Like

With the collected info in this thread, I was able to put together the readout of modbus registers and setting the charge current. The writing is done with a single automation that runs both every 55 seconds and whenever my helper entity, which is just a number, changes. It calls the modbus.write_register service and takes care of the formatting.

Into the template piece that defines the value, I added that a hard minimum of 5 A and maximum of 16 A are enforced using the min and max functions. Note that the max function ensures the minimum and the min function ensures the maximum. 5 A suspends charging (depends on the vehicle whether it will resume). If you don’t want that, change the 5 to a 6 in both places in the template.

service: modbus.write_register
data:
  address: 1210
  slave: 1
  value: >
    [ {{ '0x%04x' %
    unpack(pack([[states('input_number.laadpaal_laadstroom_instelling')|float(0),
    16] | min, 5] | max, ">f"), ">h") | abs }}, {{ '0x%04x' %
    unpack(pack([[states('input_number.laadpaal_laadstroom_instelling')|float(0),
    16] | min, 5] | max, ">f"), ">h", offset=2) | abs }}]
  hub: laadpaal

(the syntax highlighting in this forum thinks there is an issue, but there isn’t)

Next step: coming up with sensible rules to lower the charge current automatically when there is a high total demand of electricity. I suppose this has to be somewhat conservative, since the consumption values always include the EV charger itself. So it will be something like lowering the charge current when the total demand comes within 10% of the house limit per phase.

2 Likes

This is exactly what i’m looking for. I do not want to risk any outage because active load balancing via P1 is turned off. Have you found a solution to simply read values from the Alfen Eve and use P1 at the same time?

Hi Lieven,

Thanks for your Alfen modbus code, as many others here, it’s the basis of the home assistant driven alfen load balancing, without this info, it would be much more time consuming to figure it out!

FYI, I implemented your config, and used Node-red as automation.

2 Likes

I’ll try to explain my node-red flow (this is for automation of solar-power). Still working on load balancing and debugging.

I have a renault e-tech megane,
Battery level coming in via integration to set the max charging level: input number in home assistant. Extra to 100% charge if sun allows via node-red ‘zonneladen’ input number. (input boolean to allow)
Charging speed via input select in HA to input number ‘basisladen’ 0.2 kW to pauze/stop.
Sum of different kWh input numbers in second flow.

[{"id":"eedcfd7df3194436","type":"tab","label":"Laadpaal","disabled":false,"info":"","env":[]},{"id":"892f8259917c0166","type":"inject","z":"eedcfd7df3194436","name":"Poll every 10 sec","props":[{"p":"payload"}],"repeat":"10","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":400,"wires":[["cb2b8fdee318a7ca","f5cba20a139af5a8"]]},{"id":"36284cdd65b3f97c","type":"trigger-state","z":"eedcfd7df3194436","name":"keuzemenu","server":"777449db.c1d348","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"input_select.laadopties","entityidfiltertype":"exact","debugenabled":false,"constraints":[],"inputs":0,"outputs":7,"customoutputs":[{"messageType":"default","messageValue":"0","messageValueType":"num","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"Alleen zon","comparatorValueDataType":"str"},{"messageType":"default","messageValue":"1.2","messageValueType":"num","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"6A (minimaal)","comparatorValueDataType":"str"},{"messageType":"default","messageValue":"6","messageValueType":"num","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"6Kw (overnight)","comparatorValueDataType":"str"},{"messageType":"default","messageValue":"","messageValueType":"json","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"8Kw","comparatorValueDataType":"str"},{"messageType":"default","messageValue":"","messageValueType":"json","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"11Kw (max)","comparatorValueDataType":"str"}],"outputinitially":false,"state_type":"str","enableInput":false,"x":90,"y":140,"wires":[[],[],["517abe446903208f"],["05039093707c78f8"],["b3e2058b5cc0518a"],["4cb461647a56c987"],["6835eebbf83fa5b4"]]},{"id":"b3e2058b5cc0518a","type":"api-call-service","z":"eedcfd7df3194436","name":"6Kw","server":"777449db.c1d348","version":5,"debugenabled":true,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.basisladen"],"data":"{\"value\":\"6\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":290,"y":180,"wires":[["9e0e0f67c5877696"]]},{"id":"9e0e0f67c5877696","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"f52c678d.eab598","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.basisladen","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1540,"y":180,"wires":[[]]},{"id":"517abe446903208f","type":"api-call-service","z":"eedcfd7df3194436","name":"Alleen zon","server":"777449db.c1d348","version":5,"debugenabled":true,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.basisladen"],"data":"{\"value\":\"0.2\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":310,"y":100,"wires":[["9e0e0f67c5877696"]]},{"id":"05039093707c78f8","type":"api-call-service","z":"eedcfd7df3194436","name":"6A","server":"777449db.c1d348","version":5,"debugenabled":true,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.basisladen"],"data":"{\"value\":\"1.2\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":290,"y":140,"wires":[["9e0e0f67c5877696"]]},{"id":"4cb461647a56c987","type":"api-call-service","z":"eedcfd7df3194436","name":"8Kw","server":"777449db.c1d348","version":5,"debugenabled":true,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.basisladen"],"data":"{\"value\":\"8\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":290,"y":240,"wires":[["9e0e0f67c5877696"]]},{"id":"6835eebbf83fa5b4","type":"api-call-service","z":"eedcfd7df3194436","name":"11Kw","server":"777449db.c1d348","version":5,"debugenabled":true,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.basisladen"],"data":"{\"value\":\"11\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":290,"y":300,"wires":[["9e0e0f67c5877696"]]},{"id":"cb2b8fdee318a7ca","type":"api-current-state","z":"eedcfd7df3194436","name":"zonneladen Button Active ?","server":"f52c678d.eab598","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.zonneladen","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":180,"y":500,"wires":[["e9e36f7ea984eaa7"]]},{"id":"9df7ee1516292e5b","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"777449db.c1d348","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.power_production","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":960,"y":620,"wires":[["d1f11cfbf9254c5f"]]},{"id":"d1f11cfbf9254c5f","type":"switch","z":"eedcfd7df3194436","name":"Set power level Charger","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0.250","vt":"num"},{"t":"lt","v":"0.75","vt":"num"}],"checkall":"false","repair":false,"outputs":2,"x":990,"y":500,"wires":[["d70c1ce270339a4a"],["c7dd89e910be5f1e"]]},{"id":"8db8862ac129f287","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"f52c678d.eab598","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.zonneladen","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1960,"y":560,"wires":[[]]},{"id":"e9e36f7ea984eaa7","type":"switch","z":"eedcfd7df3194436","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":230,"y":700,"wires":[["dee1ce1f38654cdc","184b796f1240b1f4"],["1264f7c08cb64288"]]},{"id":"d70c1ce270339a4a","type":"api-call-service","z":"eedcfd7df3194436","name":"Set  zonneladen +0,2","server":"f52c678d.eab598","version":5,"debugenabled":false,"domain":"input_number","service":"increment","areaId":[],"deviceId":[],"entityId":["input_number.zonneladen"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1340,"y":460,"wires":[["d5929416d2315423"]]},{"id":"c7dd89e910be5f1e","type":"api-call-service","z":"eedcfd7df3194436","name":"Set  zonneladen -0,2","server":"f52c678d.eab598","version":5,"debugenabled":false,"domain":"input_number","service":"decrement","areaId":[],"deviceId":[],"entityId":["input_number.zonneladen"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1340,"y":540,"wires":[["8db8862ac129f287"]]},{"id":"1264f7c08cb64288","type":"api-call-service","z":"eedcfd7df3194436","name":"Set  zonneladen reset","server":"f52c678d.eab598","version":5,"debugenabled":false,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.zonneladen"],"data":"{\"value\":\"0\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1320,"y":700,"wires":[["8db8862ac129f287"]]},{"id":"dee1ce1f38654cdc","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"777449db.c1d348","version":3,"outputs":2,"halt_if":"connected","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.chargepoint_status","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"true","valueType":"bool"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":540,"y":600,"wires":[["9df7ee1516292e5b"],[]]},{"id":"184b796f1240b1f4","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"777449db.c1d348","version":3,"outputs":2,"halt_if":"charging","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.chargepoint_status","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"true","valueType":"bool"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":540,"y":660,"wires":[["9df7ee1516292e5b"],[]]},{"id":"f5cba20a139af5a8","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"777449db.c1d348","version":3,"outputs":2,"halt_if":"available","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.chargepoint_status","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"true","valueType":"bool"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":200,"y":800,"wires":[["1264f7c08cb64288"],[]]},{"id":"7c3391234435d84c","type":"server-state-changed","z":"eedcfd7df3194436","name":"","server":"777449db.c1d348","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zonneladen","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload3","propertyType":"msg","value":"","valueType":"entityState"}],"x":840,"y":380,"wires":[["f7d98759fc83af78"]]},{"id":"f7d98759fc83af78","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"777449db.c1d348","version":3,"outputs":2,"halt_if":"payload3","halt_if_type":"msg","halt_if_compare":"gte","entity_id":"sensor.power_production","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload2","propertyType":"msg","value":"true","valueType":"bool"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1260,"y":380,"wires":[["d5929416d2315423"],[]]},{"id":"d5929416d2315423","type":"emerge","z":"eedcfd7df3194436","name":"zonneladen niet hoger","grpRules":[{"ruleProperty":"payload2","rulePropertyType":"msg","ruleOperation":"==","ruleValue":"true","ruleValueType":"bool"}],"ruleProperty":"payload","rulePropertyType":"msg","ruleOperation":"==","ruleValue":"","ruleValueType":"str","rulesTimeout":"20","timeoutAction":"0","x":1600,"y":460,"wires":[["8db8862ac129f287"]]},{"id":"777449db.c1d348","type":"server","name":"Home Assistant","addon":true},{"id":"f52c678d.eab598","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
[{"id":"81c4f1c116bff3ad","type":"tab","label":"Optelling","disabled":false,"info":"","env":[]},{"id":"966e4ec425053022","type":"api-current-state","z":"81c4f1c116bff3ad","name":"","server":"f52c678d.eab598","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.basisladen","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"topic","propertyType":"msg","value":"a","valueType":"str"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":620,"y":200,"wires":[["35110338987a5270"]]},{"id":"8b92b7d9a6d7a7dc","type":"api-current-state","z":"81c4f1c116bff3ad","name":"","server":"f52c678d.eab598","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.car_charger_watt","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1480,"y":540,"wires":[[]]},{"id":"83d00bc756981ba6","type":"api-current-state","z":"81c4f1c116bff3ad","name":"","server":"f52c678d.eab598","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.zonneladen","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"topic","propertyType":"msg","value":"b","valueType":"str"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":360,"y":560,"wires":[["7425204d2413fd31"]]},{"id":"3d9c84c82479675b","type":"api-call-service","z":"81c4f1c116bff3ad","name":"","server":"f52c678d.eab598","version":5,"debugenabled":false,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.car_charger_watt"],"data":"{\"value\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1090,"y":540,"wires":[["8b92b7d9a6d7a7dc"]]},{"id":"2b1f7419.779bc4","type":"join","z":"81c4f1c116bff3ad","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":770,"y":380,"wires":[["e07f5ac37ee932ea"]]},{"id":"e07f5ac37ee932ea","type":"calculator","z":"81c4f1c116bff3ad","name":"","inputMsgField":"payload","outputMsgField":"payload","operation":"sum","constant":"","round":true,"decimals":"1","x":810,"y":540,"wires":[["3d9c84c82479675b"]]},{"id":"35110338987a5270","type":"template","z":"81c4f1c116bff3ad","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload}}","output":"str","x":1020,"y":200,"wires":[["2b1f7419.779bc4"]]},{"id":"8f5d255fa5d91da3","type":"inject","z":"81c4f1c116bff3ad","name":"Poll every sec","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":80,"y":280,"wires":[["83d00bc756981ba6","fe63d51b8fb84655"]]},{"id":"7425204d2413fd31","type":"template","z":"81c4f1c116bff3ad","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload}}","output":"str","x":640,"y":560,"wires":[["2b1f7419.779bc4"]]},{"id":"fe63d51b8fb84655","type":"api-current-state","z":"81c4f1c116bff3ad","name":"","server":"777449db.c1d348","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.percentage_opladen","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload3","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":350,"y":100,"wires":[["ad5c1da55b24fa69"]]},{"id":"ad5c1da55b24fa69","type":"api-current-state","z":"81c4f1c116bff3ad","name":"","server":"777449db.c1d348","version":3,"outputs":2,"halt_if":"payload3","halt_if_type":"msg","halt_if_compare":"gt","entity_id":"sensor.battery_level","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload2","propertyType":"msg","value":"true","valueType":"bool"},{"property":"payload4","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":720,"y":100,"wires":[["99d3762a56ea282d"],["0fa7c39e3f8a6fef"]]},{"id":"0fa7c39e3f8a6fef","type":"emerge","z":"81c4f1c116bff3ad","name":"zonneladen niet hoger","grpRules":[{"ruleProperty":"payload2","rulePropertyType":"msg","ruleOperation":"==","ruleValue":"true","ruleValueType":"bool"}],"ruleProperty":"payload","rulePropertyType":"msg","ruleOperation":"==","ruleValue":"","ruleValueType":"str","rulesTimeout":"20","timeoutAction":"0","x":340,"y":200,"wires":[["966e4ec425053022"]]},{"id":"99d3762a56ea282d","type":"change","z":"81c4f1c116bff3ad","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"0.2","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"a","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1240,"y":140,"wires":[["35110338987a5270"]]},{"id":"92e85f85adfbc48b","type":"server-state-changed","z":"81c4f1c116bff3ad","name":"","server":"777449db.c1d348","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.battery_level","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":620,"y":40,"wires":[[]]},{"id":"f52c678d.eab598","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"777449db.c1d348","type":"server","name":"Home Assistant","addon":true}]

A splitter like this might work (this one even mentions Alfen somehow): P1 Splitter voor laadpalen - Cedel webshop

The issue is that the Alfen wallbox is not capable of enabling active load balancing via P1 and have modbus active at the same time.
But I have found a solution. I’m using p1 active load balancing and use this read-only integration to readout values from the wallbox. You can also integrate into Energy.

4 Likes

Yo,

got this working !!

Brilliant, thanks heartkingz, great work!

As you I don´t wanne mess with the loadbalancing through the P1, but want to have the integration in the energy card!

Thanks again!!

Hi Heartkingz,

This is Exactly what I´m looking for. Unfortunately I can´t find the intergration in HACS anymore. Being a novice in HA I copied the folder alfen_wallbox in the self made folder custom_components/alfen_wallbox using the file editor, but this doesn´t give me any form of intergration. Could you please help me with this one? Much appriciated!

Thanks
Willem.

1 Like

Hi Willem,

Yes, had the same thing.
You need to add a custom repository to hacs with the github link I posted.

If you search again it will show up.

Yo,
exacatly that happened. Got it working now,

thanks a lot, brilliant!