I am obsessed with the Tesla power wall product. We are getting them for the properties we own where we have solar.
This video below explains how the power wall works in combination with solar panels, the grid, and your electrical usage.
I particularly like this screen shot from the Tesla app that shows the power flows between the four systems:
Anyway, if you are as into this stuff as I am, you will enjoy this video.