---
title: "Shelly Pro 4PM"
description: "Shelly Pro 4PM DIN-rail relay in TapHome over local HTTP: switch four 16 A circuits and read per-channel power and energy. Covers V1 vs V2 hardware."
url: "https://taphome.com/en/compatibility/shelly-4-pro/"
language: en
lastmod: 2026-03-29
generator: hugo
ai:
  topics: ["http","electric-meter","wifi","relay","power-metering","din-rail","4-channel","mdns","ethernet"]
  questions: ["How to integrate Shelly Pro 4PM with TapHome?","What does the Shelly Pro 4PM TapHome template measure?","How to connect Shelly Pro 4PM via HTTP to TapHome?","Why does Shelly Pro 4PM show zero power readings?","Can TapHome read the relay state on Shelly Pro 4PM?","How to set the power protection limit on Shelly Pro 4PM via TapHome?","What is the difference between Shelly Pro 4PM V1 and V2?","Why are the relay switches write-only on Shelly Pro 4PM?"]
---

# Shelly Pro 4PM

Communication: Packet Parser → HTTP

- [Shelly Pro 4PM Product Page](https://www.shelly.com/en/products/shop/shelly-pro-4pm)
- [Shelly Pro 4PM API Documentation](https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen2/ShellyPro4PM)
- [Shelly Pro 4PM Knowledge Base](https://kb.shelly.cloud/knowledge-base/shelly-pro-4pm)

> Network address
> 
> TapHome reaches this device at the address entered on import. Give the device a fixed address — an IP reservation in the router, or its mDNS name if it supports one — otherwise the integration stops working when the router changes the address.
> 
> [Network Preparation](https://taphome.com/en/docs/setup/network-preparation/)

## Integration guide

The Shelly Pro 4PM is a DIN rail mountable 4-channel smart relay with built-in per-channel power metering. Each of the four independent outputs can switch up to 16 A (total 40 A), making it suitable for controlling lighting circuits, appliances, or distribution board loads with individual energy monitoring per channel. TapHome communicates with the device over HTTP on the local network — no cloud connection is required.

The template uses a mixed API approach: Gen2+ RPC endpoints (`/rpc/Switch.GetStatus?id=N`) for energy metering reads, and Gen1 endpoints (`/relay/N?turn=on|off`) for relay control writes. Both API generations are supported by the Pro 4PM for backward compatibility. The device connects via WiFi or Ethernet (RJ45) and features a 1.8-inch color LCD display for local status monitoring.

## Configuration

The Shelly Pro 4PM connects over WiFi or Ethernet. During TapHome template import, enter the device's IP address (default placeholder `192.168.0.1`).

> [!WARNING]
> Authentication must be **disabled** on the Shelly device for TapHome integration. TapHome does not support HTTP Digest Auth used by Gen2 devices. Open the Shelly web UI (`http://{device-ip}`) → Settings → Authentication and ensure it is turned off.

> [!WARNING]
> The LAN cable must only be plugged in or unplugged when the device is **powered off**. Hot-plugging the Ethernet cable may cause issues.

> [!NOTE]
> If ECO mode is enabled on the Shelly device, it may cause communication timeouts due to the fast poll intervals used by the template (2.5–15 seconds). Disable ECO mode in the Shelly web UI if you experience intermittent connectivity issues.

## Device capabilities

### Energy metering

The template exposes four independent energy meter devices, one per channel. Each meter reads from `/rpc/Switch.GetStatus?id=N` (where N is 0–3):

- **Real-time power** — `apower` reported in watts, converted to kW by the template
- **Total consumption** — `aenergy.total` reported in watt-hours, converted to kWh by the template

Channel 1 polls every 2.5 seconds for faster feedback. Channels 2–4 poll every 15 seconds.

The meters are read-only — they update automatically with every poll cycle.

### Relay control

The template exposes four relay switch devices, one per channel. Each relay is controlled via the Gen1 `/relay/N?turn=on|off` endpoint (where N is 0–3).

> [!NOTE]
> The relay switches are **write-only** — the template does not read the relay state back from the device. The current relay state can be inferred from the corresponding energy meter: if the channel reports non-zero power consumption, the relay is on. A future template update could add relay state feedback using the Gen2+ `/rpc/Switch.GetStatus?id=N` → `output` field.

### Power sensor

A standalone power sensor device exposes the raw active power in watts for channel 1 (read from `/rpc/Switch.GetStatus?id=0` → `apower`). Unlike the energy meter which converts to kW, this sensor reports the value in watts without conversion, useful for automations that need watt-level precision.

### Service diagnostics

The template exposes 13 service attributes for device monitoring:

- **Device info** — hostname, MAC address, device time, uptime, RAM usage
- **Thermal protection** — internal temperature (°C), temperature status (Normal / High / Very High), overtemperature flag
- **Connectivity** — cloud enabled/connected, MQTT connected, firmware update available
- **Power protection** — current max power limit (reads from `/settings`)

### Service actions

Three service actions are available:

- **Set power protection** — sets the maximum power limit (1–3500 W). The relay automatically turns off if consumption exceeds this value.
- **Enable cloud** — enables or disables Shelly Cloud connectivity
- **Reboot** — triggers a device reboot

### Additional capabilities

The Shelly Pro 4PM also exposes per-channel voltage, current, power factor, frequency, and internal temperature in its `/rpc/Switch.GetStatus` response. Physical switch/button input states (S1–S4), Ethernet status, WiFi RSSI, and native Gen2+ relay control with auto-off timer are available via the RPC API. These capabilities can be added in a future template update.

## Troubleshooting

### Device not responding

1. Verify the Shelly is connected to WiFi or Ethernet and has a valid IP address
2. Try using the mDNS hostname (`shellypro4pm-AABBCCDDEE.local`) instead of the IP address — the IP may have changed after a DHCP renewal
3. Open `http://{device-ip}/rpc/Shelly.GetDeviceInfo` in a browser — if it responds with JSON, the device is reachable
4. Check that TapHome Core and Shelly are on the same network / VLAN
5. Confirm authentication is disabled on the Shelly device

### Power readings show zero

1. Confirm the load is connected through the Shelly relay output (O1–O4), not bypassed
2. Check that the relay is turned on — the meter only reads when current flows through the relay
3. Poll `/rpc/Switch.GetStatus?id=0` manually and verify `apower` returns a non-zero value
4. Verify the correct channel ID (id=0 for Output 1, id=1 for Output 2, etc.)

### Relay state unknown

The relay switches in this template are write-only — they send on/off commands but do not read the relay state back. To verify the actual relay state:

1. Check the corresponding energy meter — non-zero power means the relay is on
2. Look at the relay LED indicators on the device front panel
3. Test manually via browser: `http://{device-ip}/relay/0` returns the current relay state in JSON

### Overtemperature warning

The Shelly Pro 4PM has internal thermal protection. If the device temperature exceeds safe limits, the `temperature_status` changes to "High" or "Very High" and `overtemperature` becomes `true`. Ensure adequate ventilation in the distribution board, especially when switching high loads across multiple channels simultaneously.

### V1 vs V2 hardware

Both versions use the same firmware and API. V2 (SPSW-104PE16EU) has improved connectors — five individual screw terminals instead of four 2-terminal blocks — and better LAN electrical isolation. No template changes are needed between versions.

> [!WARNING]
> Gen2 Shelly devices support up to **6 concurrent HTTP connections**. The Shelly Pro 4PM template uses up to 5 concurrent endpoints per poll cycle (4 energy meters + module status), leaving limited headroom. Avoid polling from too many systems simultaneously.

## How to install in TapHome

### Prerequisites

- Shelly device installed and powered on
- Local Wi-Fi network (2.4 GHz)
- TapHome CCU on the same network

### Step 1 — Connect Shelly to Wi-Fi

**Option A — Shelly app (recommended):**

1. Download the [Shelly app](https://www.shelly.com/en/support/shelly-app) (iOS / Android)
2. Tap **+** → **Add Device** and follow the Bluetooth pairing wizard
3. Enter your Wi-Fi credentials when prompted

**Option B — AP mode (no app):**

1. On first power-up the device creates a hotspot: `ShellyXXX-AABBCCDDEE`
2. Connect your phone/PC to that hotspot
3. Open `http://192.168.33.1` → **Internet & Security** → **Wi-Fi Mode - Client**
4. Enter SSID and password → **Save**

> [!NOTE]
> Shelly only supports **2.4 GHz** networks. 5 GHz networks will not appear in the scan.

### Step 2 — Find the device address

Shelly Gen1 devices support **mDNS** (Zeroconf). You can reach the device using a hostname instead of an IP address:

```
shelly<model>-<MAC>.local
```

For example: `shelly1pm-AABBCCDDEE.local` (MAC address in uppercase hex, no colons).

> [!TIP]
> **Recommended: use the TapHome IP Scanner.** Open the TapHome app and use the **IP Scanner** (Settings → Network → Scan). The scanner will discover devices on your network and show both the IP address and the mDNS hostname. Use the **hostname** instead of the IP address for a more reliable connection — it stays the same even if the device's IP changes after a router reboot.

**Alternative methods** to find the IP address:

- **Shelly app:** Device detail → **Device info** → IP address
- **Shelly web UI:** Connect to the device AP before Wi-Fi setup — the IP is shown after saving
- **Router DHCP table:** Look for a hostname like `shelly1pm-AABBCCDDEE`

### Step 3 — Configure in TapHome

1. In TapHome, add a new **Packet Parser (HTTP)** module
2. **Address:** enter the mDNS hostname (e.g., `shelly1pm-AABBCCDDEE.local`) or IP address from Step 2
3. **Port:** `80` (default, no change needed)
4. Import the template — TapHome will poll `/status` to read device state

> [!NOTE]
> HTTP authentication is disabled by default on Shelly devices. If you have enabled login protection, TapHome does not support HTTP Basic Auth at this time — keep auth disabled for TapHome integration.

## Available devices 9

These devices appear in TapHome after import.

Shelly Pro 4PM Module

Service Actions

|                      |                                                                                                      |
|----------------------|------------------------------------------------------------------------------------------------------|
| Set power protection | Set maximum power limit (1–3500 W) — relay turns off automatically if consumption exceeds this value |
| Enable cloud         | Enable or disable Shelly Cloud connectivity                                                          |
| Reboot               | Trigger a device reboot                                                                              |

Custom Variables

|                         |
|-------------------------|
| `StatusJson` (string)   |
| `SettingsJson` (string) |
| `status` (string) = 0   |

Read (module)

```taphome
VAR response := SENDHTTPREQUEST("/status", "GET");
StatusJson := response.Content;
```

Service Actions

Set power protection

Parameters: Maximum power (1–3500 Watts)

```taphome
VAR response := SENDHTTPREQUEST("settings?max_power=" + Watts);
VAR contentJson := response.Content;
VAR limitSet := PARSEJSON(contentJson, "max_power");

"Power limit set to " + limitSet + "W"
```

Enable cloud

Parameters: Enable (Enable / Disable)

```taphome
VAR response := SENDHTTPREQUEST("/settings/cloud?enabled=" + enable);
VAR contentJson := response.Content;
VAR wasEnabled := PARSEJSON(contentJson, "enabled");

IF(wasEnabled, "Cloud enabled", "Cloud disabled");
```

Reboot

```taphome
VAR response := SENDHTTPREQUEST("/reboot");
VAR contentJson := response.Content;
VAR wasRebooted := PARSEJSON(contentJson, "ok");

IF(wasRebooted, "Reboot successful", "Error");
```

Channel 1 Energy Meter Electricity Meter Read-only

Per-channel power consumption and energy metering for output 1 — instantaneous power (kW) and cumulative energy (kWh)

numeric Unit: W / kWh

Read total consumption

```taphome
return(parsejson(parsejson(status,"aenergy"), "total")/1000);
```

Read demand

```taphome
return(parsejson(status,"apower")/1000);
```

Read (module)

```taphome
var x := (sendhttprequest("/rpc/Switch.GetStatus?id=0"));
status := x.Content;
```

Channel 2 Energy Meter Electricity Meter Read-only

Per-channel power consumption and energy metering for output 2 — instantaneous power (kW) and cumulative energy (kWh)

numeric Unit: W / kWh

Read total consumption

```taphome
return(parsejson(parsejson(status,"aenergy"), "total")/1000);
```

Read demand

```taphome
return(parsejson(status,"apower")/1000);
```

Read (module)

```taphome
var x := (sendhttprequest("/rpc/Switch.GetStatus?id=1"));
status := x.Content;
```

Channel 3 Energy Meter Electricity Meter Read-only

Per-channel power consumption and energy metering for output 3 — instantaneous power (kW) and cumulative energy (kWh)

numeric Unit: W / kWh

Read total consumption

```taphome
return(parsejson(parsejson(status,"aenergy"), "total")/1000);
```

Read demand

```taphome
return(parsejson(status,"apower")/1000);
```

Read (module)

```taphome
var x := (sendhttprequest("/rpc/Switch.GetStatus?id=2"));
status := x.Content;
```

Channel 4 Energy Meter Electricity Meter Read-only

Per-channel power consumption and energy metering for output 4 — instantaneous power (kW) and cumulative energy (kWh)

numeric Unit: W / kWh

Read total consumption

```taphome
return(parsejson(parsejson(status,"aenergy"), "total")/1000);
```

Read demand

```taphome
return(parsejson(status,"apower")/1000);
```

Read (module)

```taphome
var x := (sendhttprequest("/rpc/Switch.GetStatus?id=3"));
status := x.Content;
```

Channel 2 Relay Switch Read and write

Write-only relay control for output 2 — state not read back, infer from energy meter

boolean

Values / States: ON · OFF

Write switch state

```taphome
VAR path := "relay/1?turn=" + SWITCH(St, 0, "off", 1, "on","off");
SENDHTTPREQUEST(path);
```

Channel 1 Relay Switch Read and write

Write-only relay control for output 1 — state not read back, infer from energy meter

boolean

Values / States: ON · OFF

Write switch state

```taphome
VAR path := "relay/0?turn=" + SWITCH(St, 0, "off", 1, "on","off");
SENDHTTPREQUEST(path);
```

Channel 1 Power Sensor Variable Read-only

Raw active power in watts for channel 1 — standalone sensor value without kW conversion

numeric Unit: W

Read

```taphome
return(parsejson(status,"apower"));
```

Read (module)

```taphome
var x := (sendhttprequest("/rpc/Switch.GetStatus?id=0"));
status := x.Content;
```

Channel 3 Relay Switch Read and write

Write-only relay control for output 3 — state not read back, infer from energy meter

boolean

Values / States: ON · OFF

Write switch state

```taphome
VAR path := "relay/2?turn=" + SWITCH(St, 0, "off", 1, "on","off");
SENDHTTPREQUEST(path);
```

Channel 4 Relay Switch Read and write

Write-only relay control for output 4 — state not read back, infer from energy meter

boolean

Values / States: ON · OFF

Write switch state

```taphome
VAR path := "relay/3?turn=" + SWITCH(St, 0, "off", 1, "on","off");
SENDHTTPREQUEST(path);
```

**Connection:** Packet Parser → HTTP • Hostname: `ShellyPro4PM-{MAC}.local`

Possible improvements (10)

- Relay State Read — Switches have no readswitchstate script — relay state is not read back. Gen2+ /rpc/Switch.GetStatus?id=N provides output (boolean) for state feedback.
- Voltage — Per-channel line voltage in V, available in /rpc/Switch.GetStatus response
- Current — Per-channel load current in A, available in /rpc/Switch.GetStatus response
- Power Factor — Per-channel power factor, available in /rpc/Switch.GetStatus response
- Frequency — Network frequency in Hz, available in /rpc/Switch.GetStatus response
- Per-Channel Temperature — Internal temperature in °C per switch component, available in /rpc/Switch.GetStatus response
- Input States (S1-S4) — 4 physical switch/button inputs, available via /rpc/Input.GetStatus?id=0..3
- Gen2+ Relay Control — Native Gen2+ relay control with toggle\_after timer support. Template uses Gen1 /relay/N instead.
- WiFi Status (SSID, IP, RSSI) — WiFi status including signal strength, available via Gen2+ RPC
- Ethernet Status — Pro 4PM has RJ45 LAN port; Ethernet status (IP, link) available via /rpc/Ethernet.GetStatus

## Import parameters

Enter these values when you import the XML.

| Asked in the app | Default       |
|------------------|---------------|
| IP address       | `192.168.0.1` |

## Sources

- Shelly Gen2+/Gen3 RPC API Reference
  
  [shelly-api-docs.shelly.cloud](https://shelly-api-docs.shelly.cloud/gen2/) 2026-03-29
- Shelly Gen2+ Switch Component API
  
  [shelly-api-docs.shelly.cloud](https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Switch/) 2026-03-29
- Shelly Gen2+ System (Sys) Component API
  
  [shelly-api-docs.shelly.cloud](https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Sys/) 2026-03-29
- Shelly Gen2+ WiFi Component API
  
  [shelly-api-docs.shelly.cloud](https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/WiFi/) 2026-03-29
- Home Assistant Shelly Integration
  
  [www.home-assistant.io](https://www.home-assistant.io/integrations/shelly/) 2026-03-29
- Shelly Pro 4PM Knowledge Base
  
  [kb.shelly.cloud](https://kb.shelly.cloud/knowledge-base/shelly-pro-4pm) 2026-03-29

## Related Documentation

- [Packet Parser Integration](https://taphome.com/en/compatibility/packet-parser-guide/)
- [Packet Parser (HTTP, TCP, UDP, FTP, MQTT)](https://taphome.com/en/docs/integration/packet-parser/)
- [Packet parser functions](https://taphome.com/en/docs/script/packet-parser/)
- [Parsing functions](https://taphome.com/en/docs/script/parsing-functions/)

