
The Shelly Motion 2 (SHMOS-02) is a battery-powered (Li-ion 6500 mAh, USB-C rechargeable) Wi-Fi PIR motion 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 (motion detection or periodic timer).
Unlike relay-type Gen1 Shelly devices that publish individual state topics, the Motion 2 publishes its complete status via a single /info JSON payload when it wakes. The TapHome listener script parses this JSON to extract motion state, luminance, temperature, battery level and diagnostic attributes.
The template supports up to 5 Shelly Motion 2 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 Motion 2 has a unique MQTT Device ID in the format shellymotion2-<MAC>, where <MAC> is the full 12-character MAC address in uppercase hex (e.g., shellymotion2-AABBCCDDEEFF).
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→device.hostnamefield
Template setup
After importing the template in TapHome:
- Open the Shelly Motion 2 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 Motion 2 (e.g.,shellymotion2-AABBCCDDEEFF)
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
shellymotion2-deviceidvalue) will show an error message prompting you to set the correct topic.
Motion sensor settings
The Shelly Motion 2 has several configurable parameters that affect detection behavior. These are configured directly on the device via its web UI (http://<device-ip>/), not through TapHome:
| Parameter | Range | Description |
|---|---|---|
| Sensitivity | 1–256 | Motion detection sensitivity (lower = more sensitive) |
| Blind time | 1–1440 min | Minutes to ignore motion after a detection event |
| Pulse count | 1–4 | Consecutive movements required to confirm motion |
| Operating mode | ANY / DARK / TWILIGHT / BRIGHT | When detection is active based on ambient light |
| Sleep time | 0–86400 s | Periodic wake interval in seconds |
Shorter sleep times increase data freshness but reduce battery life. The default wake interval is sufficient for most use cases. Motion events always trigger an immediate wake regardless of the sleep timer.
Device capabilities
Motion detection
Each sensor instance is mapped as a Reed Contact device with “security” capability in TapHome. The motion state is parsed from the shellies/<id>/info topic — specifically the $.sensor.motion field in the JSON payload:
true→ Alarm (motion detected)false→ OK (no motion)
The sensor wakes up and publishes its state when motion is detected (subject to sensitivity, blind time and pulse count settings), and also during periodic wake intervals.
Service attributes
Each sensor instance exposes 14 device-level service attributes, all parsed from the /info JSON payload:
| Attribute | Source field | Description |
|---|---|---|
| IP Address | $.wifi_sta.ip | Wi-Fi IP address of the sensor |
| MAC Address | $.mac | Hardware MAC address |
| Battery | $.bat.voltage, $.bat.value | Battery voltage and percentage (e.g., 3.83V (97%)) |
| Signal | $.wifi_sta.rssi | Wi-Fi signal strength in dB |
| Cloud enabled | $.cloud.enabled | Whether Shelly Cloud is enabled |
| Cloud connected | $.cloud.connected | Whether device is connected to Shelly Cloud |
| Device time | $.time | Current time on the device |
| Luminance | $.lux.value | Ambient light level in lux |
| Temperature | $.tmp.value, $.tmp.units | Internal temperature reading |
| Uptime | $.uptime | Time since last reboot |
| FW version | $.fw_info.fw | Current firmware version |
| FW update | $.update.has_update | Whether a firmware update is available |
| Free RAM | $.ram_total, $.ram_free | Available memory |
| Free FS space | $.fs_size, $.fs_free | Available filesystem storage |
A low battery warning is triggered automatically when the battery level drops below 20%.
Additional capabilities (not implemented)
The Shelly Motion 2 also publishes vibration/tamper detection ($.sensor.vibration, configurable sensitivity 0–80), illumination category ($.lux.illumination — dark/twilight/bright), and USB charger status ($.charger) via the /info JSON payload. An online/offline status is available via the LWT topic (shellies/<id>/online). These capabilities are available in the device’s MQTT output but are not mapped in the current TapHome template. They can be added in a future template update.
Troubleshooting
Sensor not reporting data
- Verify the Shelly Motion 2 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.,shellymotion2-AABBCCDDEEFF) - Use an MQTT client (e.g., MQTT Explorer) to subscribe to
shellies/#and verify the sensor publishes messages on wake-up - The Motion 2 is battery-operated and only publishes data when it wakes — trigger a motion event to force a wake-up
Motion state not updating
- Check that the PIR sensor lens is not obstructed and the sensor is mounted at the recommended height (1.8–2.5 m)
- If the sensor was recently installed, verify the sensitivity and blind time settings in the device web UI — a high blind time means the sensor ignores motion for longer periods after each detection
- Adjust the pulse count if the sensor is triggering too rarely (lower = fewer consecutive movements needed)
- Check TapHome for the Reed Contact device state — 1 = motion detected (alarm), 0 = no motion (OK)
Battery draining quickly
- Shelly Motion 2 uses a built-in Li-ion rechargeable battery (6500 mAh) charged via USB-C, with typical active life of 12–18 months
- Frequent wake-ups due to high motion activity or short sleep intervals drain the battery faster
- Enabling SSL on MQTT significantly reduces battery life — use plain MQTT (port 1883) on a trusted local network
- Ensure strong Wi-Fi signal at the sensor location — weak signal means longer connection times on each wake
Gen1 Shelly devices do not support MQTT over TLS without significant battery impact. Communication between the sensor and the MQTT broker is typically unencrypted (plain MQTT, port 1883). Ensure the MQTT broker is on a trusted local network.
Enabling MQTT on Gen1 Shelly devices disables Cloud connectivity. MQTT and Cloud cannot coexist on the same device.