Skip to content

Controls and Automations

bolagnaise edited this page Oct 15, 2026 · 1 revision

Controls and automations

PowerSync configuration, entity controls, HA services and mobile automations are different surfaces. Use Configuration for setup fields, Services Reference for supported YAML/service calls and Mobile App for client navigation.

Manual controls

Force charge/discharge, restore normal, Hold SOC and hardware reserve require a supported writable battery route. Duration selectors and a power target influence supported manual actions; they are not tariff periods. A zero force-power target requests the supported inverter/BMS maximum rather than a guaranteed zero-power command.

An active manual force action can take ownership away from an optimizer action. Monitoring-only connections cannot become writable through a service call. Ordinary Monitoring mode blocks automatic battery dispatch, but user/manual-source service calls can be permitted on a control-capable route. A monitoring-only profile is a separate restriction. Explicitly permitted curtailment and recovery of owned state also have separate rules; Monitoring mode is not a universal hardware-isolation guarantee. Restoring normal should release state PowerSync owns without claiming to override an external controller.

Plan, command and result

First check that the feature is eligible, has current inputs and owns control. A schedule/chart is a plan; the effective action can differ because of manual controls, mode, reserves or site restrictions. Successful command acceptance is not the same as independent device readback. Measured battery/grid/solar power establishes the physical result in that time window.

Preserve these distinctions when troubleshooting. In particular, self-consumption means household use can continue from the battery; it is not a synonym for forced discharge/export. See Troubleshooting for timestamped evidence.

HA automations and PowerSync automations

HA YAML automations can call the services listed in Services Reference and operate the supported entities. PowerSync's mobile Automations screen has its own conditions/actions; an app action name is not automatically a Developer Tools service.

Measured-energy triggers such as Import kWh are distinct from a tariff allowance. Their time window/threshold and action ownership must be configured intentionally. Forecast-only EV demand changes planning without starting/stopping a charger. An external controller retains responsibility when PowerSync is configured only to monitor/publish a plan.

After a restart or control change

Check pending recovery, fresh telemetry, current ownership and access before re-enabling dispatch. Changing a battery/profile or losing optimizer access can require restoration. Enabling access, toggling the optimizer and clearing Monitoring mode are separate actions; do not infer all three from one successful sign-in.

Powerwall Off-Grid Control (v2.12.0+)

Direct off-grid and reconnect control for Tesla Powerwall from the PowerSync mobile app and automations. Supports both Powerwall 2 and Powerwall 3 — PW3 islanding is the first known third-party implementation.

Setup

Powerwall 3:

  1. Pair your Powerwall — go to Settings > Battery Setup > Local Control > Pair Gateway and complete the pairing process
  2. Off-grid controls appear in Settings > Battery Setup > Local Control

Powerwall 2:

  1. Enter gateway IP in Settings > Battery Setup > Gateway Connection
  2. Off-grid controls appear automatically — no pairing needed

Both versions support the powerwall_go_off_grid and powerwall_reconnect_grid automation actions.

Off-Grid Curtailment

When enabled, PowerSync can automatically take your Powerwall off-grid during negative price periods to avoid paying to export. This uses the same physical off-grid command as the Tesla app.

Enable in Settings > Battery Setup > Local Control > Off-Grid Curtailment.

Safety gates:

  • Minimum SOC floor — won't go off-grid below this battery level (default 20%)
  • Daily duration cap — limits total off-grid time per day (default 6 hours)
  • Automatic reconnection when prices recover

HA Services

Service Description
power_sync.powerwall_go_off_grid Physically disconnect from grid
power_sync.powerwall_reconnect_grid Reconnect to grid

Requirements

  • Tesla Powerwall 2 or 3
  • PW3: Completed gateway pairing + PowerSync proxy token or Fleet API token
  • PW2: Gateway IP and customer password (no pairing needed)
  • Gateway reachable on your local network

Away Mode

Away Mode protects the load forecast from holiday or low-occupancy periods. Without it, an extended trip can fill the recorder history with very low consumption, causing the optimizer to underestimate normal evening and overnight load when you return.

Away Mode solves this in two stages:

Stage 1 — Enable before you leave While the switch is on, PowerSync records the departure time. As the house sits empty, recent low-load history can still bias the optimizer toward exports rather than reserving battery for non-existent home load.

Stage 2 — Disable when you get home Turning the switch off records your return time and starts a 7-day recovery status. The load forecaster excludes the away period from its 30-day history window, then uses the most recent normal data around it. As real post-return usage accumulates, it naturally replaces older pre-trip data. The visible recovery status ends after 7 days, while the away interval remains excluded from history until it ages out of the 30-day lookback.

If you accidentally toggle the switch on and off within an hour, it is treated as a no-op and no recovery window starts.

How to Use

switch.power_sync_away_mode

It appears under your PowerSync device in Settings → Devices & Services → PowerSync → Configuration.

  1. Before leaving: turn the switch ON
  2. When you get home: turn the switch OFF — recovery starts automatically
  3. After ~7 days: the recovery status clears; the switch can be left off

Recovery Status

While recovering, sensor.power_sync_load_forecast_today_remaining exposes these attributes:

Attribute Description
away_in_recovery true during the 7-day recovery window
away_recovery_remaining_hours Hours until the window closes automatically
away_enabled_at ISO timestamp of departure
away_disabled_at ISO timestamp of return

Note: Away mode affects the load forecast only. Solar forecasting uses weather/irradiance data and is unaffected.


Clone this wiki locally