
The Shelly EM is a single-phase energy meter with two independent metering channels and a 2A relay output for contactor control. Each channel connects to an external CT (current transformer) clamp — available in 50A and 120A variants — allowing non-invasive monitoring of two separate circuits simultaneously. TapHome integrates with the device locally over Wi-Fi using either the HTTP REST API or MQTT. No cloud connection is required.
Two TapHome templates are available: an HTTP template that polls the device’s REST endpoints, and an MQTT template that receives data via an MQTT broker. Both expose the same three devices — two energy meters (one per channel) and a contactor switch.
Configuration
HTTP template
The HTTP template requires only the device’s IP address (or mDNS hostname). TapHome polls three endpoints every 15 seconds:
/emeter/0/— channel 1 energy data/emeter/1/— channel 2 energy datasettings/relay/0— relay state and schedule check
The module-level read script caches each response into a custom variable (emeterZero, emeterOne, status) so that individual device scripts can parse the data without making redundant HTTP calls.
The template also checks the relay schedule status from
settings/relay/0. If internal scheduling is enabled on the Shelly device, the template raises an error — disable scheduling in the Shelly web UI to avoid conflicts with TapHome automation.
MQTT template
The MQTT template requires the broker IP, port, and the Shelly Device ID (format: shellyem-XXXXXXXXXXXX, where X = MAC hex digits). The Device ID can be found in the Shelly web UI under Settings > Device Info.
After enabling MQTT on the Shelly EM (Internet & Security > Advanced — MQTT), TapHome subscribes to shellies/shellyem-{deviceID}/ topics and receives data via listener scripts.
On Gen1 Shelly devices, enabling MQTT disables Shelly Cloud. Both cannot run simultaneously.
Device capabilities
Energy metering (per channel)
Each channel is exposed as an independent Electric Meter device in TapHome, providing:
- Instantaneous power — active power in kW (converted from W by dividing by 1000)
- Cumulative energy — total consumed energy in kWh (HTTP: converted from Wh; MQTT: uses the persistent
totaltopic in Wh)
The HTTP template reads power and total fields from the /emeter/{i}/ JSON response. The MQTT template listens to the emeter/{i}/energy topic (watt-minutes, divided by 60 000 for kWh) and the emeter/{i}/total topic (watt-hours, persistent across reboots).
The MQTT
energytopic resets to zero on device reboot. For persistent energy tracking, the template also reads thetotaltopic which survives reboots.
Each channel also exposes three service attributes:
| Attribute | Unit | Description |
|---|---|---|
| Voltage | V | RMS line voltage |
| Energy Returned | Wh | Total energy returned to grid — for solar/bidirectional metering |
| Reactive Power | VAR | Instantaneous reactive power |
The MQTT template exposes only voltage as a service attribute per channel. Reactive power and energy returned are available only in the HTTP template.
Contactor switch
The relay output is exposed as a switch device in TapHome. The relay is rated 2A / 230 VAC — it is designed for contactor control only, not for direct load switching.
- HTTP: reads
isonfromsettings/relay/0and controls via/relay/0?turn=onor/relay/0?turn=off - MQTT: reads from
shellies/shellyem-{id}/relay/0topic and publisheson/offtoshellies/shellyem-{id}/relay/0/command
The relay is rated only 2A. Always use an external contactor for loads exceeding this rating. Direct connection of high-power loads will damage the relay.
Additional capabilities
The Shelly EM also exposes power factor (0.00-1.00) and a measurement validity flag per channel, per-channel configuration (CT ratio, max power limit), energy counter reset, auto-off timer on the relay, and WiFi signal strength. Via MQTT, additional topics for real-time power, reactive power, and energy returned per channel are also available. These capabilities can be added in a future template update.
Troubleshooting
Device not responding (HTTP)
- Verify the Shelly EM is connected to Wi-Fi and has a valid IP address
- Open
http://{device-ip}/shellyin a browser — if it responds with a JSON containing"type":"SHEM", the device is reachable - Check that TapHome CCU and Shelly EM are on the same network / VLAN
No data on one channel
- Verify the CT clamp is connected to the correct 3.5mm jack (channel 0 or channel 1)
- Check that current is flowing through the monitored conductor — the CT clamp must encircle a single conductor, not the entire cable
- Poll
/emeter/0/and/emeter/1/manually to confirm non-zeropowervalues
MQTT messages not arriving
- Verify MQTT is enabled in the Shelly web UI (Internet & Security > Advanced — MQTT)
- Confirm the broker address and port are correct in both the Shelly device and TapHome module settings
- Check that the
deviceIDcustom variable matches the Shelly’s Device ID exactly (e.g.,B929CC) - Use an MQTT client (e.g., MQTT Explorer) to subscribe to
shellies/#and verify the device publishes messages
Schedule conflict error
The HTTP template checks the schedule field in settings/relay/0. If the Shelly device has internal scheduling enabled, the template reports an error. Disable scheduling in the Shelly web UI (Settings > Relay > Schedule) — use TapHome automations instead.
Gen1 Shelly devices support only 2 concurrent HTTP connections. If TapHome and another system (e.g., Home Assistant) poll the same device simultaneously, communication may become unreliable. Consider switching to the MQTT template for multi-system environments.