Skip to content

Services Reference

bolagnaise edited this page Apr 15, 2026 · 18 revisions

Services Reference

Core Services

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

Battery Control

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_soc auto-release after duration_minutes via a timer that schedules restore_normal on expiry.

hold_battery_soc caveats: Tesla and AlphaESS can't strictly lock the battery — the service call returns a warning field explaining that solar excess may still charge the battery. Sigenergy / Sungrow / FoxESS / GoodWe have native standby primitives and lock cleanly.

restore_normal per 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 source parameter. 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.

Tesla Powerwall Settings

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)

Tesla Powerwall Local Control

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).

Sungrow Battery Control

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)

Sigenergy Control (v2.5.0+)

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.

FoxESS Control (v2.5.0+)

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_w parameter 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.

Optimizer Control (v2.5.0+)

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.

AC Inverter Curtailment

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

Data Services

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

Clone this wiki locally