Automation for electricity price tomorrow

Hi guys.
I have just installed a battery system in my apartment.
I’m charging this when the electricity is “cheap” and using it the rest of the day.
But I have found a small issue with this automation.
(it automatically adjusts how many percent over the “Minimum price today” it allows charging)
If today’s “cheap hours” are more expensive than the average price tomorrow, I loose money by charging today.
I need help getting the home assistant to include tomorrow’s prices, today…

I suck at explaining so please ask, so I can try to explain whatever you don’t understand:)

As seen in the image below, the battery charged at 2pm - 5pm here. but if the automation had included the next day prices, it would have known that it will be slightly cheaper. In days like this, the battery might charge at a higher price, and use the power at a lower price. This is bad.