WillCodeForCats / solaredge-modbus-multi

Modbus/TCP local polling to one or more SolarEdge inverters. For single inverters, multiple inverters, meters, and batteries.
Apache License 2.0
181 stars 15 forks source link

EV Charger support #565

Open WillCodeForCats opened 6 months ago

WillCodeForCats commented 6 months ago

Discussed in https://github.com/WillCodeForCats/solaredge-modbus-multi/discussions/564

Originally posted by **mikedeluca** March 27, 2024 So I was digging around to try to figure out why some sites batteries work and at others they don't show up and I ran across a Modbus address that wasn't one of the 3 inverters. {'c_id': 'SunS', 'c_did': 1, 'c_length': 65, 'c_manufacturer': 'SolarEdge', 'c_model': 'SE-EV-SA-US-40P', 'c_version': '0004.0019.0036', 'c_serialnumber': '63002925', 'c_deviceaddress': 4, 'c_sunspec_did': 103, 'c_sunspec_length': 50, 'current': 0, 'l1_current': 0, 'l2_current': 0, 'l3_current': 0, 'current_scale': -32768, 'l1_voltage': 0, 'l2_voltage': 0, 'l3_voltage': 0, 'l1n_voltage': 0, 'l2n_voltage': 0, 'l3n_voltage': 0, 'voltage_scale': -32768, 'power_ac': -32768, 'power_ac_scale': -32768, 'frequency': 0, 'frequency_scale': -32768, 'power_apparent': -32768, 'power_apparent_scale': -32768, 'power_reactive': -32768, 'power_reactive_scale': -32768, 'power_factor': -32768, 'power_factor_scale': -32768, 'energy_total': 0, 'energy_total_scale': -32768, 'current_dc': 0, 'current_dc_scale': -32768, 'voltage_dc': 0, 'voltage_dc_scale': -32768, 'power_dc': -32768, 'power_dc_scale': -32768, 'temperature': -32768, 'temperature_scale': -32768, 'status': 1, 'vendor_status': 0, 'rrcr_state': 0, 'active_power_limit': 100, 'cosphi': 0, 'commit_power_control_settings': 0, 'restore_power_control_default_settings': 0, 'reactive_power_config': 0, 'reactive_power_response_time': 0, 'advanced_power_control_enable': 0, 'export_control_mode': 0, 'export_control_limit_mode': 0, 'export_control_site_limit': 0} This is ID 4 on the Modbus TCP. The model and serial match my Solaredge EV Charger. Feels like this would be interesting functionality to add... I'll try to do some more scanning of registers
WillCodeForCats commented 6 months ago

EV charger appears to present as an inverter based on the sunspec ident block.

deqw commented 6 months ago

Looking at the model it is a Keba P40 charger disguised as a SolarEdge Inverter. Maybe just for presentation purpose?

WillCodeForCats commented 6 months ago

Maybe making it look like an inverter would let it reuse modbus definitions without SolarEdge having to support new types, but also if it looks like an inverter it wouldn't be possible to detect except by trying to match model strings.

If some of those values change when the charger is charging I could make a restricted display for a charger class.

deqw commented 6 months ago

I have been using this Keba integration for a while to control the SolarEdge EV charger but stopped using it. Now using Node-Red on Home Assistant for this purpose which gives me more control.

WillCodeForCats commented 6 months ago

I can find modbus data about Keba P30 but not about P40.

If SolarEdge is just using the P40 rebranded and the P30 modbus still works with the P40, I can try that.

deqw commented 6 months ago

There are others too (like BMW) that rebrand the Keba chargers. I use the Keba API for phase switching (1<->3) and to get some info from the charger. The API works fine. Maybe you already found the Keba UDP Programmers Guide here.

WillCodeForCats commented 6 months ago

I can't use the UDP guide unfortunately, it needs to be modbus through the SolarEdge inverter bus to work with this integration.

mikedeluca commented 6 months ago

The solaredge charger in this case does not apear to be the Keba. Solaredge seems to have their own EVSE for the North American (and I think Australian) markets. https://www.solaredge.com/us/products/residential/solaredge-home-ev-charger. The Keba is this one: https://www.solaredge.com/en/products/residential/ev-charging. I'll try to get some info from it with the car connected and charging. Its technically my secondary EVSE since I primarily use a Tesla wall connector, so I need to move some things to get the car close enough. I suspect your correct, that they just recycled sunspec registers to make things simple. I'll also see what i can pull from setapp.

deqw commented 6 months ago

@mikedeluca the Keba one you reference is a P30, not a P40.

mikedeluca commented 6 months ago

So confirmed in setapp its configured as a solaredge follower, just like an inverter. Also was able to confirm in setapp that it contains FCC ID 2AGPT-PLNX, which is a solaredge comms board. https://fccid.io/2AGPT-PLNX/User-Manual/Users-Manual-rev-pdf-3941269. One interesting thing, the label on the outside proclaims it as a SE-EV-SA-US-40N not a 40P as the modbus returns. probably doesnt matter, but for future readers. Full serial is SJ5121-063002925-B1. In Setapp the serial is SN 05F5EB22-07 in the status page (probably the comms board?) and 63002925-B1 in the information screen. Im running Version 4.20.32/2.2.12/4.20.64 (CPU/EVcharger/WSA). I'm not clear how often these are configured via Modbus vs Wifi or ethernet. Mine is setup that way and is connected directly to inverter #1 for both modbus and AC power.

mikedeluca commented 6 months ago

Debuglog.txt

