Preview or start strategy
start_strategyPreview and start custom solar battery strategies from ordered rules: dry-run on current readings returns a proposal ID, then confirm to activate or replace a running one.
Instructions
Preview or start a custom strategy: YOU write the rules from what the person wants. Two calls, the second needs the first.
accept_risk=false (default): starts nothing; dry-runs the rules on the current readings and returns a proposal_id. A card host shows a Start button that makes call 2 itself, so wait; otherwise read the rules back and ask.
accept_risk=true with that proposal_id and every other argument unchanged, only after the person said yes (control scope; demo sites dry-run). Refused without a matching proposal_id or after 15 minutes: preview again.
A strategy already running has its rules replaced by the same two calls.
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": "<name>",
"rules": "<rules>"
},
"name": "start_strategy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Short name for the strategy, up to 100 characters. | |
| rules | Yes | The rules, checked in order; first match wins. At most 20 rules, 4 conditions each (all must hold). Each rule is {"when": [conditions], "then": action, "note": "why, in the person's words"}. A condition is {"metric": soc | import_price | export_price | hour, "operator": above | below | between, "value": n}; between takes "low" and "high" instead of "value". soc is %, prices are c/kWh for the current interval, hour is site local time as a decimal (17.5 = 5:30 pm; low > high wraps midnight). An action is {"action": charge | discharge | hold | auto, "power_w"?, "target_soc"? (charge), "stop_soc"? (discharge)}. | |
| site_id | Yes | Site id from list_sites: vendor:station_id, e.g. sungrow:1445844. | |
| summary | No | What the strategy does, in a paragraph for the person to read; up to 600 characters. | |
| fallback | No | The action when no rule matches, shaped like a rule's `then`. Omitted = {"action": "auto"}. | |
| accept_risk | No | false = preview only, nothing starts. true = start what was previewed, only after the person said yes. | |
| proposal_id | No | `proposal_id` from the preview of these same arguments; needed with accept_risk=true. | |
| duration_minutes | No | The lease: how long the strategy runs, 15 to 10080 minutes. A new strategy runs for a day when omitted; a running one keeps its lease unless this is given. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||