There are already companies doing this in the UK such as Octopus with their Agile tarrif[0]. the unit price you pay changes every 30 minutes based on the wholesale price at the time. It's capped at 100p/kwh, which is 3x the average flat rate people use in the UK, but on the flip side it can go below 0p and at those points you actually get paid for using electicity. In those cases you're acting as a load balancer when there's just too much energy in the network. You can see a graph of the past prices here[1].
Octopus also has a pretty good API and hooks in IFTTT so you can set up automations for yourself. You could set your car or home bettery when the price is under a certain price. This could also just be built into the charge in the future and there's no reason why it couldn't be a standard between energy providers too.
[0] https://octopus.energy/agile/ [1] https://dashboards.energy-stats.uk/d/5cZqqmf4z/user-dashboar...