---
title: "Shelly 1PM Gen3"
description: "Shelly 1PM Gen3 on local Wi-Fi via the Gen2+/Gen3 JSON-RPC API: relay on/off plus real-time power and energy in TapHome. HTTP authentication must be off."
url: "https://taphome.com/en/compatibility/shelly-1pm-gen3/"
language: en
lastmod: 2026-10-08
generator: hugo
ai:
  topics: ["http","electric-meter","wifi","relay","power-metering","mdns"]
  questions: ["How to integrate Shelly 1PM Gen3 with TapHome?","What does the Shelly 1PM Gen3 TapHome template measure?","How to connect Shelly 1PM Gen3 via HTTP to TapHome?","What is the difference between Shelly 1PM Gen1 and Gen3 in TapHome?","Why does Shelly 1PM Gen3 show zero power readings?","How to use mDNS hostname instead of IP address for Shelly Gen3?"]
---

# Shelly 1PM Gen3

Communication: Packet Parser → HTTP

- [Shelly 1PM Gen3 Product Page](https://www.shelly.com/en/products/shop/shelly-1-pm-gen3)

> 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 1PM Gen3 is a compact 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 (at 24–30 V DC). TapHome communicates with the device over HTTP using the Gen2+/Gen3 JSON-RPC 2.0 API on the local network — no cloud connection is required.

Unlike the original Shelly 1PM (Gen1), which uses a REST API with the `/status` endpoint, the Gen3 version uses the RPC API with method calls such as `/rpc/Switch.GetStatus`. The Gen3 hardware features a faster ESP processor with 8 MB flash, supports up to 6 concurrent HTTP connections (vs 2 on Gen1), and is Matter-upgradeable.

The template provides relay control and an energy meter that reads real-time power consumption and cumulative energy usage.

## Configuration

The Shelly 1PM Gen3 connects over Wi-Fi. 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+/Gen3 devices. Open the Shelly web UI (`http://{device-ip}`) → Settings → Authentication and ensure it is turned off.

> [!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–3 seconds). Disable ECO mode in the Shelly web UI if you experience intermittent connectivity issues.

## Device capabilities

### Relay control

The template exposes the relay as a switch device. The relay state is read from the `/rpc/Switch.GetStatus?id=0` response (`output` field, boolean) and controlled via `/rpc/Switch.Set?id=0&on=true` or `on=false`.

### Power metering

The built-in energy meter reads two values from the `/rpc/Switch.GetStatus?id=0` response:

- **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

The meter also exposes three service attributes:

- **Electric current** — load current in amperes (`current` field)
- **Electric voltage** — supply voltage in volts (`voltage` field)
- **Temperature** — internal device temperature in °C (`temperature.tC` field)

The meter is read-only — it updates automatically with every poll cycle (15-second interval).

### Service diagnostics

The template exposes module-level service attributes for device monitoring:

- **WiFi** — connected SSID name
- **IP address** — current station IP
- **Signal strength** — WiFi RSSI in dBm
- **MAC** — device MAC address

The module read script also checks for available firmware updates and pending restart requirements, surfacing these as warnings in the TapHome interface.

### Service actions

Two service actions are available at the module level:

- **Update firmware** — triggers a firmware update to the latest stable release via `/rpc/Shelly.Update`
- **Reboot** — triggers a device reboot via `/rpc/Shelly.Reboot`

### Additional capabilities

The Shelly 1PM Gen3 also exposes power factor, network frequency (Hz), returned/exported energy counters, physical input state (`input:0`), device uptime, RAM usage, and device time in its RPC responses. An auto-off timer is available via the `toggle_after` parameter, and overpower protection can be configured via `Switch.SetConfig → power_limit`. Energy counters can be reset via `/rpc/Switch.ResetCounters`. These capabilities can be added in a future template update.

## Troubleshooting

### Device not responding

1. Verify the Shelly is connected to Wi-Fi and has a valid IP address
2. Try using the mDNS hostname (`shelly1pmg3-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 (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

### Overtemperature warning

The Shelly 1PM Gen3 has internal thermal protection. If the device temperature exceeds safe limits, the `temperature` reading in the meter service attributes will increase. Ensure adequate ventilation around the device, especially when switching high loads continuously.

> [!WARNING]
> Gen2+/Gen3 Shelly devices support up to **6 concurrent HTTP connections**. While this is a significant improvement over Gen1 (2 connections), avoid polling from too many systems simultaneously (TapHome, Home Assistant, custom scripts) to prevent connection exhaustion.

## 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 1PM Gen3 Module

Service Attributes

|                 |
|-----------------|
| WiFi            |
| IP address      |
| Signal strength |
| MAC             |

Service Actions

|                 |
|-----------------|
| Update firmware |
| Reboot          |

Custom Variables

Read (module)

```taphome
VAR response := SENDHTTPREQUEST("/rpc/Sys.GetStatus");
IF response.IsSuccess
    Sys.GetStatus := response.Content;
END

response := SENDHTTPREQUEST("/rpc/Sys.GetConfig");
IF response.IsSuccess
    Sys.GetConfig := response.Content;
END

response := SENDHTTPREQUEST("/rpc/WiFi.GetStatus");
IF response.IsSuccess
    WiFi.GetStatus := response.Content;
END

if ! ISNULL(parsejson(Sys.GetStatus, "available_updates.stable", true))
    addwarning("New firmware update is available");
end

if parsejson(Sys.GetStatus, "restart_required", true)
    addwarning("Restart required");
end
```

Service Attributes

Wifi

```taphome
PARSEJSON(WiFi.GetStatus, "ssid")
```

${ipAddress}

```taphome
PARSEJSON(WiFi.GetStatus, "sta_ip")
```

${xml\_signal\_strength} \[dB]

```taphome
PARSEJSON(WiFi.GetStatus, "rssi")
```

MAC

```taphome
PARSEJSON(Sys.GetStatus, "mac")
```

Service Actions

${xml\_update\_fw}

```taphome
VAR response := SENDHTTPREQUEST("/rpc/Shelly.Update?stage=\"stable\"");
IF response.IsSuccess
    return("OK");
else
    return("Error");
END

```

Reboot

```taphome
VAR response := SENDHTTPREQUEST("/rpc/Shelly.Reboot");
IF response.IsSuccess
    return("OK");
else
    return("Error");
END
```

Switch Switch Read and write

boolean

Values / States: ON · OFF

Read switch state

```taphome
var x := (sendhttprequest("/rpc/Switch.GetStatus?id=0"));
var 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
```

Electric Meter Electricity Meter Read-only

Power consumption and energy metering — instantaneous power (kW) and cumulative energy (kWh) with current, voltage, and temperature readings

numeric Unit: kW / kWh

Service Attributes

|                  |
|------------------|
| Electric current |
| Electric voltage |
| Temperature      |

Read total consumption

```taphome
return(parsejson(parsejson(Switch.GetStatus,"aenergy"), "total")/1000);
```

Read demand

```taphome
return(parsejson(Switch.GetStatus,"apower")/1000);
```

Read (module)

```taphome
VAR response := SENDHTTPREQUEST("/rpc/Switch.GetStatus?id=0");
IF response.IsSuccess
    Switch.GetStatus := response.Content;
END
```

Service Attributes

${electric\_current} \[A]

```taphome
return(parsejson(Switch.GetStatus,"current"));
```

${electric\_voltage} \[V]

```taphome
return(parsejson(Switch.GetStatus,"voltage"));
```

${temperature} \[°C]

```taphome
return(parsejson(parsejson(Switch.GetStatus,"temperature"), "tC"));
```

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

Possible improvements (10)

- 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
- 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
- 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-27
- Shelly Gen2+ Switch Component API
  
  [shelly-api-docs.shelly.cloud](https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Switch/) 2026-03-27
- Shelly Gen2+ System (Sys) Component API
  
  [shelly-api-docs.shelly.cloud](https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Sys/) 2026-03-27
- Shelly Gen2+ WiFi Component API
  
  [shelly-api-docs.shelly.cloud](https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/WiFi/) 2026-03-27
- Home Assistant Shelly Integration
  
  [www.home-assistant.io](https://www.home-assistant.io/integrations/shelly/) 2026-03-27
- Shelly 1PM Gen3 Knowledge Base
  
  [kb.shelly.cloud](https://kb.shelly.cloud/knowledge-base/shelly-1pm-gen3) 2026-03-27

## 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/)

