Skip to content

How to Configure a Shelly 2PM for Electric Shutters with Zigbee and Home Assistant

Published:

The Shelly 2PM is one of the most versatile smart relays on the market. In this guide we’ll use it to control electric roller shutters (tapparelle), configure it via the Shelly app, flash it to Zigbee firmware, and finally integrate it with Home Assistant using the ZHA (Zigbee Home Automation) integration — including post-switch configuration/calibration from the web panel and an emergency write-attribute fallback.


Wiring and Mounting

⚠️ Safety first! Always turn off the circuit breaker before touching any wiring. If you’re not comfortable working with mains voltage, hire a licensed electrician.

Wiring diagram (quick overview)

The Shelly 2PM fits inside a standard wall box behind the shutter switch. Here’s the basic connection scheme:

TerminalConnect to
LLive (phase) from the breaker
NNeutral
O1Motor wire — UP direction
O2Motor wire — DOWN direction
SW1Wall switch input 1 (UP)
SW2Wall switch input 2 (DOWN)

The motor’s common wire goes to the Live (L) on the input side, while O1 and O2 drive the two directions. Connect the wall switch terminals so that physical buttons still work even when the Shelly loses connectivity.

Mounting tips


Initial Configuration via the Shelly App

Before switching to Zigbee, we configure the device over Wi-Fi using the official Shelly Smart Control app.

1. Add the device

  1. Power on the Shelly 2PM — it creates a Wi-Fi access point named Shelly2PM-XXXXXXXXXXXX.
  2. Open the Shelly app and tap Add Device.
  3. Connect to the Shelly’s AP and follow the wizard to join it to your home Wi-Fi network.

2. Set the device type to “Roller Shutter”

  1. In the app, tap on the newly added Shelly 2PM.
  2. Go to SettingsDevice Type (or Roller Mode).
  3. Select Roller Shutter (instead of the default “2-channel relay” mode).
  4. The app will restart the device in roller-shutter mode, exposing a single cover entity with UP / DOWN / STOP controls.

3. Configure the inputs (wall switch)

  1. Go to SettingsInput/Output Settings.
  2. Set each input (SW1 and SW2) to Momentary Switch or Detached Switch, depending on the type of physical button you have:
    • Momentary (push-button): press once to start, press again to stop.
    • Detached: the switch position has no link to the relay — control is entirely via the app or automations.

4. Calibrate the shutter (Wi-Fi)

  1. Go to SettingsCalibration.
  2. Tap Start Calibration.
  3. The shutter will move all the way up, then all the way down, measuring the travel time.
  4. Once finished, you’ll have accurate percentage-based positioning.

This calibration step is important even if you plan to switch to Zigbee later, because it confirms your wiring is correct and the motor works properly in both directions.


Switching to Zigbee Firmware

Once you’ve verified everything works over Wi-Fi, it’s time to switch the Shelly 2PM to Zigbee mode for local-only, low-latency control through Home Assistant.

Why Zigbee?

How to switch firmware via the Shelly Web UI

  1. Open a browser and navigate to the Shelly’s IP address (e.g. http://192.168.1.45).
  2. Go to SettingsFirmware.
  3. Look for the option Switch to Zigbee firmware (available on Gen 2+ devices that support dual firmware).
  4. Confirm the switch. The device will download the Zigbee firmware, flash it, and reboot.
  5. After the reboot, the device runs in Zigbee mode as a Zigbee end-device/router. Depending on your setup, Wi-Fi access may no longer be available.

⚠️ If Wi-Fi access is no longer available after the switch, use the Home Assistant/ZHA web panel for configuration and calibration. The write-attribute method below is a useful fallback when standard controls are not enough.


Integrating with Home Assistant via ZHA

Now that the Shelly 2PM speaks Zigbee, we need to pair it with Home Assistant using the ZHA (Zigbee Home Automation) integration.

Prerequisites

Pairing steps

  1. In Home Assistant, go to SettingsDevices & ServicesZHA.
  2. Click Add Device (or the + button).
  3. Home Assistant will start scanning for new Zigbee devices.
  4. The Shelly 2PM should appear as a new device within 30–60 seconds. If it doesn’t, try power-cycling it (turn off and on the breaker) to re-enter pairing mode.
  5. Once paired, Home Assistant will create a Cover entity (e.g. cover.shelly_2pm_xxxx) with open, close, stop, and position controls.

Configuration and Calibration after Zigbee Switch

After switching to Zigbee, complete the configuration and calibration directly from the Home Assistant web panel (ZHA device page). This is the standard workflow after the switch.

Normal workflow from the web panel

  1. In Home Assistant, go to SettingsDevices & ServicesZHA.
  2. Open the Shelly 2PM device page.
  3. Use the available controls/options in the device panel to complete cover setup and verify open/close direction and positioning.
  4. Run calibration from the device controls in the web panel when available.

Exceptional fallback: Write attribute from ZHA

If Wi-Fi access was disabled/lost and you need a direct low-level trigger, you can force calibration by writing an attribute in ZHA.

  1. In Home Assistant, go to SettingsDevices & ServicesZHA.
  2. Find the Shelly 2PM device and click on it.
  3. Click Manage Zigbee Device (at the bottom of the device page).
  4. In the Zigbee device management panel, locate the Window Covering cluster.
  5. Look for the attribute called Window Cover Mode (attribute ID 0x0017 / decimal 23) — or find the mode attribute associated with calibration.
  6. Write the value 10 to this attribute.
    • This triggers the calibration procedure: the shutter will move fully up, then fully down, measuring travel times.
  7. Wait for the shutter to complete both movements. Once done, the cover entity in Home Assistant will report accurate position percentages.

💡 Tip: If the “Manage Zigbee Device” panel doesn’t show the attribute, make sure you select the correct endpoint (usually endpoint 1 for the cover) and the correct cluster (Window Covering — cluster ID 0x0102).

Step-by-step in the ZHA UI

  1. Go to Manage Zigbee DeviceClusters tab.
  2. Select Endpoint 1Window Covering (0x0102).
  3. In the Attributes section, find window_covering_mode (attribute 0x0017).
  4. Set the value to 10 and click Write Attribute.
  5. The Shelly will start the calibration cycle.

After calibration, you can verify it worked by sending the cover to 50 % — it should stop roughly halfway.


Summary

StepTool
Wire the Shelly 2PM to motor and switchScrewdriver 🔧
Configure as Roller Shutter + CalibrateShelly App (Wi-Fi)
Switch to Zigbee firmwareShelly Web UI
Pair with Home AssistantZHA integration
Configure/calibrate after Zigbee switchHome Assistant web panel (ZHA device page)
Emergency calibration fallbackManage Zigbee Device → Write attribute 10 on Window Cover Mode

That’s it! You now have a fully local, Zigbee-controlled roller shutter integrated into Home Assistant — no cloud required.