Zigbee Smart Plug Power-On State: What Happens After an Outage

Configure a Zigbee smart plug power-on state after an outage. Set poweronbehavior in Zigbee2MQTT or the ZHA entity, then verify with a safe checklist.

What “power-on state” means

When mains returns, four layers can disagree:

Layer

What you are looking at

Physical relay

Whether the outlet contacts closed when the plug booted

Reported state

What Zigbee2MQTT, ZHA, or HA shows after the mesh reconnects

Last-state memory

Whether the model restores previous, forces off/on, or toggle

Coordinator / HA availability

Whether the radio stack and HA are online to accept commands

An automation that fires “when HA starts” cannot rewrite what the relay did at local boot. Treat power_on_behavior (or the ZHA configuration entity that exposes the same idea) as the intended policy for outage recovery—not Wi-Fi loss, and not a broken mesh repair path. Only a supervised check on a real load shows what this plug and firmware do.

Confirm the model exposes power-on behavior

Support is per model and firmware. Two Zigbee2MQTT-documented plugs expose power_on_behavior with the values off, on, toggle, and previous:

Read the exact device page Exposes block before you write. Do not assume every Zigbee outlet offers the same enums or allows /get.

Zigbee2MQTT: set power_on_behavior over MQTT

Zigbee2MQTT publishes device control under a configurable base topic. The default is zigbee2mqtt, but yours may differ, so use your broker’s actual base topic (MQTT topics and messages). If unsure how the broker, base topic, and discovery are configured, the Home Assistant Zigbee2MQTT setup guide shows where to check.

  1. Identify the plug’s friendly_name.
  2. Optionally read the current value only if the model’s Exposes list allows /get:
Topic:   <base_topic>/<FRIENDLY_NAME>/get
Payload: {"power_on_behavior": ""}
  1. Choose a safe policy for a harmless lamp first—usually off, or previous only if you accept restoring the last relay state.
  2. Publish one small set payload:
Topic:   <base_topic>/<FRIENDLY_NAME>/set
Payload: {"power_on_behavior": "off"}
  1. Watch the device state topic: an updated value confirms the reported setting, not an independent write acknowledgement guarantee. If the new value never appears, inspect error/state logs and exact device support rather than repeatedly toggling the load.

If the plug stays offline after the mesh reconnects, that is a connectivity task, distinct from local relay boot behavior—work through the Zigbee2MQTT devices not responding checklist rather than re-pair a healthy plug.

ZHA: use the configuration entity, not MQTT copy-paste

On ZHA, open the device page in Home Assistant and look for the supported configuration entity for power-on / start-up behavior. Change it there. Do not transplant Zigbee2MQTT /set JSON or invent Tuya numeric attribute writes from forum snippets.

If no configuration entity appears, a supported control has not been verified through this UI—not proof the hardware can never support it. Do not assume every ZHA device exposes the same entity or import Tuya attribute numeric mappings to force one.

Safe apply checklist

  1. Model and integration — Zigbee2MQTT vs ZHA, exact model ID.
  2. Read supported values — only the enums the device page or entity lists.
  3. Safe policy — test on a lamp or similar low-risk load, never heaters, pumps, medical equipment, or overloaded circuits.
  4. Apply — MQTT /set or the ZHA configuration entity.
  5. Reported state — matching value in the state topic or HA entity, treated as the reported setting, not proof of behavior.
  6. Supervised power-cycle — after utility power is stable, unplug/replug the smart plug itself—not the breaker—while you watch.
  7. Verify — physical load state and the UI report agree.
  8. Automations — disable or inspect rules that toggle the same plug on HA start so they don’t fight the local boot policy.

Safety boundaries

Do not cycle a mains breaker as a test method, work on wet outlets, open the plug housing, or treat previous / off as a safety guarantee. They describe relay intent after power returns only; they do not replace load-appropriate wiring, ratings, or supervision.

Completion standard

You are done when the supported power-on control shows the chosen value, a supervised plug power-cycle on a harmless lamp produces the expected result, the UI matches after reconnection, and no start-up automation overrides it.