---
title: "Shelly 2PM Gen3"
description: "Shelly 2PM Gen3 in TapHome over local HTTP RPC: two relays with power metering, or cover mode for roller shutters and blinds with position and tilt."
url: "https://taphome.com/en/compatibility/shelly-2pm-gen3/"
language: en
lastmod: 2026-03-29
generator: hugo
ai:
  topics: ["http","electric-meter","wifi","relay","power-metering","cover","blind","mdns","profile"]
  questions: ["How to integrate Shelly 2PM Gen3 with TapHome?","What is the difference between switch and cover profile on Shelly 2PM Gen3?","How to control a motorized blind with Shelly 2PM Gen3 and TapHome?","How to switch between relay and cover mode on Shelly 2PM Gen3?","Why does the Shelly 2PM Gen3 template show a profile error in TapHome?","How to calibrate the Shelly 2PM Gen3 cover for position control?"]
---

# Shelly 2PM Gen3

Communication: Packet Parser → HTTP

- [Shelly 2PM Gen3 Product Page](https://www.shelly.com/en/products/shop/shelly-2-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 2PM Gen3 is a compact dual-channel Wi-Fi relay module with built-in power metering. It fits behind a standard wall switch and can control two independent circuits up to 10 A each (16 A total at 230 V AC) or a single motorized cover/blind. 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.

The device supports two operation profiles — **switch** and **cover** — selectable through the Shelly web UI or via the TapHome service action. In switch profile, both relay outputs (O1 and O2) operate independently with per-channel power monitoring. In cover profile, the two outputs drive a single motor for roller shutters, blinds, or curtains, with position control, tilt/slat support, and calibration.

Unlike the Shelly 1PM Gen3, which controls a single circuit, the 2PM Gen3 provides dual-channel control or motorized cover support. Both share the same Gen3 platform with an ESP processor (8 MB flash), up to 6 concurrent HTTP connections, and Matter upgradeability.

## Configuration

The Shelly 2PM 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.

### Profile selection

The Shelly 2PM Gen3 operates in one of two profiles at a time. The active profile determines which TapHome devices are functional:

- **Switch profile** — enables both relay switches (Switch 1 and Switch 2) with independent power monitoring. The cover and blind devices will show a profile error.
- **Cover profile** — enables the cover (roller shutter) and blind (venetian with tilt) devices. The switch devices will show a profile error.

The active profile is visible as a module-level service attribute ("Profile") in TapHome. To change the profile, use the **Set Profile** service action at the module level, or switch it in the Shelly web UI. After changing the profile, the device reboots and only the devices matching the new profile will operate without errors.

> [!TIP]
> The template includes all four device types (2 switches + cover + blind), but only the devices matching the active profile will work. Devices on the wrong profile display an error message such as "Profile is not set to switch" or "Profile is not set to cover" — this is expected behavior, not a malfunction.

### Cover calibration

When using the cover profile, the motor travel limits must be calibrated before position control works. Until calibration is complete, the template will display a "Calibration is required" error. Calibrate either through the Shelly web UI or by triggering the **Start automatic calibration** service action in TapHome. During calibration, the cover runs fully open and fully closed to measure travel distances.

## Device capabilities

### Relay control (switch profile)

The template exposes two independent relay switches. Each switch reads its state from `/rpc/Switch.GetStatus?id={0,1}` (`output` field, boolean) and controls the relay via `/rpc/Switch.Set?id={0,1}&on=true|false`.

Each switch also exposes service attributes for per-channel monitoring:

- **Temperature** — internal device temperature in °C (`temperature.tC`)
- **Energy consumption** — cumulative energy in Wh (`aenergy.total`)
- **Power demand** — real-time power in W (`apower`)
- **Electric voltage** — supply voltage in V (`voltage`)
- **Electric current** — load current in A (`current`)
- **Frequency** — AC network frequency in Hz (`freq`)
- **Power Factor** — power factor value (`pf`)

The switches update every 2.5 seconds.

### Cover control (cover profile)

The cover device controls a motorized roller shutter, curtain, or awning. It reads position from `/rpc/Cover.GetStatus?id=0` (`current_pos` and `target_pos` fields, 0–100) and writes via `/rpc/Cover.GoToPosition?id=0&pos=N`. The template inverts the position scale so that 0 = fully open and 100 = fully closed in TapHome.

The cover exposes service attributes:

- **Temperature** — internal device temperature in °C
- **Energy consumption** — cumulative motor energy in Wh
- **Power demand** — real-time motor power in W
- **Electric voltage** — supply voltage in V
- **Electric current** — motor current in A

A **Start automatic calibration** service action is available to initiate cover calibration directly from TapHome.

### Blind control (cover profile)

The blind device extends the cover with tilt/slat control for venetian blinds. In addition to position, it reads and writes slat position (`slat_pos`) via `/rpc/Cover.GoToPosition?id=0&pos=N&slat_pos=M`. Both position and tilt scales are inverted (0 = open, 100 = closed in TapHome).

The blind exposes the same service attributes as the cover, plus:

- **Slat** — shows whether slat control is enabled or disabled (from `Cover.GetConfig → $.slat.enable`)
- **Slat open time** — configured slat opening duration in seconds
- **Slat close time** — configured slat closing duration in seconds

> [!NOTE]
> **Known template issue:** The "Slat close time" service attribute reads `$.slat.open_time` instead of `$.slat.close_time` from the Cover configuration. Both slat time attributes currently display the same value (the open time). This will be corrected in a future template revision.

Two service actions are available on the blind device:

- **Start automatic calibration** — initiates cover position calibration
- **Set Slat** — enables slat control and configures open/close times (0.1–5 seconds each) via `/rpc/Cover.SetConfig`

> [!WARNING]
> Slat/tilt control must be enabled before the blind device can control tilt position. If slat position is not available from the device, the blind will show an error "Slat position must be enabled for blinds". Use the **Set Slat** service action to enable it and set the open/close durations.

### 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 dB
- **MAC** — device MAC address
- **Profile** — currently active device profile (switch or cover)

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

### Service actions

Three 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`
- **Set Profile** — switches between cover and switch operating modes via `/rpc/Shelly.SetProfile`

### Additional capabilities

The Shelly 2PM Gen3 also exposes physical input states (`input:0`, `input:1`), returned/exported energy counters, device uptime, RAM usage, and device time in its RPC responses. An auto-off timer is available via the `toggle_after` parameter, overpower protection can be configured via `Switch.SetConfig → power_limit`, and energy counters can be reset via `/rpc/Switch.ResetCounters`. In cover mode, direct open/close/stop commands and cover movement state (open/opening/closed/closing/stopped/calibrating) are available. 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 (`shelly2pmg3-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

### Profile mismatch errors

If a device shows "Profile is not set to switch" or "Profile is not set to cover":

1. Check which profile is currently active — the "Profile" service attribute at the module level shows the current mode
2. Switch to the correct profile using the **Set Profile** service action, or remove unused devices from TapHome
3. After switching profiles, the device reboots automatically — allow a few seconds for reconnection

### Cover position not working

1. Verify the device is in cover profile — switch profile does not expose cover functionality
2. Run the **Start automatic calibration** service action — position control requires completed calibration
3. Check that the motor is connected correctly to O1 and O2 terminals
4. Poll `/rpc/Cover.GetStatus?id=0` manually and verify `pos_control` is `true`

### Blind tilt not responding

1. Confirm slat control is enabled — check the "Slat" service attribute (should show "Enabled")
2. If disabled, use the **Set Slat** service action to enable it and configure open/close times
3. Verify the blind motor supports tilt operation — roller shutters without tilt ignore slat commands

### Overtemperature warning

The Shelly 2PM Gen3 has internal thermal protection. If the device temperature exceeds safe limits, the `temperature` reading in the device service attributes will increase. Ensure adequate ventilation around the device, especially when switching high loads continuously. The maximum switching current is 10 A per channel with 16 A total (18 A peak).

> [!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. The Shelly 2PM Gen3 template uses up to 4 concurrent endpoints per poll cycle, leaving limited headroom for additional connections.

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

These devices appear in TapHome after import.

Shelly 2PM Gen3 Module

Service Attributes

|                 |                                                                                |
|-----------------|--------------------------------------------------------------------------------|
| WiFi            |                                                                                |
| IP address      |                                                                                |
| Signal strength |                                                                                |
| MAC             |                                                                                |
| Profile         | Active device profile — switch (dual relay) or cover (motorized blind/shutter) |

Service Actions

|                 |                                                                                       |
|-----------------|---------------------------------------------------------------------------------------|
| Update firmware |                                                                                       |
| Reboot          |                                                                                       |
| Set Profile     | Switch between cover and switch operating modes — device reboots after profile change |

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")
```

Profile

```taphome
PARSEJSON(Sys.GetConfig, "$.device.profile");
```

Service Actions

${xml\_update\_fw}

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

```

${restart}

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

Set Profile

Parameters: Profile

```taphome
VAR response := SENDHTTPREQUEST("/rpc/Shelly.SetProfile?name=\"" + 
switch(prof,
0, "cover",
1, "switch",
"")
+ "\"");
IF response.IsSuccess
    return("OK");
else
    return("Error");
END
```

Switch 1 Switch Read and write

Relay output 1 with per-channel power monitoring — requires switch profile

boolean

Values / States: ON · OFF

Read switch state

```taphome
VAR response := SENDHTTPREQUEST("/rpc/Switch.GetStatus?id=" + ID);
IF response.IsSuccess
    Switch.GetStatus := response.Content;  
END
return(PARSEJSON(Switch.GetStatus, "$.output", true));
```

Write switch state

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

Read (module)

```taphome
if PARSEJSON(Sys.GetConfig, "$.device.profile") != "switch"
	adderror("Profile is not set to switch (" + PARSEJSON(Sys.GetConfig, "$.device.profile") + ")");
end

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

response := SENDHTTPREQUEST("/rpc/Switch.GetConfig?id=" + ID);
IF response.IsSuccess
    Switch.GetConfig := response.Content;
END

if ! ISNULL(parsejson(Switch.GetStatus, "errors", true))
    adderror("Error: " + parsejson(Switch.GetStatus, "errors"));
end
```

Service Attributes

${device\_variable\_realtemperature} \[°C]

```taphome
parsejson(Switch.GetStatus, "$.temperature.tC", true)
```

${device\_variable\_electricityconsumption} \[Wh]

```taphome
parsejson(Switch.GetStatus, "$.aenergy.total", true)
```

${device\_variable\_electricitydemand} \[W]

```taphome
parsejson(Switch.GetStatus, "$.apower", true)
```

${valueLogType\_ElectricVoltage} \[V]

```taphome
parsejson(Switch.GetStatus, "$.voltage", true)
```

${valueLogType\_ElectricCurrent} \[A]

```taphome
parsejson(Switch.GetStatus, "$.current", true)
```

${frequency} \[Hz]

```taphome
parsejson(Switch.GetStatus, "$.freq", true)
```

Power Factor

```taphome
parsejson(Switch.GetStatus, "$.pf", true)
```

Switch 2 Switch Read and write

Relay output 2 with per-channel power monitoring — requires switch profile

boolean

Values / States: ON · OFF

Read switch state

```taphome
VAR response := SENDHTTPREQUEST("/rpc/Switch.GetStatus?id=" + ID);
IF response.IsSuccess
    Switch.GetStatus := response.Content;  
END
return(PARSEJSON(Switch.GetStatus, "$.output", true));
```

Write switch state

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

Read (module)

```taphome
if PARSEJSON(Sys.GetConfig, "$.device.profile") != "switch"
	adderror("Profile is not set to switch (" + PARSEJSON(Sys.GetConfig, "$.device.profile") + ")");
end

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

response := SENDHTTPREQUEST("/rpc/Switch.GetConfig?id=" + ID);
IF response.IsSuccess
    Switch.GetConfig := response.Content;
END

if ! ISNULL(parsejson(Switch.GetStatus, "errors", true))
    adderror("Error: " + parsejson(Switch.GetStatus, "errors"));
end
```

Service Attributes

${device\_variable\_realtemperature} \[°C]

```taphome
parsejson(Switch.GetStatus, "$.temperature.tC", true)
```

${device\_variable\_electricityconsumption} \[Wh]

```taphome
parsejson(Switch.GetStatus, "$.aenergy.total", true)
```

${device\_variable\_electricitydemand} \[W]

```taphome
parsejson(Switch.GetStatus, "$.apower", true)
```

${valueLogType\_ElectricVoltage} \[V]

```taphome
parsejson(Switch.GetStatus, "$.voltage", true)
```

${valueLogType\_ElectricCurrent} \[A]

```taphome
parsejson(Switch.GetStatus, "$.current", true)
```

${frequency} \[Hz]

```taphome
parsejson(Switch.GetStatus, "$.freq", true)
```

Power Factor

```taphome
parsejson(Switch.GetStatus, "$.pf", true)
```

Cover Slide Read and write

Motorized roller shutter or curtain with position control — requires cover profile and calibration

numeric Unit: %

Service Attributes

|                    |
|--------------------|
| Temperature        |
| Energy consumption |
| Power demand       |
| Electric voltage   |
| Electric current   |

Service Actions

|                             |
|-----------------------------|
| Start automatic calibration |

Read (module)

```taphome
if PARSEJSON(Sys.GetConfig, "$.device.profile") != "cover"
	adderror("Profile is not set to cover (" + PARSEJSON(Sys.GetConfig, "$.device.profile") + ")");
end

VAR response := SENDHTTPREQUEST("/rpc/Cover.GetStatus?id=" + ID);
IF response.IsSuccess
    Cover.GetStatus := response.Content;  
END

response := SENDHTTPREQUEST("/rpc/Cover.GetConfig?id=" + ID);
IF response.IsSuccess
    Cover.GetConfig := response.Content;
END

if ! parsejson(Cover.GetStatus, "$.pos_control", true)
    #adderror("${presence_calibration_required}");
    adderror("Calibration is required");
end

if ! ISNULL(parsejson(Cover.GetStatus, "errors", true))
    adderror("Error: " + parsejson(Cover.GetStatus, "errors"));
end
```

Read blind level

```taphome
var pos := PARSEJSON(Cover.GetStatus, "$.current_pos", true);
if ! isnull(PARSEJSON(Cover.GetStatus, "$.target_pos", true))
	pos := PARSEJSON(Cover.GetStatus, "$.target_pos", true);
end

return(linear(pos,0,1,100,0));
```

Write blind level

```taphome
VAR response := SENDHTTPREQUEST("rpc/Cover.GoToPosition?id=" + ID + "&pos=" + round(linear(Bl,0,100,1,0)));
IF response.IsSuccess = false
  ADDERROR(response.StatusCode);
END

response := SENDHTTPREQUEST("/rpc/Cover.GetStatus?id=" + ID);
IF response.IsSuccess
    Cover.GetStatus := response.Content;  
END
```

Service Attributes

${device\_variable\_realtemperature} \[°C]

```taphome
parsejson(Cover.GetStatus, "$.temperature.tC", true)
```

${device\_variable\_electricityconsumption} \[Wh]

```taphome
parsejson(Cover.GetStatus, "$.aenergy.total", true)
```

${device\_variable\_electricitydemand} \[W]

```taphome
parsejson(Cover.GetStatus, "$.apower", true)
```

${valueLogType\_ElectricVoltage} \[V]

```taphome
parsejson(Cover.GetStatus, "$.voltage", true)
```

${valueLogType\_ElectricCurrent} \[A]

```taphome
parsejson(Cover.GetStatus, "$.current", true)
```

Service Actions

${start\_automatic\_calibration}

```taphome
VAR response := SENDHTTPREQUEST("/rpc/Cover.Calibrate?id=" + ID);
IF response.IsSuccess
    return("OK");
else
    return("Error");
END
```

Blind Blind Read and write

Venetian blind with position and tilt/slat control — requires cover profile, calibration, and slat enabled

numeric Unit: %

Service Attributes

|                    |                                                                    |
|--------------------|--------------------------------------------------------------------|
| Temperature        |                                                                    |
| Energy consumption |                                                                    |
| Power demand       |                                                                    |
| Electric voltage   |                                                                    |
| Electric current   |                                                                    |
| Slat               | Whether tilt/slat control is enabled in Shelly Cover configuration |
| Slat open time     |                                                                    |
| Slat close time    |                                                                    |

Service Actions

|                             |                                                                             |
|-----------------------------|-----------------------------------------------------------------------------|
| Start automatic calibration |                                                                             |
| Set Slat                    | Enable slat control and configure tilt open/close durations (0.1–5 seconds) |

Read (module)

```taphome
if PARSEJSON(Sys.GetConfig, "$.device.profile") != "cover"
	adderror("Profile is not set to cover (" + PARSEJSON(Sys.GetConfig, "$.device.profile") + ")");
end

VAR response := SENDHTTPREQUEST("/rpc/Cover.GetStatus?id=" + ID);
IF response.IsSuccess
    Cover.GetStatus := response.Content;  
END

response := SENDHTTPREQUEST("/rpc/Cover.GetConfig?id=" + ID);
IF response.IsSuccess
    Cover.GetConfig := response.Content;
END

if ! parsejson(Cover.GetStatus, "$.pos_control", true)
    #adderror("${presence_calibration_required}");
    adderror("Calibration is required");
end

if ! ISNULL(parsejson(Cover.GetStatus, "errors", true))
    adderror("Error: " + parsejson(Cover.GetStatus, "errors"));
end
```

Read blind level

```taphome
var pos := PARSEJSON(Cover.GetStatus, "$.current_pos", true);
var target := PARSEJSON(Cover.GetStatus, "$.target_pos", true);
var slatPos := PARSEJSON(Cover.GetStatus, "$.slat_pos", true);

BlSend := 0;
if BsSend = 0 and (Bs = 0 or Bs = 1) 
	if (!isnull(target))
		DeltaPos := 0;
		return(linear(target,0,1,100,0));
	else
		return(linear(pos - DeltaPos,0,1,100,0));	
	end
end

return(Bl);
```

Write blind level

```taphome
var pos := PARSEJSON(Cover.GetStatus, "$.current_pos", true);
var target := PARSEJSON(Cover.GetStatus, "$.target_pos", true);
var slatPos := PARSEJSON(Cover.GetStatus, "$.slat_pos", true);

VAR response := SENDHTTPREQUEST("rpc/Cover.GoToPosition?id=0&pos=" + round(linear(Bl,0,100,1,0)));
BlSend := 1;
IF response.IsSuccess = false
  ADDERROR(response.StatusCode);
END

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

Read blind slope

```taphome
var pos := PARSEJSON(Cover.GetStatus, "$.current_pos", true);
var slatPos := PARSEJSON(Cover.GetStatus, "$.slat_pos", true);
var state := PARSEJSON(Cover.GetStatus, "$.state", true);
var date := NOW();

if ISNULL(slatPos)
    adderror("Slat position must be enabled for blinds");
    return(NaN);
end

if state = "closing" or state = "opening"
	BsSend := 1;
	return(Bs);
end

if BsSend > 1
	BsSend := 1;
	return(Bs);
else
	if BsSend = 1
		BsSend := 0;
		DeltaPos := pos - round(linear(Bl,0,100,1,0));	
	end
	return(linear(slatPos,0,1,100,0));
end
```

Write blind slope

```taphome
var date := NOW();
var pos := PARSEJSON(Cover.GetStatus, "$.current_pos", true);

if BlSend = 0
	VAR response := SENDHTTPREQUEST("rpc/Cover.GoToPosition?id=0&pos=" + pos + "&slat_pos=" + round(linear(Bs,0,100,1,0)));
	BsSend := date.UNIXTIME;
	IF response.IsSuccess = false
	  ADDERROR(response.StatusCode);
	END
end

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

Service Attributes

${device\_variable\_realtemperature} \[°C]

```taphome
parsejson(Cover.GetStatus, "$.temperature.tC", true)
```

${device\_variable\_electricityconsumption} \[Wh]

```taphome
parsejson(Cover.GetStatus, "$.aenergy.total", true)
```

${device\_variable\_electricitydemand} \[W]

```taphome
parsejson(Cover.GetStatus, "$.apower", true)
```

${valueLogType\_ElectricVoltage} \[V]

```taphome
parsejson(Cover.GetStatus, "$.voltage", true)
```

${valueLogType\_ElectricCurrent} \[A]

```taphome
parsejson(Cover.GetStatus, "$.current", true)
```

Slat

```taphome
if(parsejson(Cover.GetConfig, "$.slat.enable", true), "Enabled", "Disabled")
```

Slat open time \[s]

```taphome
parsejson(Cover.GetConfig, "$.slat.open_time ", true)
```

Slat close time \[s]

```taphome
parsejson(Cover.GetConfig, "$.slat.open_time ", true)
```

Service Actions

${start\_automatic\_calibration}

```taphome
VAR response := SENDHTTPREQUEST("/rpc/Cover.Calibrate?id=" + ID);
IF response.IsSuccess
    return("OK");
else
    return("Error");
END
```

Set Slat

Parameters: Open time \[s] (0.1–5 ot), Close time \[s] (0.1–5 ct)

```taphome
VAR response := SENDHTTPREQUEST("/rpc/Cover.SetConfig?id=" + ID + 
	"&config={\"slat\":{\"enable\":true, \"open_time\": " + ot +", \"close_time\": " + ct +"}}");
IF response.IsSuccess
    return("OK");
else
    return("Error");
END
```

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

Possible improvements (11)

- Input 1 State — Physical switch/button input 1 state, available via /rpc/Input.GetStatus?id=0
- Input 2 State — Physical switch/button input 2 state, available via /rpc/Input.GetStatus?id=1
- Returned Energy — Returned/exported energy in Wh, for bi-directional metering scenarios
- 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) for both channels
- Overpower Protection — Configurable power limit threshold in Watts, relay turns off when exceeded
- Cover State — Cover movement state (open/opening/closed/closing/stopped/calibrating), available in Cover.GetStatus
- Cover Open/Close/Stop Commands — Direct open/close/stop commands without position parameter; template uses GoToPosition instead

## 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 2PM Gen3 Knowledge Base
  
  [kb.shelly.cloud](https://kb.shelly.cloud/knowledge-base/shelly-2pm-gen3) 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/)

