batpred icon indicating copy to clipboard operation
batpred copied to clipboard

Predbat with GivEnergy EV Charger in "Inverter Control Cloud" mode

Open AberDino opened this issue 1 month ago • 7 comments

Describe the bug I have recently acquired a second-hand EV and I am using Predbat-led charging. For a more detailed description of my setup and what I'm trying to do, see this discussion. I currently have two issues:

  1. I'm using the "Inverter Control Cloud" option to benefit from excess solar power charging the car during the day. As described in this discussion, to prevent the AIO discharging to the car, Predbat and GivEnergy use different options: Predbat puts the AIO in "PauseDischarge" mode while charging the car, while GivEnergy apply an AIO discharge power limit of 0 (or perhaps a number greater than 0 if part-discharge is allowed). As also mentioned in the discussion, the car charge start/stop command can only be actioned through the GivEnergy cloud API. When I charge overnight, the GivEnergy portal detects that the car is charging, and sets the AIO discharge power to 0. Predbat then sees this and resets it back to 6000, and so on until the charging is finished: Image
2025-10-26 00:05:12.286708: Inverter 0 current discharge rate is 0W and new target is 6000W
2025-10-26 00:05:12.631050: Inverter 0 set discharge rate 6000 via REST successful on retry 0
  1. After 10 minutes, Predbat decides that the car is no longer charging (even though it is) and disables the AIO "PauseDischarge" mode: Image

I did recently enable the "Dynamic Load Adjust" option, and I wonder whether that has anything to do with it:

2025-10-26 00:10:07.532333: Dynamic load last period 1.05kW status low threshold_battery 6.0 threshold_car 6.0
2025-10-26 00:10:07.532518: Dynamic load adjust sees car 1 charging now slot 10-125.0 previous car slot True
2025-10-26 00:10:07.532610: Dynamic load adjust is cancelling car 1 slot 10-125.0 due to low load

Note that my house load does not include the EV charge power, I have a separate "car_charging_energy" sensor defined (in kWh) which is reporting correctly, and "switch.predbat_car_charging_hold" is not enabled (false).

Expected behaviour For the first issue, I would like Predbat not to reset the discharge rate while the car is charging. Perhaps the solution could be to simply ignore the AIO discharge rate for as long as the car is charging, as Predbat controls the car charging process anyway. Predbat wouldn't be aware of any excess solar power being used to charge the car during the day, but that wouldn't matter as it's excess power anyway (I accept that excess energy wouldn't be exported as Predbat would have calculated, because it is not aware of excess energy being used to charge the car).

For the second issue, Predbat should recognise that the car is still charging and it should continue to keep the AIO in "PauseDischarge" mode until the car charging process has been completed. I will test with the "Dynamic Load Adjust" option disabled. For the avoidance of doubt, in theory I should be able to use the "Dynamic Load Adjust" option for my setup?

Predbat version v8.26.4

Environment details See this discussion.

Log file predbat.log Note that 'debug logging' was enabled for 15 minutes or so from midnight, hence it is a fairly large file!

Predbat debug yaml file predbat_debug.txt

AberDino avatar Oct 26 '25 10:10 AberDino

You need to have the car charging planned with Predbat, what car charger are you using? Did you read the documentation on car charging: https://springfall2008.github.io/batpred/car-charging/

Another working is to enable switch.predbat_metric_dynamic_load_adjust which should allow predbat to see the car load and protect the battery.

springfall2008 avatar Oct 26 '25 20:10 springfall2008

Hi @springfall2008,

I have read the documentation and have car charging planned with Predbat with my GivEnergy EV charger (as per subject title and the link to the discussion I included). When I plug in the car, Predbat detects it, and based on the current SoC and target SoC it plans the charge correctly. The charge starts and stops correctly, so that's all fine. It's just that when the car is charging, the GivEnergy cloud and Predbat are getting into a loop of manipulating my AIO discharge power. The GivEnergy cloud sees the car charging so sets the AIO discharge power to 0. Predbat then detects the AIO discharge power set to 0, and resets is back to 6000 (because it uses PauseDischarge instead), and so on, until the car charging is finished.

The issue I have with the switch.predbat_metric_dynamic_load_adjust option when enabled, is that it doesn't appear to see my car charging so hence Predbat disables the 'hold for car'. The car charging energy is not part of the house load as the car_charging_energy value comes from the GivEnergy EV charger. I checked and the value comes through properly to Predbat.

AberDino avatar Oct 26 '25 21:10 AberDino

Just to confirm that when I disable the "Dynamic Load Adjust" option (switch.predbat_metric_dynamic_load_adjust) the 'hold for car' functionality works fine, so the question is why that option does not see my car charger load when enabled. As mentioned above, my car charger power is not part of the house load (splits off before that in the GivEnergy Gateway).

AberDino avatar Oct 27 '25 19:10 AberDino

The car charging energy is not part of the house load as the car_charging_energy value comes from the GivEnergy EV charger. I checked and the value comes through properly to Predbat.

As mentioned above, my car charger power is not part of the house load (splits off before that in the GivEnergy Gateway).

if car_charging_energy is NOT part of your house load then you shouldn't set this sensor in apps.yaml because predbat will subtract this figure from your house load - see https://springfall2008.github.io/batpred/apps-yaml/#car-charging-filtering

gcoan avatar Oct 27 '25 21:10 gcoan

Thanks @gcoan. I did see that, but I have switch.predbat_car_charging_hold set to false, so I didn't think that would matter. In any case, I have now commented out the car_charging_energy line, so we will see what happens.

For the avoidance of doubt, these are the car-related options I have set in apps.yaml (Predbat-led charging): num_cars car_charging_planned car_charging_planned_response car_charging_battery_size car_charging_limit car_charging_soc

AberDino avatar Oct 27 '25 21:10 AberDino

Thanks @gcoan. I did see that, but I have switch.predbat_car_charging_hold set to false, so I didn't think that would matter. In any case, I have now commented out the car_charging_energy line, so we will see what happens.

you are correct, if this switch isn't on then predbat won't subtract car charging energy. But maybe there is some interplay with dynamic load adjust ? Definitely worth ruling it out

gcoan avatar Oct 27 '25 21:10 gcoan

Hi @gcoan, unfortunately it did not make a difference, so I've now disabled the Dynamic Load Adjust option again. I'm not familiar with the Predbat code, but where should it get the car charger power/energy data for the Dynamic Load Adjust evaluation process? Should it also consider the home battery charging power/energy?

AberDino avatar Oct 28 '25 11:10 AberDino