
The Shelly Plus 1PM is a compact Gen2+ 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 AC) or 10 A (30 V DC). This is the MQTT variant of the TapHome template — the device communicates through an MQTT broker instead of direct HTTP polling, which is useful in multi-controller environments or when the device is behind a different VLAN.
The template exposes two devices: an Electric Meter for power and energy monitoring, and a Switch for relay control. Three module-level service attributes report internal temperature, voltage, and current.
Configuration
MQTT Client ID
Each Shelly Plus 1PM has a unique MQTT Client ID in the format shellyplus1pm-<DEVICEID>, where <DEVICEID> is the 12-character hex MAC address (e.g., shellyplus1pm-AABBCCDDEE00).
The Client ID can be found:
- In the Shelly web UI: Settings → MQTT → Client ID
- Via API:
GET http://<device-ip>/rpc/MQTT.GetConfig→client_idfield - On the device label (MAC address)
This device supports mDNS discovery. You can use the hostname
shellyplus1pm-{MAC}.localinstead of an IP address when verifying connectivity. Replace{MAC}with the device’s full MAC address in lowercase hex (e.g.,shellyplus1pm-aabbccddee00.local).
Enabling MQTT
- Open the Shelly web UI:
http://<device-ip>/ - Navigate to Settings → MQTT
- Enable MQTT
- Set Server:
<broker-ip>:<port>(e.g.,192.168.1.10:1883) - The Client ID is pre-filled — leave as-is unless you have a specific reason to change it
- Click Save and reboot the device
To verify MQTT is working, use an MQTT client (e.g., MQTT Explorer) and subscribe to
shellyplus1pm-<DEVICEID>/#. You should see status messages from the device, includingshellyplus1pm-<DEVICEID>/status/switch:0.
Template setup
After importing the template in TapHome:
- Open the Shelly Plus 1PM MQTT Module
- Set the MQTT Broker IP and Port (default
1883) - Set the plug1topic custom variable to the MQTT Client ID of the Shelly Plus 1PM (e.g.,
shellyplus1pm-AABBCCDDEE00)
The module subscribes to {plug1topic}/status/switch:0 and publishes control commands to {plug1topic}/command/switch:0.
Device capabilities
Power metering
The Electric Meter device reads two values from the {plug1topic}/status/switch:0 MQTT status message:
- Instantaneous power —
apowerreported in watts, converted to kW by the template (divided by 1000) - Cumulative energy —
aenergy.totalreported in watt-hours, converted to kWh by the template (divided by 1000)
The meter is read-only — it updates automatically whenever the device publishes a status message to the MQTT broker.
Relay control
The Switch device controls the relay:
- Read state — subscribes to
{plug1topic}/status/switch:0and reads theoutputboolean field - Write state — publishes
onoroffto{plug1topic}/command/switch:0
The relay supports up to 3500 W / 16 A at 230 V AC.
Diagnostics
Three module-level service attributes are parsed from the same status/switch:0 JSON payload:
| Attribute | Unit | Description |
|---|---|---|
| Internal temperature | °C | Internal device temperature — monitors relay and PCB thermal state |
| Voltage | V | AC supply voltage at the relay input |
| Current | A | Load current through the relay output |
All three attributes display “Unknown” until the first MQTT status message arrives (initial value is NaN).
Additional capabilities
The Shelly Plus 1PM also exposes power factor, network frequency, returned energy (for bidirectional metering), physical input state, toggle command, auto-off timer, and a force status update action through its MQTT API. These capabilities can be added in a future template update.
Troubleshooting
MQTT messages not arriving
- Verify MQTT is enabled in the Shelly web UI (Settings → MQTT)
- Confirm the broker address and port are correct in both the Shelly device and TapHome module settings
- Check that the
plug1topiccustom variable matches the Shelly’s MQTT Client ID exactly (e.g.,shellyplus1pm-AABBCCDDEE00) - Use an MQTT client (e.g., MQTT Explorer) to subscribe to
shellyplus1pm-#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
{plug1topic}/status/switch:0with an MQTT client and verifyapowerreturns a non-zero value
Relay not responding to commands
- Verify TapHome can reach the MQTT broker (correct IP and port in the module settings)
- Check that the
plug1topicvalue matches the device’s MQTT Client ID - Test by publishing
onto{plug1topic}/command/switch:0via an MQTT client — the relay should switch on
Diagnostics showing “Unknown”
- All three service attributes (temperature, voltage, current) show “Unknown” until the first status message arrives
- If values remain “Unknown” after the device has been running, check that the MQTT connection is active and status messages are being published
- Reboot the Shelly device to force a fresh status publish
Gen2+ Shelly devices support MQTT with optional TLS. If TLS is not configured, communication between the device and the MQTT broker is unencrypted (plain MQTT, port 1883). For encrypted communication, enable TLS in the Shelly MQTT settings and use port 8883.