---
title: "Shelly EM Mini Gen4"
description: "Read consumption, power, returned energy, voltage and current from Shelly EM Mini Gen4 over local HTTP in TapHome. Needs Wi-Fi and device password off."
url: "https://taphome.com/en/compatibility/shelly-em-mini-gen4/"
language: en
lastmod: 2026-11-30
generator: hugo
ai:
  topics: ["http","electric-meter","wifi","power-metering","single-phase"]
  questions: ["How to integrate Shelly EM Mini Gen4 with TapHome?","What does the Shelly EM Mini Gen4 TapHome template measure?","How to connect Shelly EM Mini Gen4 via HTTP to TapHome?","Why does Shelly EM Mini Gen4 show an error in TapHome?","Can TapHome read Shelly EM Mini Gen4 in Zigbee or Matter mode?","Can Shelly EM Mini Gen4 measure energy returned to the grid in TapHome?"]
---

# Shelly EM Mini Gen4

Communication: Packet Parser → HTTP

> 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 EM Mini Gen4 (S4EM-001PXCEU16) is a compact single-phase smart energy meter (29 x 34 x 16 mm) that measures the consumption of one circuit or appliance up to 16 A / 3840 W at 240 V~. It has **no relay** — it measures only and cannot switch the load. The measured current flows directly through the device, so no current transformer is needed.

