
The Shelly H&T Gen3 is a battery-powered (4x AA) Wi-Fi temperature and humidity sensor with a large e-paper display. TapHome communicates with the device over MQTT using Gen2+ RPC notifications on the events/rpc topic. This is the recommended protocol for battery-operated Shelly Gen3 devices, since the sensor sleeps most of the time and publishes data only on wake-up events.
The template creates a single Temperature & Humidity Sensor device and a module-level Battery service attribute. An offline detection mechanism monitors the last received timestamp and raises warnings or errors when the device has not reported for an extended period.
Configuration
MQTT Client ID
Each Shelly H&T Gen3 has a unique MQTT Client ID in the format shellyhtg3-<MAC12>, where <MAC12> is the full 12-character MAC address in uppercase hex (e.g., shellyhtg3-AABBCCDDEEFF). This ID also serves as the default MQTT topic prefix.
The Client ID can be found:
- On the device label (MAC address)
- In the Shelly web UI: Settings → MQTT → Client ID
- Via API:
GET http://<device-ip>/rpc/Mqtt.GetConfig→client_idfield
Template setup
After importing the template in TapHome:
- Open the Shelly H&T Gen3 MQTT module
- Set the MQTT Broker IP to the address of the MQTT broker
- Set the Port (default
1883) - Set the MQTT ID import parameter to the device’s Client ID (e.g.,
shellyhtg3-AABBCCDDEEFF)
The module subscribes to <device-id>/# and the listener scripts parse NotifyStatus JSON-RPC events from the events/rpc topic.
Ensure MQTT is enabled on the Shelly H&T Gen3 and
rpc_ntf(RPC notifications) is set totrue(the default). The template relies onevents/rpcnotifications, not individual status topics.
Measurement and reporting behavior
The Shelly H&T Gen3 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.
- USB power mode — wakes every 5 minutes for measurement, display update, and 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 not permanently connected to the MQTT broker. Expect gaps between readings, especially in battery mode. If the sensor location has weak Wi-Fi signal, frequent reconnection attempts can reduce battery life.
Device capabilities
Temperature and humidity
The sensor device reads temperature and humidity from NotifyStatus events on the events/rpc topic:
- Temperature — ambient temperature in Celsius, read from
params['temperature:0'].tC - Humidity — relative humidity percentage, read from
params['humidity:0'].rh(the listener 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.
Battery monitoring
The module exposes a Battery [%] service attribute that reads the battery charge percentage from params['devicepower:0'].battery.percent in the NotifyStatus event. A low battery warning is triggered when the level drops below 30%.
The battery level updates with every sensor report. On 4x AA batteries, the expected battery life is approximately 1 year under normal conditions.
Offline detection
The template monitors device connectivity using a timestamp-based mechanism. The module listener script stores the Unix timestamp from each NotifyStatus event in the timestamp custom variable. The read script then compares the stored timestamp against the current time:
- Offline > 12 hours — WARNING: “Device is offline > 12H”
- Offline > 24 hours — ERROR: “Device is offline > 24H”
This is particularly useful for battery-operated devices that may go silent due to depleted batteries or Wi-Fi connectivity loss.
Additional capabilities
The Shelly H&T Gen3 also publishes an online/offline status via the MQTT Last Will and Testament (LWT) topic, battery voltage in Volts, and external power status (whether USB Type-C is connected). Individual component status topics (status/temperature:0, status/humidity:0, status/devicepower:0) are available when status_ntf is enabled, and temperature is also available in Fahrenheit. The device features an e-paper display with configurable temperature unit and clock format. These capabilities can be added in a future template update.
Troubleshooting
Sensor not reporting data
- Verify the Shelly H&T Gen3 is connected to Wi-Fi and MQTT is enabled in the device settings (Settings → MQTT → Enable)
- Check that
rpc_ntfis set totrue(default) — the template requires RPC notifications onevents/rpc - Confirm the MQTT ID import parameter matches the device’s Client ID exactly (e.g.,
shellyhtg3-AABBCCDDEEFF) - Use an MQTT client (e.g., MQTT Explorer) to subscribe to
<device-id>/#and verify the sensor publishesNotifyStatusmessages on wake-up - Check the device battery level — depleted batteries prevent the sensor from connecting to Wi-Fi
Humidity reading appears incorrect
- The TapHome template divides the raw humidity value by 100 (e.g.,
rh: 55.3becomes0.553in TapHome). This is expected behavior — TapHome uses a 0–1 range internally - The sensor has a configurable humidity offset (
Humidity.SetConfig→offset) — verify it is not set to an incorrect value - The operating humidity range of the sensor is 30–70% RH. Readings outside this range may be less accurate
Offline warnings despite sensor working
- The offline detection compares the stored timestamp against current time. If the TapHome Core clock is significantly off, false warnings may appear
- On battery power, the sensor reports only when thresholds are exceeded or every 2 hours unconditionally — gaps of up to 2 hours between reports are normal
- If the sensor is in a location with intermittent Wi-Fi, it may miss reporting windows. Verify Wi-Fi signal strength at the sensor location