Aivy Energy
v0.9.2Read and control your own home solar + battery: Sungrow, Sigenergy, FoxESS, AlphaESS, SolaX.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_registration_terms
Whether sign-up is open and the terms of use / privacy policy a new account accepts (version, hash and a link). Show the link to the person and ask whether they accept BEFORE register_account. Hosts that support cards render a sign-up / sign-in form here instead: the person types email and password into the card, which calls register_account / verify_registration / sign_in itself, so nothing passes through the chat. When the card is shown, wait for the person to say they are done.
| Parameter | Type | Description |
|---|---|---|
locale | string |
list_sites
List the user's solar + battery sites across vendors. Returns id (vendor:station_id, used by every other tool), vendor, name, online and the vendor's headline power in W. Start here.
get_status
Live reading: SOC (%), pv_w, load_w, grid_w (>0 exporting), battery_w (>0 charging). A null channel is one the vendor does not report, not zero. `source` is vendor (fresh) or stored (last kept reading). Hosts that support cards render this as a status card.
| Parameter | Type | Description |
|---|---|---|
site_id * | string |
get_curve
Power and SOC history. range 1d = 5-minute points for one local day (day = YYYY-MM-DD, default today); 7d / 30d = daily values. Returns times (UTC), local_times, and series per channel (pv, load, battery, grid, soc). Large: summarise before quoting.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | |
day | ||
range | string |
get_earnings
Energy bought, sold and self-consumed for a day (YYYY-MM-DD, 'today' or 'yesterday'), priced at the actual Amber half-hourly prices when Amber is linked. Optional HH:MM window for part of the day. An estimate from vendor power samples, not the bill; read `coverage` and say so when it is partial.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | |
date | ||
window_end | ||
window_start |
get_operations
What the platform did to the site and why, newest first: each automatic (Ai+) and manual command with its reason and the prices at the time. Use it to explain 'why did it charge at 3am'.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | |
limit | integer |
get_prices
Amber Electric prices for the site: the current interval and the forecast as import price and feed-in earn (c/kWh incl. GST), with a summary of cheapest/dearest periods. resolution 30 (up to 24 h) or 5 (up to 4 h). Fails with 409 when no Amber account is linked to the site. Hosts that support cards render a price chart.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | |
hours | integer | |
resolution | integer |
list_vendors
Every inverter / battery brand Aivy can connect, whether it is available on this deployment, what connecting one needs (`connect`: serial + NMI, a system id, or an OAuth sign-in at the vendor) and how much of it can be controlled. Use before connect_site.
list_alerts
The account's alert rules on a site: what each watches (soc %, import/export price c/kWh, forecast temperature °C), above/below which threshold, whether it emails, and when it last fired.
| Parameter | Type | Description |
|---|---|---|
site_id * | string |
get_energy_mode
Current energy mode (selfConsumption | amber_smart = Ai+ | forced), its forced windows, the SOC floor, the Ai+ variant and settings when on Ai+, and any pending timed hand-back (reverts_at / reverts_to).
| Parameter | Type | Description |
|---|---|---|
site_id * | string |
get_ai_plus
Ai+ (amber_smart) configuration: active or not, engine variant and options, effective settings, and `tunable`: every lever with type, min, max, unit and default. Read before update_ai_plus.
| Parameter | Type | Description |
|---|---|---|
site_id * | string |
plan_best_price_discharge
Propose when to sell: picks the best-paid Amber intervals in the window (HH:MM) for the battery's usable energy above reserve_soc, optionally only above min_sell_c c/kWh. Returns intervals, expected revenue, the average it beats and proposed time_slots. Nothing is applied; apply with set_energy_mode(mode='forced', time_slots=...) after the user agrees. Hosts that support cards show the plan with an Apply button; a click on it is the user's yes.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | |
battery_capacity_kwh | ||
min_sell_c | ||
reserve_soc | ||
window_end | ||
window_start |
plan_discharge_to_target
Propose a steady discharge that lands on target_soc at end (HH:MM, site local), from the real capacity, SOC and power limits. Returns power_w and proposed time_slots. Nothing is applied.
| Parameter | Type | Description |
|---|---|---|
end * | string | |
site_id * | string | |
target_soc * | integer | |
battery_capacity_kwh | ||
start |
register_account
Create an Aivy account from the chat, step 1 of 2: a verification code is emailed to `email`. Needs no API key. Ask the person to choose the password (8+ characters; it is also their Aivy app password); do not invent one. Then ask them for the code and call verify_registration. The reply looks the same whether or not the address already has an account: a code that never arrives means check spam or use sign_in instead.
| Parameter | Type | Description |
|---|---|---|
email * | string | |
password * | string | |
display_name | ||
locale | string |
verify_registration
Create an Aivy account from the chat, step 2 of 2: confirms the emailed code, accepts the terms (only pass accept_terms=true after the person said yes), creates the account and an API key, and stores that key on this computer (~/.aivy/credentials.json) so every other tool works from now on, in this and future sessions. scope read (observe) or control (may change settings; only if the person asked). Never repeat the key back; say it is saved and can be managed at https://bridge.ivyenergy.com.au/account.
| Parameter | Type | Description |
|---|---|---|
accept_terms * | boolean | |
code * | string | |
registration_id * | string | |
registration_session * | string | |
key_name | string | |
scope | string |
sign_in
Use an existing Aivy account from the chat: creates an API key with the account's username (or email) and password, stores it on this computer (~/.aivy/credentials.json) and uses it from now on. Needs no existing key. scope read or control (control only if the person asked). The password is used once and not stored; never repeat the key back.
| Parameter | Type | Description |
|---|---|---|
password * | string | |
username * | string | |
key_name | string | |
scope | string |
get_agent_guide
The Aivy agent playbook: which tools answer which questions, the rules for writes (confirm first, forced mode is time-boxed, never guess numbers, do not poll), the step-by-step workflows (status, diagnosis, prices, earnings, selling tonight, keeping a reserve, charging now, connecting a system, Ai+ tuning) and what each error code means. Read it once at the start of a conversation.
whoami
Check the API key: who it belongs to and whether it may control (scope read or control). Without a key it says so: then register_account (new) or sign_in (existing account) sets one up from the chat.
get_site
Facts about one site: timezone, battery capacity (kWh) and where that figure came from, max charge/discharge power (W), export limit (W), the SOC floor Ai+ keeps, live SOC and usable kWh, current energy mode and forced windows, today's energy and income when the vendor reports them.
| Parameter | Type | Description |
|---|---|---|
site_id * | string |
connect_site
CHANGES THE ACCOUNT (control scope). Confirm with the user before calling. Link the user's system to their Aivy account. Serial-number vendors (Sungrow and FoxESS need sn + nmi, Sigenergy needs system_id, most others sn) return `connected` site ids. OAuth vendors (AlphaESS, SolaX) return an `authorize_url`: give it to the user to open in a browser and approve; the site then appears in list_sites within a minute. Demo sites need no connecting.
| Parameter | Type | Description |
|---|---|---|
vendor * | string | |
nmi | ||
region | string | |
sn | ||
system_id |
disconnect_site
CHANGES THE ACCOUNT (control scope). Confirm with the user before calling. Remove a site from the user's account. The vendor-side link and history are left alone; the account just stops seeing it. Demo sites cannot be removed.
| Parameter | Type | Description |
|---|---|---|
site_id * | string |
create_alert
Set up a threshold alert: metric soc | import_price | export_price | temperature, operator above | below. Every firing goes to the app inbox (and the phone when the app is installed); email=True also mails the account's verified address (whoami.email_alerts says whether that works). Quiet for cooldown_minutes after each firing (min 15). An alert only tells the person something; it never changes what the battery does. Confirm the rule with the user before creating it.
| Parameter | Type | Description |
|---|---|---|
metric * | string | |
name * | string | |
operator * | string | |
site_id * | string | |
threshold * | number | |
active_end | string | |
active_start | string | |
cooldown_minutes | integer | |
email | boolean | |
locale | string | |
message | string |
delete_alert
Retire an alert rule (past firings stay in the inbox). Confirm with the user first.
| Parameter | Type | Description |
|---|---|---|
rule_id * | integer | |
site_id * | string |
get_alert_events
What fired on the site, newest first: the rule, the value that tripped it, when, how it was delivered and whether it was emailed. Use for 'did anything happen overnight?'.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | |
limit | integer |
send_test_alert_email
Send one test alert email to the account's verified address so the person sees what an alert looks like. 409 when the account has no verified email.
set_energy_mode
CHANGES THE SITE (control scope). Confirm with the user before calling. mode: selfConsumption (inverter default), amber_smart (Ai+, price-driven trading) or forced (manual windows). forced is always time-boxed: duration_minutes (default 240, max 1440); afterwards the server returns the site to the mode it had before. Shorthand for forced: action=charge|discharge with power_w and target_soc (charge) or stop_soc (discharge) builds one window starting now. Or pass explicit time_slots: [{type, start 'HH:MM', end 'HH:MM', target_soc|stop_soc, power, pace}] in site local time.…
| Parameter | Type | Description |
|---|---|---|
mode * | string | |
site_id * | string | |
action | ||
duration_minutes | ||
power_w | ||
stop_soc | ||
target_soc | ||
time_slots | ||
variant |
update_ai_plus
CHANGES THE SITE (control scope). Confirm with the user before calling. Set Ai+ levers (names and ranges from get_ai_plus `tunable`) and/or switch engine variant. Validated against the variant that will run; if any value is rejected nothing changes and `rejected` says why. Does not switch the mode: use set_energy_mode(mode='amber_smart') for that.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | |
settings | ||
variant |