My setup to charge 2 cars with Predbat #3001
Replies: 1 comment
-
|
Below is an extra section that will split the cost of charging per car. Predbat is keeping the daily cost of charging the cars in one sensor but it doesn't specify the cost for each car. The automations below will take care of it but first we need to create 2 new helpers to track the cost per car. Create 2 helpers that will collect the cost per car Predbat stores the cost in pence so adjust the max to whatever is good for you. Create a helper entity (Settings / Devices & Services / Helpers) of type 'Number' called:
Create another automation that will reset both timer every day at midnight. You can then create more utility meters helper that will use these 2 sensors to have weekly, monthly or whatever you choose totals for each cars. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Below is what I did to be able to charge 2 cars via Predbat. So I thought I would share it,.
I would like to thanks @gcoan and @springfall2008 for their help and patience with me.
Hopefully there is not too many typos or mistakes. Please let me know if you have any questions.
We have 2 EVs (MG5 and Ioniq) that we charge through a "Project EV" charger. None of the cars have a 3rd party integration (so Predbat/HomeAssistant have no idea of the cars' current SoC)
The wall charger is integrated via the OCPP integration (https://github.com/lbbrhzn/ocpp) which allow us to know when a car is plugged in.
It gives us a few sensors but the one we are interested are:
In Home Assistant:
1/ Create a 'Dropdown' helper entity (Settings / Devices & Services / Helpers) that has two options 'mg5' and 'ioniq' (or whatever you call your cars):
This will allow to differentiate which car is plugged in:
2/ Create a helper entity (Settings / Devices & Services / Helpers) of type 'Number' and set 'Unit of Measurement' to '%':
This is to initialise the starting SOC of the car ( what your car is at before starting the charge).
3/ Create a helper entity (Settings / Devices & Services / Helpers) of type 'Number' and set 'Unit of Measurement' to '%':
This will indicate how much you want to charge the battery
3/ Open the home assistant templates.yaml and create a new sensor. Copy the yaml code below in the file
It will turn on or off based on which car is connected to the charger. It will also contains the details of the car that was selected from the dropdown menu.
Adapt the data to your cars mainly name, model and battery size.
You will also need to adapt the "Available" statement depeding on your wall charger. For my EV charger when no car is connected the state is Available.
4/ In the same template file copy the following code. It will be used by predbat to determine the size of your car battery.
The data is read from the sensor created above.
5/ I also created an optional sensor that follows the charging of the car. It is optional but helpful to visualize in your dashboard
Create a helper entity (Settings / Devices & Services / Helpers) of type 'Template'. I named it 'Car Current Capacity'
In the state section copy this template:
Set unit to %, device class to battery and state class to measurement
6/ Since I am doing everything manually I need to initialise the Predbat sensor that keep track of how much kwh are in your battery before charging.
Once the charging start Predbat will increase it accordingly until you reach the required charging level.
Create an automation to convert the SOC (read from your car dash in %) into kWh. It makes life easier by not having to calculate it yourself.
It is triggered when you change the car from the dropdown or when you change the initial SOC of your car.
The result is then assigned to the predbat_car_charging_manual_soc_kwh(_1) and will then later increase as the battery is being charged.
7/ Finally create one more automation that will decide to turn on and off the EV Charger so that it charges the car based on Predbat decision
You will need to the adjust the entity that controls the activation of the wall charger
In PredBat's app editor:
Within the apps.yaml configuration file specify the following configuration settings:
1/ Find the line for num_cars and set it to 2
num_cars: 22/ Find car_charging_planned and replace the template Wallbox and Zappi regular expression with the sensor created earlier:
3/ Find car_charging_planned_response and add 'on' to the list if not already there:
4/ Comment out the section for 'car_charging_now' and 'car_charging_now_response'.
This is required so that Predbat can be in charge of your charger rather than your car or something else
5/ Find the line for car_charger_battery_size and enter the sensor created earlier:
6/ Specify the car_charging_limit to use the Car Max Charge helper entity created earlier. You need one per car even if they are the same:
7/ Specify the car_charging_soc to use the Car Intiial Charge helper entity created earlier. You need one per car even if they are the same:
8/ Specify the car_charging_energy to use the entity provided by the wall charger.
car_charging_energy: sensor.ev_charger_energy_session9/ Find 'car_charging_exclusive and set it as below. This indicates that only one car will/can charge at any one time.
Save the apps.yaml file and exit. This will restart Predbat.
Check the addon's log and config in the app to make sure everything is ok.
In the config section of the Predbat app make sure the following switches are set to True:
Consult Predbat documentation for a detailed explanation of each one.
And turn off the Predbat control switch:
switch.predbat_octopus_intelligent_chargingFinally, for simplicity, add the below entities to your HA Dashboard so you can set them when needed.
I use mushroom cards but making nice dashboard is not my forte so please shares yours!
Once a car is plugged in the EV charger you just select the car you want to charge, enter the starting SOC and the target SOC.
Predbat will then plan and charge the car with the kW that are needed to reach the target SoC.
Beta Was this translation helpful? Give feedback.
All reactions