TL,DR: This exists in parts of europe
Doing it in real time like you are suggesting (I think?) would make it hard to adapt to, as many consumers cannot be switched at will (dishwasher, dryer etc.) or needs to keep a certain state (water heater). Also, as far as I can tell none of the common solar inverters can regulate output to the grid (beyond turning off entirely) and batteries are not financially viable yet for most people.
In Norway (and a few other European countries) we have hourly pricing that is set the day before based on projected production and consumption (see: https://en.wikipedia.org/wiki/Nord_Pool). This has the same effect, but makes planning and actually taking action according to the price fluctuations much easier for the customer. More and more companies here are making smart products that can help with this, as well as hobbyists making add-ons for smart home systems to control when power is used. I use Home Assistant and currently have my water heater running the cheapest hours of the day, working on the mini-split and bathroom heat next. When I get my solar install later this summer I’ll be moving those loads to use solar as much as possible, with cheapest hours as the backup option if there is no sun. Pretty much exactly what OP wants to achieve, no?
The grid and electricity are also handled by separate companies here, to reduce abuse and exploitation and create competition wherever possible. The grid is owned by municipal companies that have limits set on their yearly income, while the electricity is handled by private companies trading electricity and competing to provide better plans for the customers. Several are offering electricity basically at cost, opting instead to try and make money of smart devices and apps to help their customers spend less on electricity and thus further helping move loads according to prices.
It’s all a bit complicated to explain so i hope this makes any sense at all. It’s not a perfect system, but it does seem to work and will hopefully only get better as smart home technology catches up.
I have a couple of these too, they are quite convenient in that they do motion, luminescence, and temperature. I have two and combine them in a single sensor to average out for better accuracy.