To the original poster...
What you are asking for is not as simple as it sounds.
I also have an Enphase system that was originally installed as just a grid tie setup with no storage. I then added storage and spent nearly 2 years before I got it to do what I want. Which is what you also want. Store the extra day time energy to use at night.
Here are the issues you need to deal with.
First off, you need to determine how much power is the "extra power". This can be done with a smart power meter of some kind. If you just use CTs at the main panel, they need to be able to tell import from export. Many cheaper meters can't.
Then you need a charger that can be controlled to use this extra power only. How accurate do you want to just consume this extra power for battery charging? For a while, I was just manually turning on the charger at a fixed current that would use about 80% of the extra solar I was typically getting. I had to change the amount of time and max current about every 2 weeks. It would use some grid power from 10 am to 11 am. Allow some expor from 11 am to 2 pm. Then use a little grid power again from 2 pm to 3 pm. The total energy into the battery was then close to my 80% of the extra solar.
Then I would power the loads in my sub panel completely from the batteries from 4 pm to 9 pm when the grid rate is higher. That was the easy part. But that does nothing for the loads back in the main panel.
If you don't mind only supplying the sub panel, and not perfectly matching the import/export power, an inverter/charger that can be set as a UPS can sort of do this. But you do need a timer to control the full power into the sub panel, and the inverter also needs to run the sub panel full load. On a "Time of Use" system. You just cut off the grid power into the inverter/charger. It will switch to invert mode. Hopefully quick enough to not crash a PC. The batteries will then run the sub panel loads. But now the tricky part. When do you put it back on the grid? With my "Time of Use" I had it run from 4 pm to 9 pm as that was the high rate time. After 9 pm, the grid cost was the same as at 10 am. But what if the battery did not store up enough? Oops. You would also need to monitor the battery state of charge and be able to turn the grid power back on before the battery goes too low. And without smart charging control, most inverter/charger units running in UPS mode will immediately start charging as soon as the grid power is restored to the input. It won't wait until you have extra solar coming in.
Doing like
@Shimmy suggested above, is similar to this. It can be made to work, but it is far from ideal.
You really need to think about what you are trying to do. And even my Schneider XW-Pro was not able to do it without external help. I had to add power meters and an external PLC controller to tell it what to do.
Since I built my system, things have certainly changed a bit. Some of the newer All in One systems are far more capable. But they are not going to be super cheap. I am still quite surprised that no one has come out with a dedicated AC coupled time of use shifting box. The closest on the market is the Tesla Powerwall2. There are a few others, but they all cost over $10,000 USD once you include batteries.