
The Shelly Flood is a battery-powered (CR123A) Wi-Fi water leak sensor. TapHome communicates with the device over MQTT — the recommended protocol for battery-operated Shelly devices, since the sensor sleeps most of the time and publishes data only on wake-up events.
The template supports up to 5 Shelly Flood sensors per module. Each sensor instance is distinguished by a sensorN_topic custom variable pointing to the device’s MQTT Client ID.
Configuration
Device ID
Each Shelly Flood sensor has a unique MQTT Device ID in the format shellyflood-<MAC6>, where <MAC6> is the last 6 characters of the MAC address in lowercase hex (e.g., shellyflood-112233).
The Device ID can be found:
- On the device label (MAC address)
- In the Shelly web UI: Settings → Device Info
- Via API:
GET http://<device-ip>/settings→mqtt.idfield
This device supports mDNS discovery. You can use the hostname
shellyflood-{MAC}.localinstead of an IP address when configuring TapHome. Replace{MAC}with the last 6 characters of the device’s MAC address in lowercase hex (e.g.,shellyflood-112233.local). Using a hostname prevents connectivity issues when the device’s IP address changes.
Template setup
After importing the template in TapHome:
- Open the Shelly Flood MQTT module
- Set the MQTT Broker IP and Port (default
1883) - For each sensor instance, set the
sensorN_topiccustom variable to the Device ID of the corresponding Shelly Flood (e.g.,shellyflood-112233)
The module subscribes to shellies/# and the listener scripts filter messages by the configured topic prefix.
Only configure the sensor slots you actually use. Unconfigured slots (with the default
shellyflood-deviceidvalue) will show an error message prompting you to set the correct topic.
Device capabilities
Water leak detection
Each sensor instance is mapped as a Reed Contact device in TapHome. The flood state is read from the shellies/<id>/sensor/flood topic:
true→ Alarm (water detected)false→ OK (dry)
The sensor wakes up and publishes its state when water is detected or gone, and also during periodic reporting intervals.
Battery and temperature monitoring
Each sensor instance exposes two service attributes:
- Battery — battery level percentage read from
shellies/<id>/sensor/battery. A low battery warning is triggered when the level drops below 20%. - Temperature — ambient temperature in °C read from
shellies/<id>/sensor/temperature.
Both attributes are read-only and update whenever the sensor wakes up and publishes data.
Additional capabilities
The Shelly Flood also publishes an online/offline status via the MQTT Last Will and Testament (LWT) topic, and a full JSON status message (firmware ≥1.8.0). A rain_sensor setting is available that inverts the flood detection logic for outdoor rain detection use. These capabilities can be added in a future template update.
Troubleshooting
Sensor not reporting data
- Verify the Shelly Flood is connected to Wi-Fi and MQTT is enabled in the device settings
- Check that the
sensorN_topiccustom variable matches the Device ID exactly (e.g.,shellyflood-112233) - If the MQTT broker address changed, try using the mDNS hostname (
shellyflood-AABBCCDDEE.local) to verify the sensor is reachable on the network - Use an MQTT client (e.g., MQTT Explorer) to subscribe to
shellies/#and verify the sensor publishes messages on wake-up
Flood alarm not triggering
- Confirm the sensor contacts on the bottom of the device are clean and not obstructed
- Test by placing the sensor on a wet surface — the device should publish
trueon the/sensor/floodtopic within seconds - Check TapHome for the Reed Contact device state — 1 = alarm, 0 = OK
Battery draining quickly
- Shelly Flood is designed for long battery life (CR123A, typically 1–2 years depending on reporting frequency)
- Frequent wake-ups (e.g., due to unstable Wi-Fi requiring repeated reconnection) can drain the battery faster
- Ensure strong Wi-Fi signal at the sensor location
Gen1 Shelly devices do not support MQTT over TLS. Communication between the sensor and the MQTT broker is unencrypted (plain MQTT, port 1883). Ensure the MQTT broker is on a trusted local network.