There are two approaches for doing this:
Method 1: You can allow the grid to purchase electricity from your system, even when using an unreliable grid. To do this, set up a generator component as an unreliable "grid" as described in article 10463. Then, add an actual grid component to your model (i.e. select "System is connected to grid" in the Add/Remove equipment window), and set the "Purchase Capacity" on the Advanced tab of your grid to zero. You can then specify a sellback rate for any unused energy on the Rates tab of your grid. If you use this technqiue, you may wish to set the sellback rate to $0/kWh when the grid is unavailable. This will still allow sellback to the grid when it is down. However, it will not provide any benefit for doing so, so the economics will be equivalent to a system that did not sell back to the grid.
Method 2: Instead of actually modeling the sellback with the grid component, you could account for any income from selling energy to the utility after the simulation completes by multiplying excess electricity by the grid sales price.