-
-
Notifications
You must be signed in to change notification settings - Fork 16
Services Reference
| Service | Description | Parameters |
|---|---|---|
power_sync.sync_tou_schedule |
Manually sync TOU tariff to battery | None |
power_sync.sync_now |
Refresh data from provider and battery | None |
| Service | Description | Parameters |
|---|---|---|
power_sync.force_charge |
Force charge from grid |
duration_minutes (required), power_w (optional) |
power_sync.force_discharge |
Force discharge to grid |
duration_minutes (required), power_w (optional) |
power_sync.hold_battery_soc |
Hold battery at its current SoC (block charge + discharge) |
duration_minutes (required) |
power_sync.set_self_consumption |
Pure self-consumption mode (ignore TOU pricing) | None (persistent toggle) |
power_sync.restore_normal |
Cancel any active force mode and return to autonomous operation | None |
Brand coverage: All five services dispatch to the correct brand-specific handler automatically — Tesla, Sigenergy, Sungrow, FoxESS, GoodWe, and AlphaESS are supported.
force_charge/force_discharge/hold_battery_socauto-release afterduration_minutesvia a timer that schedulesrestore_normalon expiry.
hold_battery_soccaveats: Tesla and AlphaESS can't strictly lock the battery — the service call returns awarningfield explaining that solar excess may still charge the battery. Sigenergy / Sungrow / FoxESS / GoodWe have native standby primitives and lock cleanly.
restore_normalper brand: the service name describes intent ("go back to autonomous"), but implementation varies. Tesla also restores any saved TOU tariff + operation mode + backup reserve. Modbus brands (Sigenergy / Sungrow / FoxESS / GoodWe / AlphaESS) clear their respective forced-dispatch registers and return to self-consumption. Both paths end in the same user-visible state.Manual vs optimizer state: all force-mode services accept an internal
sourceparameter. When the LP optimizer calls them (source: "optimizer"), the handler executes the hardware write but does NOT populate the user-facing state dicts, start a countdown timer, or emit mobile dispatcher events. Manual activity (mobile buttons, Developer Tools calls, automations) is the only thing that appears on the Controls screen countdown; optimizer activity is visible separately on the Smart Optimization screen.
| Service | Description | Parameters |
|---|---|---|
power_sync.set_backup_reserve |
Set backup reserve percentage |
backup_reserve (0-100) |
power_sync.set_operation_mode |
Set operation mode |
mode (autonomous, self_consumption, backup) |
power_sync.set_grid_export |
Set grid export behaviour |
export (everything, pv_only, never) |
power_sync.set_grid_charging |
Enable/disable grid charging |
enabled (true/false) |
| Service | Description | Parameters |
|---|---|---|
power_sync.powerwall_go_off_grid |
Physically disconnect from grid (open contactor) | None |
power_sync.powerwall_reconnect_grid |
Reconnect to grid (close contactor) | None |
Requires completed gateway pairing. Available for Powerwall 3 (uses signed cloud commands) and Powerwall 2 (uses local REST API).
| Service | Description | Parameters |
|---|---|---|
power_sync.sungrow_force_charge |
Force charge from grid |
duration_minutes (optional) |
power_sync.sungrow_force_discharge |
Force discharge to grid |
duration_minutes (optional) |
power_sync.sungrow_restore_normal |
Restore self-consumption mode | None |
power_sync.sungrow_set_backup_reserve |
Set backup reserve percentage |
percent (0-100) |
power_sync.sungrow_set_charge_rate |
Set max charge rate |
kw (kilowatts) |
power_sync.sungrow_set_discharge_rate |
Set max discharge rate |
kw (kilowatts) |
power_sync.sungrow_set_export_limit |
Set grid export limit |
watts (0 to disable) |
| Service | Description | Parameters |
|---|---|---|
power_sync.sigenergy_force_charge |
Force charge battery from grid |
duration_minutes (optional) |
power_sync.sigenergy_force_discharge |
Force discharge battery to grid (ESS mode) |
duration_minutes (optional) |
power_sync.sigenergy_restore_normal |
Restore Maximum Self Consumption mode | None |
Note: Force discharge uses Remote EMS DISCHARGE_ESS mode with active power targeting for full grid export. Backup reserve is saved before force modes and restored on
restore_normal.
| Service | Description | Parameters |
|---|---|---|
power_sync.foxess_force_charge |
Force charge from grid via remote control |
duration_minutes (optional), power_w (optional) |
power_sync.foxess_force_discharge |
Force discharge to grid via remote control |
duration_minutes (optional), power_w (optional) |
power_sync.foxess_restore_normal |
Clear remote control, restore work mode | None |
power_sync.foxess_set_work_mode |
Set inverter work mode |
mode (self_use, feed_in, backup) |
power_sync.foxess_set_min_soc |
Set minimum SOC / backup reserve |
percent (0-100) |
Note: The
power_wparameter sets the force mode power setpoint. If omitted, the inverter's maximum charge/discharge current is used. H3-Pro/Smart use Grid targeting (0x0009) for force discharge.
| Service | Description | Parameters |
|---|---|---|
power_sync.enable_optimizer |
Enable the LP optimizer | None |
power_sync.disable_optimizer |
Disable the LP optimizer | None |
These can be used in automations — for example, disable the optimizer during a manual force charge and re-enable it afterwards.
| Service | Description | Parameters |
|---|---|---|
power_sync.curtail_inverter |
Manually curtail AC inverter to zero export | None |
power_sync.restore_inverter |
Restore AC inverter to normal operation | None |
| Service | Description | Parameters |
|---|---|---|
power_sync.get_calendar_history |
Get energy history (for mobile app) |
start_date, end_date
|
power_sync.sync_battery_health |
Sync battery health data (Tesla TEDAPI / blueprint). Not needed for Sungrow, Sigenergy, GoodWe, or AlphaESS — SOH is read automatically. | None |