能量端点
POST /api/1/energy_sites/{energy_site_id}/backupAdjust the site's backup reserve.
GET /api/1/energy_sites/{energy_site_id}/calendar_history?kind=backup&start_date={start_date}&end_date={end_date}&period={period}&time_zone={time_zone}Returns the backup (off-grid) event history of the site in duration of seconds.
GET /api/1/energy_sites/{energy_site_id}/telemetry_history?kind=charge&start_date={start_date}&end_date={end_date}&time_zone={time_zone}Returns the charging history of a wall connector.
- Energy values are in watt hours.
 
GET /api/1/energy_sites/{energy_site_id}/calendar_history?kind=energy&start_date={start_date}&end_date={end_date}&period={period}&time_zone={time_zone}Returns the energy measurements of the site, aggregated to the requested period.
- Energy values are in watt hours.
 - Visit https://www.tesla.cn/support/energy/powerwall/mobile-app/energy-data for more info.
 
POST /api/1/energy_sites/{energy_site_id}/grid_import_exportAllow/disallow charging from the grid and exporting energy to the grid.
GET /api/1/energy_sites/{energy_site_id}/live_statusReturns the live status of the site (power, state of energy, grid status, storm mode).
- Power values are in watts.
 - Energy values are in watt hours.
 
POST /api/1/energy_sites/{energy_site_id}/off_grid_vehicle_charging_reserveAdjust the site's off-grid vehicle charging backup reserve.
POST /api/1/energy_sites/{energy_site_id}/operationSet the site's mode.
- Use autonomous for time-based control and self_consumption for self-powered mode.
 - Visit https://www.tesla.cn/support/energy/powerwall/mobile-app/powerwall-modes for more info.
 
GET /api/1/energy_sites/{energy_site_id}/site_infoReturns information about the site. Things like assets (has solar, etc), settings (backup reserve, etc), and features (storm_mode_capable, etc).
- Power values are in watts.
 - Energy values are in watt hours.
 - default_real_mode can be autonomous for time-based control and self_consumption for self-powered mode.
 
POST /api/1/energy_sites/{energy_site_id}/storm_modeUpdate storm watch participation.
- Visit https://www.tesla.cn/support/energy/powerwall/mobile-app/storm-watch for more info.
 
POST /api/1/energy_sites/{energy_site_id}/time_of_use_settings更改住宅的电费时段价格. 如需获取更多信息,请访问 https://www.tesla.cn/support/energy/powerwall/mobile-app/utility-rate-plans . 请求体参数中的tou_settings.tariff_content_v2 就是电费时段价格. 范例可见 https://digitalassets-energy.tesla.cn/raw/upload/app/fleet-api/example-tariff/PGE-EV2-A.json. 在构建请求时,请注意:
- 需至少创建一个 季度 的价格. 季度可以被随意命名。每个季度包含一年内不同的月份和天数。每个季度内每天不同时段可有不同价格。
 - demand_charges 标识用电高峰期的额外费用,住宅区一般不缴此费. 普通住宅区应使用 energy_charges 表明费用.
 - 在 energy_charges 或者 demand_charges 中,ALL规定的费用适用于所有时段. 如果电费价格不安时段变化,请使用ALL表示。
 - 电价可为以下币种: USD, EUR, GBP
 - 电价时段名称可自定义,但仅有有以下可被手机应用展示: ON_PEAK, OFF_PEAK, PARTIAL_PEAK or SUPER_OFF_PEAK.
 - 电费时段及价格须保证:
- 时段不重叠
 - 总时段不留空隙
 - 季度不重叠,总体不留空隙
 - 每组买入卖出价格都需有对应的季节时段
 - 每个季节里的时段都需要有相对应的价格
 - 价格不可为负,系统会把负数自动归零。请使用税后电价
 - 买入价不可以比卖出价格低。如果低,系统自动将买入价调成卖出价