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

Consume the excess solar out by an EV charger (via OCPP)

I am always interested in how to use solar PV more cost-effective, which means utilizing the solar excess(self-use rate) as much as possible.

Premise

Monitor the solar PV

In the beginning, we monitor solar PV output and grid exchange.

Monitor the solar PV in HA

Use the solar excess output by smart socket

Then we found only monitoring is not enough,it needs to find a way to consume the solar output, so we use an simple actuator, a smart socket.
Trigger the smart socket when the excess solar is greater than a threshold and turn off it on the contrary.

Like this

But in fact, the smart socket is not a good option is you want to utilize the excess solar .
Because it can only be controlled on or off and the load power is usually fixed. It is difficult to utilize the solar excess by simple controlling a fixed load power on or off.

Smart EV charger is the perfect option

We found when you want to utilize the excess solar PV output, it is best if the load output can be controlled linearly.

In summary, the smart EV charger is one of the best options. Because the charging power can be controlled via the OCPP protocol.

Then the job of using the excess solar would be simple two steps
1 monitor the excess solar output
2 control the charger via OCPP and keep the consume power equal to the solar output excess.

What do we want to do

Investigate how other people use the OCPP in HA

If you have used the OCPP to control your ev charger in HA, welcome to show us more information here. Including
1 specific brand of the EV charger and the model.
2 the specific application scenario introduction
3 Do you have a solar installed ? Do you plan to use the excess solar output to charge your EV?

Control the EV charger via OCPP in the Home Assistant

I found many EV chargers had been supported in HA now

https://home-assistant-ocpp.readthedocs.io/en/latest/

And we have used this OCPP @HACS to read the data from an OCPP simulator successfully

Build an automatic solution in HA, to utilize the excess solar

We want to build an automatic solution by Home Assistant.
Measure the grid energy exchange and control the charging power by OCPP, to utilize the solar excess output as much as possible.
If you have already controlled the EV charging (via OCPP) in HA and also have a solar inverter at the same place, welcome to contact us under this topic.
We are willing to provide some WEM3080(1phase) or WEM3080T(3 phase) for testing the automatic solution.

updated on Oct 2023

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

1 Like

I have just finished building a solar EV charger using the Viridian controller and am writing the code to run it. My power monitoring is not particularly accurate so would be happy to test one of your 1phase devices.

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

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

2 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.