Skip to content

Services Reference

bolagnaise edited this page Apr 25, 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 level (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 normal operation None

Brand coverage: All services work for Tesla, Sigenergy, Sungrow, FoxESS, GoodWe, AlphaESS, Solax Hybrid, ESY Sunhome, and SAJ H2/HS2. Force modes auto-release after duration_minutes via a timer. ESY Sunhome and SAJ H2/HS2 do not support set_backup_reserve (logged as no-op). ESY Sunhome uses mode-only control — charge/discharge power level is firmware-managed.

hold_battery_soc note: Tesla and AlphaESS can't strictly lock the battery — solar excess may still charge it. Sigenergy, Sungrow, FoxESS, and GoodWe have native standby modes and lock cleanly. The service returns a warning field explaining any limitation.

Manual vs optimizer activity: Force modes triggered manually (mobile app, automations, Developer Tools) appear on the Controls screen countdown. Actions taken by the optimizer appear 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 duration_minutes (optional)
power_sync.sigenergy_restore_normal Restore normal self-consumption mode None

Note: Backup reserve is saved before force modes and restored automatically when restore_normal is called.

FoxESS Control (v2.5.0+)

Service Description Parameters
power_sync.foxess_force_charge Force charge from grid duration_minutes (optional), power_w (optional)
power_sync.foxess_force_discharge Force discharge to grid duration_minutes (optional), power_w (optional)
power_sync.foxess_restore_normal Restore normal operation 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 level. If omitted, the inverter's configured maximum is used.

Optimizer Control (v2.5.0+)

Service Description Parameters
power_sync.enable_optimizer Enable the Smart Optimizer None
power_sync.disable_optimizer Disable the Smart 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). Not needed for Sungrow, Sigenergy, GoodWe, AlphaESS, ESY Sunhome, or FoxESS H3 Smart — state of health is read automatically for these systems. None

Clone this wiki locally