This is an automated archive made by the Lemmit Bot.
The original was posted on /r/homeassistant by /u/k0enf0rNL on 2025-12-19 15:00:31+00:00.
So I just got a Hyundai Ioniq 5 2 weeks ago and I've created several automations to charge my EV at the cheapest times of the day. It is connected to my Google Calendar and uses the Google Routes API to figure out how much charge I need for the next event where I need the car.
When the car is plugged in it determines what charging strategy it should use based on the current charge and what I need for the next event in the calendar.
When the car is below 25% it starts charging immediately to 25% charge, no matter the current price.
Above 25% and below the target it will figure out how many minutes of charging it needs to reach the target and then calculates which moments to charge the car before the next event based on the energy prices.
Above the target it will charge the car when prices are cheap (below €0,20 per kWh for now) and calculates which of those moments where the price is cheap to use to get up to 80% charge. For example if the car needs only 30 minutes of charging and there are 2 moments of 15 minutes where the price is €0,16 per kWh it will use those 2 moments instead of other moments where the price is below €0,20 per kWh.
If prices are below €0,16 per kWh and the average of the day is above €0,22 (like last night) then it will charge to 100%. It will also charge to 100% if it has been 1 month since the last time it was charged to 100%, this is to extend the life of the battery. it will only do so if prices are below €0,20 per kWh.
When prices are not cheap enough the car will charge purely on solar energy.
To do all this I created some helpers which gather all events on the next day I need the car, total amount of km's that I need to drive for those events, the battery target based on the km's and an estimate of the amount of charge in the car because the car updates every 4 hours and I don't want to make that quicker and drain the 12V battery.
I also created the automations to charge the car at the right time of the day using a script which calculates the cheapest price window based on the amount of minutes I need and before which datetime I need it.
And to make it easily visible how much I have saved I used the Dynamic energy cost integration to track the actual cost per session, the normal cost for the session (using the daily price average), the total savings this session and the total savings since I started to track it.
This is what the dashboard looks like for now (forgive the Dutch)
https://preview.redd.it/3xd48o3uc68g1.png?width=1028&format=png&auto=webp&s=0ba4f8947fd4f1619fe6651ca4d6e58b3f3d1f83
Top right: Battery estimate (resets when car updates status)
Bottom left of top section: Total km's next day I need the car
Button top of middle section: Start charging the car NOW
Left select box of middle section: Charging strategy currently being executed (emergency, smart charge to target, cheap and force)
Right select box of middle section: Current state of the charger (currently pure solar)
Then the bottom section is Real session cost, Normal session cost, savings this session, total savings
Quite happy with how everything works so far, saved €2,73 last night which is about 34%. I will report back in a couple months to see how much home assistant has saved me.