You don't need a separate grid, just use a product like [1] to connect the grid to your house and a battery[2], and then connect the solar panels to the battery.
North American products pictured, European versions probably available, but perhaps from a different vendor.
1: https://us.ecoflow.com/products/smart-home-panel 2: https://us.ecoflow.com/products/delta-pro-portable-power-sta...