TapHome reads the device over its local HTTP API on the Wi-Fi network every second — no cloud connection is required. The device also supports Zigbee and Matter, but this template needs it connected to Wi-Fi. For the previous-generation power monitor, see [Shelly PM Mini Gen3](https://taphome.com/en/compatibility/shelly-pm-mini-gen3/).

## Hardware connection

The device fits into an in-wall box or a wall console and is powered from the measured line (110–240 V~, below 1 W).

| Terminal | Function |
|----------|----------|
| L | Live wire (110–240 V~) |
| N | Neutral wire |
| O | Output to the measured load — two terminals, bridged internally |

1. Connect the live wire to the **L** terminal.
2. Connect the neutral wire to the **N** terminal.
3. Connect the load to one of the **O** terminals and to the neutral wire. The whole load current passes through the device, which is how it is measured.

Strip the wires to 6–7 mm, tighten the screw terminals to max. 0.4 Nm and do not put more than one wire into a single terminal.

> [!WARNING]
> Installation on the power grid must be done by a qualified electrician. Switch the circuit breakers off and check with a suitable tester that the wires are dead before connecting. The device and the connected load must be protected by a circuit breaker according to EN 60898-1 — characteristic B or C, max. 16 A rated current. Do not connect a load above 16 A. The device is for indoor use only.

## Configuration

### Connecting to Wi-Fi

The template needs the device connected to a 2.4 GHz Wi-Fi network.

1. Press and hold the button on the device for 5 seconds. This turns on its access point and Bluetooth; the access point appears as `ShellyEMMiniG4-XXXXXXXX`.
2. Add the device to your Wi-Fi network in one of two ways:
   - in the **Shelly Smart Control** mobile app, add a new device and follow the app, or
   - connect a phone or computer to the `ShellyEMMiniG4-XXXXXXXX` network, open `http://192.168.33.1` in a browser and enter your Wi-Fi name and password in the device web interface.
3. After the device joins the network, the manufacturer recommends turning off or password-protecting the device access point.

Holding the button for 10 seconds performs a factory reset — release it at 5 seconds when you only want to enable the access point.

The device ships with Matter firmware by default. Pressing the button five times switches it to Zigbee mode, where its access point is off by default. If the device was switched to Zigbee, return it to Wi-Fi operation as described in the manufacturer's knowledge base before using this template.

### Network address and reachability

To check that the device is reachable, open the following address in a browser on a computer in the same network as the TapHome Core:

```
http://<device-ip>/rpc/Shelly.GetDeviceInfo
```

If the browser shows a JSON response with the device model and MAC address, the device is reachable.

### Authentication and firmware

> [!WARNING]
> Password protection (authentication) must be **turned off** on the Shelly device. The template connects without credentials and cannot read a device that asks for a password. Check this in the device web interface or in the Shelly Smart Control app.

Keep the device firmware up to date — updates are available in the device web interface and in the Shelly Smart Control app.

### Import in TapHome

Import the template and enter the IP address of your device. The template comes with the address `10.10.10.2` filled in — replace it with the address of your Shelly. The template connects to the device on HTTP port 80.

## Device capabilities

The template creates one read-only device. TapHome reads the Shelly every second.

| Device | Name in template | Unit | What it shows |
|--------|------------------|------|---------------|
| Electricity meter | Elektromer | kWh, kW | Total consumption and current power demand of the measured circuit |

### Service attributes

The Electricity meter also shows these values as service attributes, each as text together with its unit:

| Value | Name in template | Unit |
|-------|------------------|------|
| Total consumption | Celková spotreba | kWh |
| Returned energy | Vrátená energia | kWh |
| Voltage | Elektrické napätie | V |
| Current | Elektrický prúd | A |
| Active power | Aktívny výkon | W |
| Frequency | Frekvencia | Hz |

The module shows the connection details of the device as service attributes:

| Value | Name in template | What it shows |
|-------|------------------|---------------|
| Wi-Fi signal strength | Rssi | Signal strength in dB |
| Uptime | UpTime | Time since the last device restart, in days |
| Wi-Fi network | Wifi | Name of the Wi-Fi network the device is connected to |
| IP address | IP | Current IP address of the device |

When the device reports that it needs a restart (for example after a firmware update or a settings change), the module shows the warning "Vyžadovaný reštart zariadenia" (device restart required). Restart the Shelly in the device web interface or in the Shelly Smart Control app.

### Energy metering

The **Electricity meter** shows the total consumption in kWh and the current power demand in kW. The same power is also shown in watts in the **Active power** service attribute.

The device measures energy in both directions. **Returned energy** is the energy delivered back to the grid through the measured circuit — for example from a photovoltaic system — and is counted separately from consumption.

## Troubleshooting

### Device is offline or shows an error

1. Check that the TapHome Core and the Shelly are in the same network (same VLAN / subnet), or that the router allows HTTP traffic between them.
2. Check that the IP address in the template matches the current address of the device — the address may have changed.
3. Open `http://<device-ip>/rpc/Shelly.GetDeviceInfo` in a browser on the same network as the Core. A JSON response means the device is reachable.
4. If the browser asks for a user name and password, authentication is enabled on the Shelly — turn it off.
5. Check that the device is in Wi-Fi operation and not in Zigbee mode.
6. Check the Wi-Fi signal strength in the **Rssi** service attribute of the module, in the Shelly Smart Control app or in the device web interface — a weak signal causes intermittent outages.

### Values show no reading

1. If the device answers in the browser but the values stay empty, update the device firmware and import the latest version of the template.
2. If power and current stay at zero, check that the load is connected through the O terminals and that the circuit is switched on — the device measures only the current that flows through it.

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

These devices appear in TapHome after import.

Shelly EM Mini gen4 Module

Service Attributes

|        |
|--------|
| Rssi   |
| UpTime |
| Wifi   |
| IP     |

Custom Variables

|                             |
|-----------------------------|
| `EMStatus` (string)         |
| `EMDataStatus` (string)     |
| `Shelly.GetStatus` (string) |

Read (module)

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

response := SENDHTTPREQUEST("/rpc/EM1Data.GetStatus?id=0");
IF response.IsSuccess
    EMDataStatus := response.Content;
END

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



if parsejson(Shelly.GetStatus, "sys.restart_required", true)
    addwarning("Vyžadovaný reštart zariadenia");
END
```

Service Attributes

Rssi

```taphome
return(parsejson(Shelly.GetStatus,"wifi.rssi")+" dB")
```

UpTime

```taphome
return(round(parsejson(Shelly.GetStatus,"sys.uptime")/86400)+" dni")
```

Wifi

```taphome
return(parsejson(Shelly.GetStatus,"wifi.ssid"))
```

IP

```taphome
return(parsejson(Shelly.GetStatus,"wifi.sta_ip"))
```

Elektromer Electricity Meter

Service Attributes

|                    |
|--------------------|
| Celková spotreba   |
| Vrátená energia    |
| Elektrické napätie |
| Elektrický prúd    |
| Aktívny výkon      |
| Frekvencia         |

Read total consumption

```taphome
return(parsejson(EMDataStatus,"total_act_energy")/1000);
```

Read demand

```taphome
return(parsejson(EMStatus,"act_power")/1000);
```

Service Attributes

Celková spotreba

```taphome
return(round(parsejson(EMDataStatus,"total_act_energy"))/1000+" Kwh");
```

Vrátená energia

```taphome
return(round(parsejson(EMDataStatus,"total_act_ret_energy"))/1000+" Kwh");
```

Elektrické napätie

```taphome
return(parsejson(EMStatus,"voltage")+" V");
```

Elektrický prúd

```taphome
return(parsejson(EMStatus,"current")+" A");
```

Aktívny výkon

```taphome
return(parsejson(EMStatus,"act_power")+" W");
```

Frekvencia

```taphome
return(parsejson(EMStatus,"freq")+" Hz");
```

**Connection:** Packet Parser → HTTP

## Import parameters

Enter these values when you import the XML.

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

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

