Set energy mode
set_energy_modeSwitch a solar site's energy mode or tune Ai+ settings, and schedule manual charge/discharge windows. Changes apply within a minute and require user confirmation.
Instructions
CHANGES THE SITE (control scope). Confirm with the user before calling.
Switch how the site is run (pass mode), or tune Ai+ without switching (omit mode, pass settings and/or variant). A rejected value changes nothing; rejected says why.
mode=forced is manual and time-boxed: the site returns to its previous mode when duration_minutes is up. Give action for one window starting now, or time_slots. Refused (409) while a strategy is running, or when an au_* mode cannot run on the site. Takes effect within about a minute; the SOC floor and export limits hold. On a demo site (sandbox:...) nothing reaches hardware.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"site_id": "<site_id>"
},
"name": "set_energy_mode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | How to run the site: selfConsumption (inverter default); amber_smart (Ai+, price-driven trading); au_forecast_export, au_negative_price, au_smart_energy, au_weather_season (the AU-01..04 student strategies, described in get_agent_guide); forced (manual charge / discharge windows). Omitted = keep the mode and change Ai+ only. | |
| action | No | forced: one window starting now and lasting duration_minutes. Use this or time_slots. | |
| power_w | No | With action: the charge / discharge power in W. | |
| site_id | Yes | Site id from list_sites: vendor:station_id, e.g. sungrow:1445844. | |
| variant | No | Ai+ engine variant, one of get_energy_mode `ai_plus.variant_options`: with mode=amber_smart the engine to switch to, without mode a change of engine in place. | |
| settings | No | Without mode: the Ai+ levers to change, names and ranges from get_energy_mode `ai_plus.tunable`. With an au_* mode: that strategy's own numbers, e.g. {"reserve_soc": 60}. Refused with mode=amber_smart. | |
| stop_soc | No | With action=discharge: stop discharging at this SOC, 0 to 100. | |
| target_soc | No | With action=charge: stop charging at this SOC, 0 to 100. | |
| time_slots | No | forced: the windows, in site local time. Each is {"type": charge | discharge, "start": "HH:MM", "end": "HH:MM" (earlier than start = crosses midnight), "target_soc" (charge) or "stop_soc" (discharge), "power": W, "pace": true to spread a discharge so stop_soc is reached exactly at end}. plan_discharge returns them ready to pass. | |
| duration_minutes | No | With mode: hand the site back to its previous mode after this many minutes, at most 1440. forced is always time-boxed (240 when omitted); other modes stay until changed unless this is given. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |