TapHome

Shelly Plus H&T

Packet Parser → MQTT
Submitted by
Last updated: 03. 2026
Shelly Plus H&T

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: SettingsDevice InfoDevice ID
  • Via API: GET http://<device-ip>/rpc/Mqtt.GetConfigclient_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.

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

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 (SettingsMQTTEnable)
  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.SetConfigoffset) — 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 (see HTTP connection guide if not done yet)
  • 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

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 & SecurityAdvanced — 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 SettingsMQTT
  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

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 SettingsDevice InfoDevice ID, or on the device label

Step 3 — Configure in TapHome

  1. In TapHome, add a new Packet Parser (MQTT) module
  2. IP Address: enter the MQTT broker IP (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

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
BatteryBattery charge percentage — displays '-' until first sensor wake-up
Battery voltageBattery voltage in Volts — useful for tracking battery degradation over time
External powerWhether USB Type-C external power is connected (true/false)
WiFiConnected WiFi network SSID
IP Address
MAC Address
Cloud connectedShelly Cloud connection status (true/false)
MQTT connectedMQTT broker connection status (true/false)
BLE enabledBluetooth Low Energy enabled status (true/false)

Temperature & Humidity Sensor

Read humidity
Hu := listenHum / 100.0;
Listener
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
IF (ISNAN(batteryPerc), "-", batteryPerc + "%");
Battery voltage
IF (ISNAN(batteryV), "-", batteryV + "V");
External power
IF (LENGTH(externalPower) = 0, "-", externalPower);
WiFi
IF (LENGTH(wifi) = 0, "-", wifi);
IP Address
IF (LENGTH(ipaddress) = 0, "-", ipaddress);
MAC Address
IF (LENGTH(macAddress) = 0, "-", macAddress);
Cloud connected
IF (LENGTH(cloudConnected) = 0, "-", cloudConnected);
MQTT connected
IF (LENGTH(mqttConnected) = 0, "-", mqttConnected);
BLE enabled
IF (LENGTH(BLEenabled) = 0, "-", BLEenabled);
Connection: Packet Parser → MQTT
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.

Sources