I've captured some requests and responses to Tesla's servers for the ap, for those who already know how to access the servers.
POST /api/1/energy_sites/nnn/time_of_use_settings
where nnn is your site id.
{"tou_settings":{"optimization_strategy":"economics","schedule":[{"target":"peak","week_days":[1,2,3,4,5],"start_seconds":50400,"end_seconds":75600},{"target":"off_peak","week_days":[1,2,3,4,5],"start_seconds":79200,"end_seconds":27000},{"target":"peak","week_days":[0,6],"start_seconds":null,"end_seconds":null},{"target":"off_peak","week_days":[0,6],"start_seconds":79200,"end_seconds":25200}]}}
{"tou_settings":{"optimization_strategy":"balanced","schedule":[{"target":"peak","week_days":[1,2,3,4,5],"start_seconds":50400,"end_seconds":75600,"timestamp":1533354852668,"receipt_timestamp":1533354852668},{"target":"off_peak","week_days":[1,2,3,4,5],"start_seconds":79200,"end_seconds":27000,"timestamp":1533354852668,"receipt_timestamp":1533354852668},{"target":"peak","week_days":[0,6],"start_seconds":null,"end_seconds":null,"timestamp":1533354852668,"receipt_timestamp":1533354852668},{"target":"off_peak","week_days":[0,6],"start_seconds":79200,"end_seconds":25200,"timestamp":1533354852668,"receipt_timestamp":1533354852668}]}}
It appears that it only includes the "timestamp" values when you change between balanced and cost saving, and vice versa.
Changing the backup reserve
POST /api/1/energy_sites/nnnn/backup
{"backup_reserve_percent":67}
Changing modes:
POST /api/1/energy_sites/nnn/operation
{"default_real_mode":"backup"}
{"default_real_mode":"self_consumption"}
{"default_real_mode":"autonomous"}
This latter is for "Advanced mode, or TOU".
In all cases the respone is
{"response":{"Code":201,"Message":"Updated"}}
It may be that the "default_real_mode" is just "default_mode" prior to firmware 1.21.0
POST /api/1/energy_sites/nnn/time_of_use_settings
where nnn is your site id.
{"tou_settings":{"optimization_strategy":"economics","schedule":[{"target":"peak","week_days":[1,2,3,4,5],"start_seconds":50400,"end_seconds":75600},{"target":"off_peak","week_days":[1,2,3,4,5],"start_seconds":79200,"end_seconds":27000},{"target":"peak","week_days":[0,6],"start_seconds":null,"end_seconds":null},{"target":"off_peak","week_days":[0,6],"start_seconds":79200,"end_seconds":25200}]}}
{"tou_settings":{"optimization_strategy":"balanced","schedule":[{"target":"peak","week_days":[1,2,3,4,5],"start_seconds":50400,"end_seconds":75600,"timestamp":1533354852668,"receipt_timestamp":1533354852668},{"target":"off_peak","week_days":[1,2,3,4,5],"start_seconds":79200,"end_seconds":27000,"timestamp":1533354852668,"receipt_timestamp":1533354852668},{"target":"peak","week_days":[0,6],"start_seconds":null,"end_seconds":null,"timestamp":1533354852668,"receipt_timestamp":1533354852668},{"target":"off_peak","week_days":[0,6],"start_seconds":79200,"end_seconds":25200,"timestamp":1533354852668,"receipt_timestamp":1533354852668}]}}
It appears that it only includes the "timestamp" values when you change between balanced and cost saving, and vice versa.
Changing the backup reserve
POST /api/1/energy_sites/nnnn/backup
{"backup_reserve_percent":67}
Changing modes:
POST /api/1/energy_sites/nnn/operation
{"default_real_mode":"backup"}
{"default_real_mode":"self_consumption"}
{"default_real_mode":"autonomous"}
This latter is for "Advanced mode, or TOU".
In all cases the respone is
{"response":{"Code":201,"Message":"Updated"}}
It may be that the "default_real_mode" is just "default_mode" prior to firmware 1.21.0