---
title: "Shelly Plus 1PM"
description: "Shelly Plus 1PM (Gen2+) relay in TapHome via local HTTP RPC API or MQTT: on/off control plus power, energy, voltage and current readings."
url: "https://taphome.com/en/compatibility/shelly-plus-1pm/"
language: en
lastmod: 2026-03-29
generator: hugo
ai:
  topics: ["http","mqtt","electric-meter","wifi","relay","power-metering","gen2plus"]
  questions: ["How to integrate Shelly Plus 1PM with TapHome?","What does the Shelly Plus 1PM TapHome template measure?","How to connect Shelly Plus 1PM via HTTP to TapHome?","How to connect Shelly Plus 1PM via MQTT to TapHome?","What is the difference between Shelly Plus 1PM and Shelly 1PM in TapHome?","Why does Shelly Plus 1PM show zero power readings?","What diagnostics are available for Shelly Plus 1PM in TapHome?","Can I use MQTT instead of HTTP for Shelly Plus 1PM?"]
---

# Shelly Plus 1PM

Communication: Packet Parser → HTTP

- [Shelly Plus 1PM Product Page](https://www.shelly.com/en/products/shop/shelly-plus-1pm)
- [Shelly Plus 1PM API Documentation](https://shelly-api-docs.shelly.cloud/gen2/)

> 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 Plus 1PM is a compact Gen2+ Wi-Fi relay switch with built-in power metering. It fits behind a standard wall switch and can control one circuit up to 16 A (3500 W at 230 V AC) or 10 A (30 V DC). The device supports 110-240 VAC or 24-30 VDC power supply, making it suitable for both mains-powered and low-voltage installations. TapHome communicates with the device locally over Wi-Fi — no cloud connection is required.

Two TapHome templates are available: an **HTTP template** that polls the device's Gen2+ RPC API, and an **MQTT template** that receives data via an MQTT broker. Both expose the same two devices — an energy meter and a relay switch.

## Configuration

### HTTP template

The HTTP template requires only the device's IP address (default placeholder `192.168.0.1`). TapHome polls the `/rpc/Switch.GetStatus?id=0` endpoint for both relay state and power metering data. The module caches the JSON response in a `status` variable so that individual device scripts can parse it without making redundant HTTP calls.

### MQTT template

The MQTT template requires three parameters during import:

- **MQTT Broker IP** — the IP address of the MQTT broker (not the Shelly device itself)
- **MQTT Broker Port** — default `1883`
- **Shelly MQTT Client ID** — format `shellyplus1pm-{deviceid}`, found in the Shelly web UI under **Settings** > **MQTT Settings** > **Client ID**

After enabling MQTT on the Shelly Plus 1PM (Settings > MQTT), TapHome subscribes to `shellyplus1pm-{deviceid}/status/switch:0` and publishes control commands to `shellyplus1pm-{deviceid}/command/switch:0`.

## Device capabilities

### Relay control

The template exposes the relay as a switch device. The relay state is read from the `output` field (boolean) and controlled via `/rpc/Switch.Set?id=0` with `on=true` or `on=false` (HTTP) or by publishing `on`/`off` to the command topic (MQTT).

The HTTP template polls the relay at a 2.5-second interval, providing near-real-time state feedback. The MQTT template receives updates as they occur via the listener script.

### Power metering

The built-in energy meter reads two values from the Switch.GetStatus response:

- **Instantaneous power** — `apower` reported in watts, converted to kW by the template (divided by 1000)
- **Cumulative energy** — `aenergy.total` reported in watt-hours, converted to kWh by the template (divided by 1000)

The meter is read-only — it updates automatically with every poll cycle (HTTP) or on each MQTT status message.

The HTTP template also exposes three service attributes on the energy meter:

| Attribute | Unit | Description |
|-----------|------|-------------|
| Current | A | Instantaneous current draw |
| Voltage | V | RMS line voltage |
| Temperature | °C | Internal device temperature |

The MQTT template exposes internal temperature, voltage, and current as module-level service attributes with the same data, parsed from the MQTT status payload.

### Additional capabilities

The Shelly Plus 1PM also exposes power factor, network frequency, returned energy (for bidirectional metering), physical input state, WiFi signal strength, MAC address, uptime, RAM usage, and device time through its RPC API. A firmware update action, device reboot, auto-off timer, energy counter reset, and overpower protection configuration are also available. These capabilities can be added in a future template update.

## Troubleshooting

### Device not responding (HTTP)

1. Verify the Shelly is connected to Wi-Fi and has a valid IP address
2. Try using the mDNS hostname (`shellyplus1pm-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 CCU and Shelly are on the same network / VLAN
5. Ensure HTTP Digest Authentication is disabled in the Shelly web UI — TapHome does not support authenticated requests

### MQTT messages not arriving

1. Verify MQTT is enabled in the Shelly web UI (Settings > MQTT)
2. Confirm the broker address and port are correct in both the Shelly device and TapHome module settings
3. Check that the `plug1topic` custom variable matches the Shelly's MQTT Client ID exactly (e.g., `shellyplus1pm-AABBCCDDEE`)
4. Use an MQTT client (e.g., MQTT Explorer) to subscribe to `shellyplus1pm-#` and verify the device publishes messages

### Power readings show zero

1. Confirm the load is connected through the Shelly relay (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

### Slow response or timeouts

1. Gen2+ devices support up to 6 concurrent HTTP connections (vs. 2 on Gen1) — but avoid excessive polling from multiple systems
2. Disable ECO mode in the Shelly web UI if enabled — it puts the device to sleep between polls and can cause timeouts with short poll intervals
3. Use a static IP or DHCP reservation to prevent address changes
4. Consider switching to the MQTT template for multi-system environments — MQTT avoids the connection limit issue entirely

## 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 2

These devices appear in TapHome after import.

Shelly Plus 1PM Module

Custom Variables

Electric Meter Electricity Meter Read-only

Instantaneous power (kW) and cumulative energy (kWh) with current, voltage, and temperature diagnostics

numeric Unit: kW / kWh

Service Attributes

|             |
|-------------|
| Current     |
| Voltage     |
| Temperature |

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;
```

Service Attributes

${current} \[a]

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

${electric\_voltage} \[v]

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

${temp} \[C]

```taphome
return(parsejson(parsejson(status,"temperature"), "tC"));
```

Switch Switch Read and write

boolean

Values / States: ON · OFF

Read switch state

```taphome
var x := (sendhttprequest("/rpc/Switch.GetStatus?id=0"));
status := x.Content;
return(PARSEJSON(status, "$.output", true));
```

Write switch state

```taphome
VAR response := SENDHTTPREQUEST("rpc/Switch.Set?id=0&on=" + if(St,"true","false"));
IF response.IsSuccess = false
  ADDERROR(response.StatusCode);
END
```

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

Possible improvements (16)

- Power Factor — Power factor value, available in Switch.GetStatus response for metered devices
- Network Frequency — AC network frequency in Hz, available in Switch.GetStatus response
- Returned Energy — Returned/exported energy in Wh, for bi-directional metering scenarios
- Input State — Physical switch/button input state, available via /rpc/Input.GetStatus?id=0
- WiFi SSID — Connected WiFi network name, available via /rpc/WiFi.GetStatus
- WiFi Signal Strength — WiFi RSSI in dBm, available via /rpc/WiFi.GetStatus
- IP Address — Device IP address, available via /rpc/WiFi.GetStatus
- MAC Address — Device MAC address, available via /rpc/Sys.GetStatus
- Uptime — Seconds since last reboot, available in Sys.GetStatus response
- RAM Usage — Total and free RAM in bytes, available in Sys.GetStatus response
- Device Time — Current device time in HH:MM format, available in Sys.GetStatus response
- Firmware Update — Trigger firmware update to stable channel, available via Shelly.Update RPC method
- Reboot — Reboot the device, available via Shelly.Reboot RPC method
- Auto-off Timer — Auto-reset timer in seconds via toggle\_after parameter, could be added as switch parameter
- Reset Energy Counters — Resets energy measurement counters (aenergy, ret\_aenergy)
- Overpower Protection — Configurable power limit threshold in Watts, relay turns off when exceeded

## 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
- Shelly Gen2+ MQTT Component API
  
  [shelly-api-docs.shelly.cloud](https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Mqtt/) 2026-03-29
- Home Assistant Shelly Integration
  
  [www.home-assistant.io](https://www.home-assistant.io/integrations/shelly/) 2026-03-29
- Shelly Plus 1PM Knowledge Base — specs & wiring
  
  [kb.shelly.cloud](https://kb.shelly.cloud/knowledge-base/shelly-plus-1pm) 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/)

