---
title: "Shelly Plus H\u0026T"
description: "Shelly Plus H\u0026T (Gen2) reports temperature, humidity, battery and diagnostics to TapHome over MQTT status topics. Differences to H\u0026T Gen3 explained."
url: "https://taphome.com/en/compatibility/shelly-plus-ht-mqtt/"
language: en
lastmod: 2026-03-30
generator: hugo
ai:
  topics: ["mqtt","sensor","wifi","battery-powered","temperature-humidity"]
  questions: ["How to integrate Shelly Plus H\u0026T with TapHome via MQTT?","What does the Shelly Plus H\u0026T TapHome template measure?","What service attributes does the Shelly Plus H\u0026T template expose?","Why is my Shelly Plus H\u0026T not reporting temperature and humidity?","Does Shelly Plus H\u0026T report battery level and voltage in TapHome?","What is the difference between Shelly Plus H\u0026T and Shelly H\u0026T Gen3?"]
---

# Shelly Plus H&T

Communication: Packet Parser → MQTT

- [Shelly Plus H&T Product Page](https://www.shelly.com/en/products/shop/shelly-plus-h-t)

> Network address
> 
> With the MQTT broker built into TapHome, enter `127.0.0.1` as the broker address in TapHome. In the device, enter the IP address of the TapHome Core and give the Core an IP reservation in the router.
> 
> [Network Preparation](https://taphome.com/en/docs/setup/network-preparation/)

## Integration guide

The Shelly Plus H&T (SNSN-0013A) is a battery-powered (4x AA) Wi-Fi temperature and humidity sensor with an e-paper display. It is a Gen2 (Plus series) device, now discontinued and replaced by the Shelly H&T Gen3, but still widely deployed. TapHome communicates with the device over MQTT using individual `/status/` topics for each component. This is the standard approach for Gen2 Shelly devices — the listener script subscribes to `<device-id>/#` and processes incoming status messages as the sensor wakes from deep sleep and publishes data.

The template creates a single Temperature & Humidity Sensor device with 9 device-level service attributes covering battery, network, and connectivity diagnostics. Unlike the Gen3 variant (which uses consolidated `events/rpc` notifications), this Gen2 template processes individual `/status/temperature:0`, `/status/humidity:0`, `/status/devicepower:0`, and other component-specific topics.

## Configuration

### Device ID

Each Shelly Plus H&T has a unique Device ID in the format `shellyplusht-<MACADDRESS>`, where `<MACADDRESS>` is the full 12-character MAC address in uppercase hex (e.g., `shellyplusht-A8032AB12CD3`). This ID also serves as the MQTT topic prefix.

The Device ID can be found:

- On the device label (MAC address)
- In the Shelly web UI: **Settings** → **Device Info** → **Device ID**
- Via API: `GET http://<device-ip>/rpc/Mqtt.GetConfig` → `client_id` field

### Template setup

After importing the template in TapHome:

1. Open the **Shelly Plus H&T MQTT** module
2. Set the **MQTT Broker IP** to the address of the MQTT broker
3. Set the **Port** (default `1883`)
4. Set the **Device ID** import parameter to the device's Device ID (e.g., `shellyplusht-A8032AB12CD3`)

The module subscribes to `<device-id>/#` and the listener script parses individual `/status/` JSON messages from each component topic.

> [!TIP]
> Ensure MQTT is enabled on the Shelly Plus H&T and `status_ntf` (status notifications) is set to `true`. The template relies on individual status topics (`/status/temperature:0`, `/status/humidity:0`, etc.), not the consolidated `events/rpc` topic.

### Measurement and reporting behavior

The Shelly Plus H&T operates differently depending on the power source:

- **Battery mode** — wakes every 1 minute for measurement. Reports to MQTT if temperature changes more than 0.5 °C or humidity changes more than 5%. An unconditional status report is sent every 2 hours if no threshold-based reports were triggered. A 5-minute cooldown period prevents excessive wake-ups.
- **USB power mode** — wakes every 5 minutes for measurement, display update, and unconditional reporting on every cycle.

The e-paper display updates when temperature changes more than 0.2 °C or humidity changes more than 3%.

> [!WARNING]
> The device is battery-operated and spends most of its time in deep sleep. TapHome cannot actively poll the sensor — it relies on the device pushing status via MQTT on wake-up. Expect gaps between readings, especially in battery mode. USB Type-C power provides more frequent updates but does not charge the internal batteries.

## Device capabilities

### Temperature and humidity

The sensor device reads temperature and humidity from individual MQTT status topics:

- **Temperature** — ambient temperature in Celsius, read from `tC` in the `/status/temperature:0` topic
- **Humidity** — relative humidity percentage, read from `rh` in the `/status/humidity:0` topic (the readhumidity script divides the value by 100 to convert to the 0–1 range expected by TapHome)

Both values are read-only and update whenever the sensor wakes up and publishes data.

The temperature report threshold is configurable on the device (default 0.5 °C, range 0.5–5.0 °C). The humidity report threshold defaults to 5% (range 1–20%). These thresholds can be adjusted via the Shelly web UI or API to balance reporting frequency against battery life.

### Service attributes

The template exposes 9 device-level service attributes providing battery status and device diagnostics:

**Battery monitoring:**
- **Battery** — battery charge percentage from `battery.percent` in `/status/devicepower:0`
- **Battery voltage** — battery voltage in Volts from `battery.V` in `/status/devicepower:0`
- **External power** — whether USB Type-C external power is connected, from `external.present` in `/status/devicepower:0`

**Network diagnostics:**
- **WiFi** — connected WiFi network SSID from `/status/wifi`
- **IP Address** — device IP address from `/status/wifi`
- **MAC Address** — device MAC address from `/status/sys`

**Connectivity status:**
- **Cloud connected** — Shelly Cloud connection status from `/status/cloud`
- **MQTT connected** — MQTT broker connection status from `/status/mqtt`
- **BLE enabled** — Bluetooth Low Energy status from `/status/ble`

All service attributes display `"-"` when no data has been received yet (initial state after template import, before the first sensor wake-up).

### Additional capabilities

The Shelly Plus H&T also publishes temperature in Fahrenheit (`tF` field in `/status/temperature:0`), WiFi signal strength (RSSI in dBm), and supports the HT_UI component for configuring the e-paper display temperature unit (°C/°F). The device also provides an online/offline status via the MQTT Last Will and Testament (LWT) topic. These capabilities can be added in a future template update.

## Troubleshooting

### Sensor not reporting data

1. Verify the Shelly Plus H&T is connected to Wi-Fi and MQTT is enabled in the device settings (**Settings** → **MQTT** → **Enable**)
2. Check that `status_ntf` is set to `true` — the template requires individual status notifications on `/status/` topics
3. Confirm the **Device ID** import parameter matches the device's Device ID exactly (e.g., `shellyplusht-A8032AB12CD3`)
4. Use an MQTT client (e.g., MQTT Explorer) to subscribe to `<device-id>/#` and verify the sensor publishes status messages on wake-up
5. Check the device battery level — depleted batteries prevent the sensor from connecting to Wi-Fi

### Humidity reading appears incorrect

1. The TapHome template divides the raw humidity value by 100 (e.g., `rh: 55.3` becomes `0.553` in TapHome). This is expected behavior — TapHome uses a 0–1 range internally
2. The sensor has a configurable humidity offset (`Humidity.SetConfig` → `offset`) — verify it is not set to an incorrect value
3. The operating humidity range of the sensor is 30–70% RH. Readings outside this range may be less accurate

### Service attributes showing "-"

1. Service attributes display `"-"` until the sensor wakes up and publishes data on the corresponding status topic
2. On battery power, the device may take up to 2 hours to send its first unconditional report — press the reset button (behind the back cover) to trigger an immediate measurement and report
3. Verify the MQTT broker is receiving messages on all expected topics (`/status/sys`, `/status/wifi`, `/status/cloud`, `/status/mqtt`, `/status/ble`)

### Differences from Shelly H&T Gen3

The Shelly Plus H&T (Gen2) and Shelly H&T Gen3 have similar sensor capabilities but differ in MQTT communication:

- **Gen2 (Plus H&T)** uses individual `/status/` topics per component — requires `status_ntf: true`
- **Gen3 (H&T Gen3)** uses consolidated `events/rpc` topic with `NotifyStatus` JSON-RPC events — requires `rpc_ntf: true`
- The Gen3 template also includes timestamp-based offline detection (>12h warning, >24h error), which the Gen2 template does not implement

## How to install in TapHome

### Prerequisites

- Shelly device connected to Wi-Fi (2.4 GHz), e.g. through the Shelly app or the device's own access point
- MQTT broker running on your local network (e.g., Mosquitto, Home Assistant, or TapHome built-in broker)
- TapHome CCU on the same network as the broker

> [!WARNING]
> On **Gen1** devices, enabling MQTT **disables Shelly Cloud**. Both cannot run simultaneously. On Gen2/Plus devices this limitation does not apply.

### Step 1 — Enable MQTT on the Shelly device

#### Gen1 devices (Shelly 1, 1PM, 2.5, EM, 3EM, Plug S, RGBW2, Dimmer, TRV…)

1. Open the Shelly web UI: `http://<device-ip>/`
2. Navigate to **Internet & Security** → **Advanced — MQTT**
3. Enable **MQTT**
4. Set **MQTT Server**: `<broker-ip>:<port>` (e.g., `192.168.1.10:1883`)
5. Optionally set **MQTT User** and **MQTT Password** if your broker requires authentication
6. Click **Save** — the device will reboot and connect to the broker

#### Gen2 / Plus devices (Shelly Plus 1, Plus 1PM, Plus 2PM, Plus Plug S, Plus H&T, Pro 3EM…)

1. Open the Shelly web UI: `http://<device-ip>/`
2. Navigate to **Settings** → **MQTT**
3. Enable **MQTT**
4. Set **Server**: `<broker-ip>:<port>` (e.g., `192.168.1.10:1883`)
5. The **Client ID** is pre-filled with the device ID (e.g., `shellyplus1pm-AABBCCDDEE`) — leave as-is unless you have a specific reason to change it
6. Click **Save** and reboot the device

With the TapHome built-in broker, `<broker-ip>` is the IP address of the TapHome Core. Give the Core an IP reservation in the router, otherwise the device loses the broker when the router changes the address → [Network Preparation](https://taphome.com/en/docs/setup/network-preparation/).

> [!TIP]
> To verify MQTT is working, use an MQTT client (e.g., MQTT Explorer) and subscribe to `shellies/#` (Gen1) or `<device-id>/#` (Gen2). You should see status messages from the device.

### Step 2 — Find the Device ID / MQTT Client ID

Some templates require a **Device ID** or **MQTT Client ID** parameter. This is the unique identifier used in MQTT topics.

- **Gen1:** found on the label as MAC address (e.g., `AABBCCDDEE`). Device ID = `shelly<model>-<mac>`, e.g., `shelly1pm-AABBCCDDEE`
- **Gen2/Plus:** found in the Shelly web UI under **Settings** → **Device Info** → **Device ID**, or on the device label

### Step 3 — Configure in TapHome

1. In TapHome, add a new **Packet Parser (MQTT)** module
2. **IP Address:** `127.0.0.1` for the TapHome built-in broker (the control unit connects to itself, the address never changes); for an external broker its IP address (e.g., `192.168.1.10`)
3. **Port:** `1883` (default; use `8883` for TLS)
4. **Device ID / MQTT Client ID:** enter the value from Step 2 (if required by the template)
5. Import the template — TapHome will subscribe to the device topics automatically

## Available devices 1

These devices appear in TapHome after import.

Shelly Plus H&T MQTT Module

Custom Variables

`deviceId` (string) MQTT device ID used as topic prefix — format: shellyplusht-{MACADDRESS} (find in Shelly web UI → Settings → Device Info)

Open http://shellyIpAddress → Settings → Device info → copy Device ID (e.g. shellyplusht-A8032AB12CD3)

Temperature & Humidity Sensor Temperature Sensor Read-only

Ambient temperature (°C) and relative humidity from individual /status/ MQTT topics — humidity converted to 0–1 range for TapHome

json Unit: °C / %RH json\_path

Service Attributes

|                 |                                                                              |
|-----------------|------------------------------------------------------------------------------|
| Battery         | Battery charge percentage — displays '-' until first sensor wake-up          |
| Battery voltage | Battery voltage in Volts — useful for tracking battery degradation over time |
| External power  | Whether USB Type-C external power is connected (true/false)                  |
| WiFi            | Connected WiFi network SSID                                                  |
| IP Address      |                                                                              |
| MAC Address     |                                                                              |
| Cloud connected | Shelly Cloud connection status (true/false)                                  |
| MQTT connected  | MQTT broker connection status (true/false)                                   |
| BLE enabled     | Bluetooth Low Energy enabled status (true/false)                             |

Read humidity

```taphome
Hu := listenHum / 100.0;
```

Listener

```taphome
IF (INDEXOF(RECEIVEDMSG.TOPIC, deviceid +"/status/temperature:0") >= 0)
    Te := PARSEJSON(RECEIVEDMSG.PAYLOAD,"tC", true);
ELSEIF (INDEXOF(RECEIVEDMSG.TOPIC, deviceid +"/status/humidity:0") >= 0)
    listenHum := PARSEJSON(RECEIVEDMSG.PAYLOAD,"rh", true);
ELSEIF (INDEXOF(RECEIVEDMSG.TOPIC, deviceid +"/status/devicepower:0") >= 0)
    batteryPerc := PARSEJSON(RECEIVEDMSG.PAYLOAD,"battery.percent", true);
    batteryV := PARSEJSON(RECEIVEDMSG.PAYLOAD,"battery.V", true);
    externalPower := PARSEJSON(RECEIVEDMSG.PAYLOAD,"external.present", true);
ELSEIF (INDEXOF(RECEIVEDMSG.TOPIC, deviceid +"/status/sys") >= 0)
    macAddress := PARSEJSON(RECEIVEDMSG.PAYLOAD,"mac", true);
ELSEIF (INDEXOF(RECEIVEDMSG.TOPIC, deviceid +"/status/wifi") >= 0)
    ipaddress := PARSEJSON(RECEIVEDMSG.PAYLOAD,"sta_ip", true);
    wifi := PARSEJSON(RECEIVEDMSG.PAYLOAD,"ssid", true);
ELSEIF (INDEXOF(RECEIVEDMSG.TOPIC, deviceid +"/status/cloud") >= 0)
    cloudConnected := PARSEJSON(RECEIVEDMSG.PAYLOAD,"connected", true);
ELSEIF (INDEXOF(RECEIVEDMSG.TOPIC, deviceid +"/status/mqtt") >= 0)
    mqttConnected := PARSEJSON(RECEIVEDMSG.PAYLOAD,"connected", true);
ELSEIF (INDEXOF(RECEIVEDMSG.TOPIC, deviceid +"/status/ble") >= 0)
    BLEenabled := PARSEJSON(RECEIVEDMSG.PAYLOAD,"enable", true);
END
```

Service Attributes

Battery

```taphome
IF (ISNAN(batteryPerc), "-", batteryPerc + "%");
```

Battery voltage

```taphome
IF (ISNAN(batteryV), "-", batteryV + "V");
```

External power

```taphome
IF (LENGTH(externalPower) = 0, "-", externalPower);
```

WiFi

```taphome
IF (LENGTH(wifi) = 0, "-", wifi);
```

IP Address

```taphome
IF (LENGTH(ipaddress) = 0, "-", ipaddress);
```

MAC Address

```taphome
IF (LENGTH(macAddress) = 0, "-", macAddress);
```

Cloud connected

```taphome
IF (LENGTH(cloudConnected) = 0, "-", cloudConnected);
```

MQTT connected

```taphome
IF (LENGTH(mqttConnected) = 0, "-", mqttConnected);
```

BLE enabled

```taphome
IF (LENGTH(BLEenabled) = 0, "-", BLEenabled);
```

**Connection:** Packet Parser → MQTT • Hostname: `shellyplusht-{MAC}.local`

Possible improvements (5)

- RPC Event Notifications — Gen3 templates use consolidated events/rpc topic with NotifyFullStatus. This Gen2 template uses individual /status/ topics instead — functionally equivalent.
- Connection Status (LWT) — Last Will and Testament topic — true on connect, false on disconnect. Not used by template.
- Temperature in Fahrenheit — Temperature also available in Fahrenheit (tF field in /status/temperature:0). Template uses tC only.
- E-Paper Display Configuration — Temperature unit (C/F) display setting — display-only configuration, not sensor data.
- WiFi Signal Strength (RSSI) — WiFi signal strength in dBm. Template reads only SSID and IP, not RSSI.

## Import parameters

Enter these values when you import the XML.

| Asked in the app       | Default                     |
|------------------------|-----------------------------|
| Mqtt Broker IP address | `192.168.0.1`               |
| Mqtt Broker port       | `1883`                      |
| Device ID              | `shellyplusht-yourDeviceId` |

## Sources

- Shelly Gen2+/Gen3 RPC API Reference
  
  [shelly-api-docs.shelly.cloud](https://shelly-api-docs.shelly.cloud/gen2/) 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
- 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-27
- Shelly Plus H&T Device API (Temperature, Humidity, DevicePower, HT\_UI)
  
  [shelly-api-docs.shelly.cloud](https://shelly-api-docs.shelly.cloud/gen2/0.14/Devices/ShellyPlusHT/) 2026-03-30
- Shelly Plus H&T Knowledge Base
  
  [kb.shelly.cloud](https://kb.shelly.cloud/knowledge-base/shelly-plus-h-t) 2026-03-30

## Related Documentation

- [MQTT Integration](https://taphome.com/en/compatibility/mqtt-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/)
- [MQTT Broker](https://taphome.com/en/docs/integration/packet-parser/mqtt-broker/)
- [Listener scripts](https://taphome.com/en/docs/script/listener-scripts/)

