# Phase Switching

Stations fitted with the 1↔3 phase switching option can change the number of
phases a vehicle charges on, either from the web interface or from an external
system over REST or Modbus TCP. Two rules matter more than everything else on
this page.

## The two rules

* **Request a switch only while a vehicle is charging.** The control pilot
  must be in state C or D, and the phase-switching status must read `idle`.
  A request made at any other time changes the station's stored selection but
  is not reliably carried through to the power stage.
* **`ci/evse/phase/actual` is the phase the vehicle actually gets.**
  `salia/phase_switching/actual` is the station's stored selection — what was
  requested and what the web interface displays. Under normal operation the
  two agree. When they disagree, the vehicle follows `ci/evse/phase/actual`.

```
GET /api/?path=secc/port0/ci/evse/phase/actual         → 1 or 3, what is applied
GET /api/?path=secc/port0/salia/phase_switching/actual → 1 or 3, what was selected
GET /api/?path=secc/port0/salia/phase_switching/status → "idle" or "progress"
```

## Requirements

Phase switching needs the hardware option, a switching contactor that reports
its state back, and it has to be enabled in the station configuration. It is
off in the factory default. On dual-pole stations, check each charge point
separately — the two poles are configured independently.

Whether it is available on a given charge point is visible in the snapshot: if
the `phase_switching` subtree is absent, switching is not available and every
request is discarded without an error. The detection pattern is described in
the [REST reference](/api/salia/phase-switching).

Do not confuse the stored selection with `ci/evse/basic/phase_count`, which
reports how many phases the station is wired for and never changes.

## What happens during a switch

A phase switch is not a setting that takes effect quietly. The station runs a
relay sequence: charging is paused, the contactor opens, the phases are
switched, the station waits out the configured switching delay, and charging
resumes.

The vehicle is therefore interrupted for at least the configured switching
delay, typically 20 to 30 seconds. Most vehicles resume by themselves. For
those that do not, the phase-switching configuration offers a wake-up method,
control pilot state E or F.

Plan for that interruption. A control strategy that switches phases every few
minutes will cost more energy in restarts than it gains in surplus tracking.

## Timing

Four timers are involved, and one configuration value feeds two of them.

* **Hold-off after charging starts** — 30 seconds, fixed in the firmware and
  not configurable. A switch requested earlier waits.
* **Minimum interval between two switches** — the phase-switching delay
  configured in the web interface.
* **Pause during the switch** — the same configured value, but the charging
  firmware accepts only 10 to 300 seconds and falls back to 20 seconds
  otherwise. Selecting 6 seconds in the web interface therefore gives a
  6-second minimum interval and a 20-second pause.
* **Confirmation timeout** — 60 seconds. If the power stage does not confirm
  the switch, the station restores its previous selection.

The station evaluates all of this every few seconds, so treat the figures as
approximate. In practice, allow about a minute between two switches, and wait
for the status to return to `idle` before sending current limits.

## Checking that a switch took effect

**A status of `idle` is not proof that anything happened.** The status returns
to `idle` within seconds of any accepted request, including one that never
reached the power stage.

Read `ci/evse/phase/actual` once the status is `idle`. The offered currents
show the same thing: on one phase the station offers the charging current on
L1 and `0.0` on L2 and L3, and the total offered current equals the
single-phase value; on three phases the total is three times the per-phase
value. Both values come from the charging firmware, which is exactly why they
are worth reading — the display can disagree with them.

## Requests made outside a charging session

On current firmware, a switch request that arrives while no vehicle is
charging updates the stored selection and the display only. The status still
goes to `progress` and back to `idle`, so a poller sees what looks like a
successful switch. Whether the request is applied at the next charging start
is not guaranteed. The result is a station that displays one phase while the
vehicle keeps charging on three.

* **Avoid it** by following the first rule above: request a switch only in
  control pilot state C or D. In particular, do not reduce the charging
  current to zero or pause the vehicle immediately before requesting a switch,
  because that takes the station out of the charging state.
* **Recover from it** by restarting the station. After the restart the
  display and the actual phase agree again. That is not necessarily the phase
  you wanted, so request it once more if needed.
* **Recover without a restart** by requesting a phase while the vehicle is
  charging. Which of the two triggers the real switch depends on what the
  station has stored internally, so try one, allow about a minute, then try
  the other. Each attempt that takes effect pauses charging.

## External control

The Modbus TCP interface exposes the same function through `Target_Phase` and
the phase-switching status registers, with the same rules. See
[Phase selection](/modbus-tcp/documentation#phase-selection) in the Modbus TCP
documentation.

Switching into `power` charge mode automatically requests 3-phase operation.
That request takes the same path as any other, so the rule above applies to it
too: outside a charging session it changes the selection without reliably
reaching the power stage. If an external energy management system also drives
the phase selection, make sure the two do not work against each other.
