
The Shelly 1PM is a compact single-channel Wi-Fi relay switch with built-in power metering. It fits behind a standard wall switch and can control one circuit up to 16 A (3500 W at 230 V). TapHome communicates with the device over MQTT — this is the MQTT variant of the Shelly 1PM template, suitable when you prefer local MQTT communication over HTTP polling.
The template supports up to 5 Shelly 1PM units per module. Each unit is distinguished by a pulgNtopic custom variable pointing to the device’s MQTT Client ID. Each unit exposes a relay switch and an electricity meter.
Configuration
Device ID
Each Shelly 1PM has a unique MQTT Device ID in the format shelly1pm-<MAC6>, where <MAC6> is the last 6 characters of the MAC address in lowercase hex (e.g., shelly1pm-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
shelly1pm-{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.,shelly1pm-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 1PM MQTT module
- Set the MQTT Broker IP and Port (default
1883) - For each Shelly 1PM unit, set the
pulgNtopiccustom variable to the Device ID of the corresponding Shelly 1PM (e.g.,shelly1pm-112233)
The module subscribes to shellies/# and the listener scripts filter messages by the configured topic prefix.
Only configure the unit slots you actually use. Unconfigured slots (with the default
shelly1pm-deviceidNvalue) will not match any real device and can be ignored.
Device capabilities
Relay control
Each unit exposes a switch device in TapHome. The relay state is read from the shellies/<id>/relay/0 topic and controlled by publishing on or off to shellies/<id>/relay/0/command.
Power metering
Each unit includes an electricity meter that reads two values:
- Real-time power —
shellies/<id>/relay/0/powerreported in watts, converted to kW by the template - Total consumption —
shellies/<id>/relay/0/energyreported in watt-minutes, converted to kWh by the template
The meter is read-only — it updates automatically whenever the device publishes new data.
Thermal and overpower monitoring
Each switch device exposes four service attributes:
- Internal temperature — device temperature in °C read from
shellies/<id>/temperature - Temperature status — thermal level: Normal, High, or Very High (
shellies/<id>/temperature_status) - Overheated — overtemperature alarm flag (
shellies/<id>/overtemperature) - Overpower — reports the load power (W) when an overpower condition was detected (
shellies/<id>/overpower_value)
Additional capabilities
The Shelly 1PM also publishes an online/offline status via the MQTT Last Will and Testament (LWT) topic, a full JSON status message (firmware ≥1.8.0), physical input state, and input events (short/double/triple/long press). These capabilities can be added in a future template update.
Troubleshooting
Device not reporting data
- Verify the Shelly 1PM is connected to Wi-Fi and MQTT is enabled in the device settings
- Check that the
pulgNtopiccustom variable matches the Device ID exactly (e.g.,shelly1pm-112233) - Confirm the MQTT broker IP and port are correct in the module settings
- Use an MQTT client (e.g., MQTT Explorer) to subscribe to
shellies/#and verify the device publishes messages
Power readings show zero
- Confirm the load is connected through the Shelly relay (not bypassed)
- Check that the relay is turned on — the meter only reads when current flows through the relay
- Subscribe to
shellies/<id>/relay/0/powerwith an MQTT client and verify the device reports a non-zero value
Overtemperature warning
The Shelly 1PM has internal thermal protection. If the device temperature exceeds safe limits, the temperature_status changes to “High” or “Very High” and overtemperature becomes true. Ensure adequate ventilation around the device, especially when switching high loads.
Gen1 Shelly devices do not support MQTT over TLS. Communication between the device and the MQTT broker is unencrypted (plain MQTT, port 1883). Ensure the MQTT broker is on a trusted local network.