Has someone controlled the ocpp charger to consume the excess solar output?

I’m doing something simular. The ocpp integration in HA is controlling my evbox elvi. Based on the pv power, I’m updating the max power output of the charger.

My only limitation currently is the minimum power my car needs to start charging. This is 8A, which equals to around 4kW on a 3 phase charger. I’m still trying to figure out if and how I can toggle my charger between 1 and 3 phases. This would allow me to start charging at around 1.5kW pv production.

Hey that sounds amazing @nheinemans
Any chance you could share your code?

It’s nothing fancy. I’ve created this template to calculate the max charge current:

    - name: evbox_available_current_rounddown
      unit_of_measurement: "A"
      state: "{{ ((1+((100 - states('sensor.zoe_battery_level') | float(50)) / states('input_number.pv_grid_correction') | float)/ 100) * (states('sensor.pv_power') | float(0)) / 690 ) | round(0,'floor',0) }}"

It’s using a helper, which I called pv_grid_correction, and the battery SoC to allow more or less power to be drawn from the grid. When this template’s value changes, I’m updating the max current in my charger.

Interested, solar inverter (8Kva) and battery inverter (20kWh) + EVBox Elvi

Could you guide me through the settings needed to do at the Evbox side? I have the same charger but it’s a bit unclear to me how to setup the necessary stuff on Elvi for the OCPP integration to find it.

Edit: managed to add “ws://homeassistant.local:9000/” to the EvBox so the OCPP integration won’t show an error anymore. Can’t get any readings from the charger though.

I have a complicated system: Charger is ZJBeny BCP-A2N-L. This OCPP charger operates well under HA. The only issue I have had was how to update firmware (Developer Tools> Service>Update firmware: insert the download address for Beny. After successful firmware update it is important to service: ocpp.clear_profile or the controls do not work!) Another Beny tip is to set up a private WiFi network limited to single Mac address for security: easy under OpenWRT router s/w.
PV system is 2 of SolarEdge SE5000, with 15Kw panels facing N (Australia, Southern Hemisphere) & West. 2 of Victron Multiplus 2 charger/inverter with 48v Lithium Titanate battery (Australian made Zenaji, 11.5Kw: incredible life! 22K+ cycles). Generation is 50M from house, so data read from inverters. Loads measured by IoTaWatt: great value reliable Open-source multi-phase 14 input monitoring that easily interfaces to HA. I am on a 240-0-240v 180 deg phase rural power (similar to US 110-0-110v systems).
Currently, as I am retired, I plug my Kona EV in during the day. We are a full electric household, 3 families, tot 7 people, & we only draw average 25Kw/day from the grid including running 2 of EVs (35000Km/yr total most charges at home).
I feel I do not have the skills to write my own routines for charger control, but I will modify available code if required.

nb: please add my Beny help to the OCPP page if you wish! They are a competitive priced charger.

we just provide an easy testing method to test the integration of HA and ocpp
use an software simulator as the ocpp EV charger
After this test is finished,it will be every easy to replace the simulator to a real ev charger
https://imeter.club/topic/517

1 Like

Control the EV charging power with regard to the solar PV output and grid power reading

I also have the BCP-A2N-L and have it setup using the OCPP integration. The problem I’m having is everytime I change the current, it starts giving errors.

Have you seen any of these types of errors with your unit?

From your logs, you can find that your charger replies ChargingScheduleAllowedChargingRateUnit: “Current, Power” in the response. The response available in my actual test is: “Current”. I don’t know if this is the cause.
your:

2024-02-06 19:06:21.977 INFO (MainThread) [ocpp] charger: receive message [3,"f2b57d3b-1d2d-47ec-ab9d-d3778b0fc8e7",{"configurationKey":[{"key":"ChargingScheduleAllowedChargingRateUnit","readonly":true,"value":"Current,Power"}]}]

mine:

[11:09:18.277]receive←[RECV <-] [2,"fe22cc83-b4e1-4778-aa61-a23ffdb2ceab","GetConfiguration",{"key":["ChargingScheduleAllowedChargingRateUnit"]}]
                    [SEND ->] [3,"fe22cc83-b4e1-4778-aa61-a23ffdb2ceab",{"configurationKey":[{"key":"ChargingScheduleAllowedChargingRateUnit","readonly":true,"value":"Current"}]}]

You can check to see if your charger has a setting to change power control to current control or if it has the latest firmware that supports current control.

Thanks for the suggestion. Turns out it was an issue with the charger.
ZJ BENY have a new beta firmware version (1.0.33) that resolves my issue:

1 Like

Hi @sefac . I’m interested in creating a similar setup. I already have home assistant configured to monitor my excess solar so it’s just a case of creating the automations to use this (and buying a suitable EV charger!)
Just wondering whether you’d recommend a ZJ Beny based on your experience?
Would you mind sharing what you used for setting up the automations?
Thanks.

Now that Benyi have released a beta version of firmware for their EVSEs that fixes the problem with HA, I have my system working well - at last. Today was my first full day. Here’s my dashboard graph of solar inverter power (blue) against my household consumption (pink) which includes the EV charging.

It was a bit cloudy around 10am to 10:30. At 12:30 I changed over the EVs.
I’m using the Huawei solar inverter integration and the OCPP integration. So happy it’s working

4 Likes

Now that it works properly, it’s only limited really by your automations. It seems built well enough. I’m not sure what the quality of other units are like, but with working OCPP, I think it’s a pretty good unit.

I’m currrently charging over night at cheap rates, so have focused on getting OCPP/HA integration working first. Setting up solar tracking automations is still on my todo list.

Hi great,

Have Huawei too …. Would you mind sharing your automations to get to this result ?

Thanks a lot would save a lot of time :slight_smile:
BR
Thomas

Can anyone recommend an EVSE, available in the US, that can vary the charge current with excess solar availability ? Obviously, control via HA a must.

it’d be awesome if you could share your setup! I am struggling getting the beny to talk to the ocpp plugin, but there’s not a lot of documentation or how to’s around the place :slight_smile:

ok I got this sorted after a reset of the charging unit and the integration, I also ended up using ethernet not wifi

using the ocpp hacs integration and keeping the defaults for that during install (ie no ssl), I then configured the z-box app to tell the charger to point to HA using the below (and thanks to lbbrhzn for this pointer)

here’s a screenie of the most important part;

other than that, I again used the defaults that z-box presented. and once that went through it started talking to HA without an issue!

next step is to automate it to soak up the excess sun juice :smiley:

Thanks for this thread and bringing to our attention the iammeter OCPP simulator, which is really useful for testing.

I also wanted to highlight the strong alignment between OCPP to control your EV charging (and discharging) and EMHASS: An Energy Management for Home Assistant.

I am using EMHASS extensively to coordinate the charging of EV during the cheapest windows of the day, including consuming excess solar, but also to determine the optimal times to export, using V2G functionally which is supported under OCPP 2.0.1.

Does the iammeter OCPP simulator also support exports from the vehicle?

Sorry, do not support yet.