The battery discharges only as much as household load or max battery rate (5 kW per battery), whichever is less. I don't see anything inside the app that lets you configure the battery to discharge to the grid. It must be possible, but I imagine Tesla isn't pushing the pure arbitrage angle as much.
I should clarify that I've never charged the battery to full on battery only. I typically run in self-powered mode at 40% reserve capacity, and at that point, solar charges the battery to a maximum of 90%. However, I can configure a reserve level of 100% in self-powered mode, and I don't know what happens when I do that. Haven't run on battery only long enough to charge it to that point, either.
Anyway, when solar generation is available, the behaviour depends on whether the battery charge is above or below the reserve level. If it's below the reserve level, the software tries to charge the battery as quickly as possible, so it'll charge it from both available solar and the grid. If it's above, then it'll only charge from solar. Factoring household loads into the mix, we get these scenarios:
Battery above reserve level, solar generation greater than house loads:
- Battery is charged using leftover solar generation
- If battery is fully charged (90% in my case, see note above), leftover solar generation goes to the grid
Battery above reserve level, solar generation less than house loads:
- Battery discharges to cover the difference between solar and house load
- No power to/from grid
Battery below reserve level:
- Battery charged at maximum rate using grid and any remaining solar generation after house load is met
- If house load exceeds solar generation, then battery is charged entirely off the grid and grid supplies the differential house need
Mapping this to your scenario, I get:
Midnight (battery 0%):
- Set battery to backup-only mode
- Battery charges to 100% off grid at max rate (about 1 h 20 min per battery)
- House loads supplied off of grid
6am-10am:
- PV kicks in
- Grid still off-peak
- Leave battery in backup-only mode; house loads supplied off of PV and grid
10am-5pm:
- Grid goes to peak
- Switch battery to self-powered, reserve level 0%
- House loads supplied off of PV and battery (unless battery maximum of 5 kW per battery is hit, in which case, grid supplies the rest)
- Any excess PV first recharges battery (to 90%; see above), and then goes to grid
- If battery is discharged at any time during this period, house loads revert to PV and grid
5pm-midnight:
- PV down
- House loads supplied entirely off of PV and battery, just like 10am-5pm
- Once PV falls off entirely, house supplied off of battery to battery max of 5 kW/battery, and then grid supplies the rest
- Once battery hits 0%, house supplied by grid entirely
Regarding your question on whether it's possible to force the battery to discharge even when sufficient PV is available to charge it, I don't see any way to do this, unfortunately. This would be similar to doing arbitrage by charging the battery at off-peak and then forcing the battery to discharge into the grid at peak, and there's no way to force the battery to discharge that way. Nor is there a way to force the battery to not charge even when there is available PV. These seem like arbitrary limitations removable in software, but I could see Tesla being less interested in giving its customers the means to profit maximally off this arbitrage.