This is the debug log output from a scan of a bunch of the registers. last few scans are on the EVSE wile charging

bisscuitt commented 4 months ago

I believe I have one of these inverters. It's an SE5000H with integrated EV Charger (Australia) and it would be awesome if I could monitor and control charging over modbus.

Can you give me some advice on how to provide required modbus dumps ?

laurencei commented 1 month ago

@WillCodeForCats - do you have an EV charger?

Not sure if your seen this - but when adding the SolarEdge EV charger - some extra options appear in the SolarEdge app

IMG_3204

IMG_3205

and this is what it looks like when charging:

Screenshot 2024-08-08 at 11 40 11

Specifically the part I'm most interested in is been able to get the "plugged in status", toggle the "excess solar" on/off, and manually toggle the "charge now"/"stop charge" overrides.

Is there something I can do to help? I'm happy to run some local scans or do some reverse stuff if you can point me in the right direction for what you need?

laurencei commented 1 month ago

I'm not clear how often these are configured via Modbus vs Wifi or ethernet. Mine is setup that way and is connected directly to inverter 1 for both modbus and AC power.

That is how mine has been installed as well.

laurencei commented 1 month ago

I found this guide for the SolarEdge EV charger. Has some specifics on error codes etc that might be useful: https://knowledge-center.solaredge.com/sites/kc/files/smart-ev-charger-installation-guide-na.pdf

WillCodeForCats commented 1 month ago

No, I do not have an EV charger on my system.

There are various modbus scanning utilities that might be able to help. This one is cross platform: https://github.com/SciFiDryer/ModbusMechanic

laurencei commented 1 month ago

I've actually found an issue. When running SolarEdge in "Remote Control" mode, the EV charger doesnt work correctly, specifically the "pending excess solar" option doesnt trigger. I can only trigger the EV charger to work by manually trigger it in the app (or setting a schedule).

Previously the EV charger would absorb any excess solar up to the max charge rate (6.5kw) before sending anything to the grid.

The problem with manual charge is it forces a 6.5kw charge, meaning if I only have 2kw solar generation spare, I'll pull 4.5kw from the grid.

I'm going to reach out to SolarEdge about it - might be a way to get some modbus data on how to control the EV charger ourselves, since the app seems to lose the ability when we do remote control.

(Solaredge specifically gave me remote control back, so I can press them on helping to fix this issue).

deqw commented 1 month ago

Charging on excess solar didn't work for me either. Since two weeks it is working however after an inverter (SE10K-RWB48BFN4) firmware update (0004.0021.0019). And still working after 0004.0021.0021 that it is on now. Load balancing is also working ok. Before I - could/had to - trigger charging eg. by closing the car again (did not matter if it was open or closed already). Maybe a direction for them to look into.

laurencei commented 1 month ago

Yeah - they responded they have updated the EV Charger firmware - but I cant see it, so I dont know what exactly changed.

Will check how it goes.

d0minander commented 2 weeks ago

@WillCodeForCats About to have my second Solar Edge EV Charger Three phase installed, its a bit unclear if support for this has been implemented yet? if not, anything we can do to help? I see that some people have mentioned its the Keba P40, but this is not correct, the SolarEdge EV Three phase charger is a variant of the Keba P30 X-series, you can se its the same design: https://www.keba.com/en/emobility/products/x-series/x-series In the documentation it says that the charger supports modbus, "The charging station gives you the option to transmit information and receive commands via the User Datagram Protocol (UDP) or via Modbus TCP"

d0minander commented 1 week ago

Regarding the models SolarEdge actually has two models, one for single phase and one for three phase. The Keba P30 version is the three phase, it even runs on the same firmware, but seems to be one version behind the official Keba version.

Zandor300 commented 1 week ago

Just want to point out that EV's have a policy, at least in the European Union, that when the max current the EVSE provides to the EV falls below 6A, it should stop charging altogether.

Assuming 230V/400V grid:

So for people who wonder why excess PV charging isn't working, this is probably why. If you have that enabled and you hit the "start charging" button in the mySolarEdge app, you will force the charger to start charging at full power, throwing the excess PV charging setting out the window for the current session.

SolarEdge doesn't provide the option to configure the P30 to start charging on single phase if your car supports three phase and you only have 1,4 kW of excess PV. Maybe the onboard settings UI of the P30 has this option available?

d0minander commented 1 week ago

@Zandor300 Good points. When using single phase charging, can the inverter then boost power to the phase that the EV charger is using? Becouse if the inverter has 3kw of excess that would only be 1kw per phase?

I could access the WebUI of the charger and it seems to have all the options that the Keba unit has, so if the Keba unit supports it, the Solaredge one should, but i dont have access to it right now since its installed at another property. https://www.keba.com/en/emobility/products/x-series/x-series

Zandor300 commented 1 week ago

Only the 3phase Home Hub inverter can provide different amounts of power to the phases. The rest of the 3phase inverters split the power output evenly over the 3phases.

So when you charge with single phase 3 kW, the 3phase inverter will provide 1kW on each phase. In the Netherlands, the smart meter provided by the energy company will perform net metering between the phases and you only have to pay for the sum of electricity used. So when you export 1 kW on phase 1 and import 1 kW on phase 2, you don't pay anything.
(This is different from the net metering where you can export 30 kWh during the day and import again in the evening)

Don't know about other countries.

d0minander commented 1 week ago

Ok thanks for the info. I dont know how our net metering in Sweden works, will look in to it. Seems the new Keba P40 has built in phase switching, but the P30 that SolarEdge uses needs an external box for phase switching.