TapHome

Shelly Pro 4PM

Packet Parser → HTTP
Submitted by
Last updated: 03. 2026
Shelly Pro 4PM

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).

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.

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

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 powerapower reported in watts, converted to kW by the template
  • Total consumptionaenergy.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).

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=Noutput field.

Power sensor

A standalone power sensor device exposes the raw active power in watts for channel 1 (read from /rpc/Switch.GetStatus?id=0apower). 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.

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 (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.1Internet & SecurityWi-Fi Mode - Client
  4. Enter SSID and password → Save

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:

1
shelly<model>-<MAC>.local

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

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

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

Shelly Pro 4PM Module
Service Actions
Set power protectionSet maximum power limit (1–3500 W) — relay turns off automatically if consumption exceeds this value
Enable cloudEnable or disable Shelly Cloud connectivity
RebootTrigger a device reboot
Custom Variables
StatusJson (string)
SettingsJson (string)
status (string) = 0

Shelly 4 Pro

Read (module)
VAR response := SENDHTTPREQUEST("/status", "GET");
StatusJson := response.Content;
Service Actions
Set power protection
Parameters: Maximum power (1–3500 Watts)
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)
VAR response := SENDHTTPREQUEST("/settings/cloud?enabled=" + enable);
VAR contentJson := response.Content;
VAR wasEnabled := PARSEJSON(contentJson, "enabled");

IF(wasEnabled, "Cloud enabled", "Cloud disabled");
Reboot
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

Channel 1 Energy Meter

Read total consumption
return(parsejson(parsejson(status,"aenergy"), "total")/1000);
Read demand
return(parsejson(status,"apower")/1000);
Read (module)
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

Channel 2 Energy Meter

Read total consumption
return(parsejson(parsejson(status,"aenergy"), "total")/1000);
Read demand
return(parsejson(status,"apower")/1000);
Read (module)
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

Channel 3 Energy Meter

Read total consumption
return(parsejson(parsejson(status,"aenergy"), "total")/1000);
Read demand
return(parsejson(status,"apower")/1000);
Read (module)
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

Channel 4 Energy Meter

Read total consumption
return(parsejson(parsejson(status,"aenergy"), "total")/1000);
Read demand
return(parsejson(status,"apower")/1000);
Read (module)
var x := (sendhttprequest("/rpc/Switch.GetStatus?id=3"));
status := x.Content;
Channel 2 Relay Switch

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

boolean
Values / States: ON · OFF

Channel 2 Relay

Write switch state
VAR path := "relay/1?turn=" + SWITCH(St, 0, "off", 1, "on","off");
SENDHTTPREQUEST(path);
Channel 1 Relay Switch

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

boolean
Values / States: ON · OFF

Channel 1 Relay

Write switch state
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

Channel 1 Power Sensor

Read
return(parsejson(status,"apower"));
Read (module)
var x := (sendhttprequest("/rpc/Switch.GetStatus?id=0"));
status := x.Content;
Channel 3 Relay Switch

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

boolean
Values / States: ON · OFF

Channel 3 Relay

Write switch state
VAR path := "relay/2?turn=" + SWITCH(St, 0, "off", 1, "on","off");
SENDHTTPREQUEST(path);
Channel 4 Relay Switch

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

boolean
Values / States: ON · OFF

Channel 4 Relay

Write switch state
VAR path := "relay/3?turn=" + SWITCH(St, 0, "off", 1, "on","off");
SENDHTTPREQUEST(path);
Connection: Packet Parser → HTTP
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

Sources