
The Shelly Plus i4 is a compact Wi-Fi 4-channel digital input module. It has no relays or outputs — it functions purely as an input device that detects button presses and switch states on four independent terminals (SW1–SW4). It fits behind a standard wall switch (37 x 42 x 16 mm) and is powered by 110–240 VAC. TapHome communicates with the device over MQTT using Gen2+ JSON-RPC 2.0 notifications on the local network — no cloud connection is required.
Each of the four inputs can be independently configured as either button mode (detects single push, double push, long push) or switch mode (detects open/closed state). The TapHome template creates both a push-button device and a reed-contact device for each input — you use the one that matches how the input is configured in the Shelly web UI.
Configuration
MQTT broker setup
The Shelly Plus i4 communicates via MQTT. You need an MQTT broker running on your network (e.g., Mosquitto). In the Shelly web UI (http://{device-ip}), go to Settings → MQTT and enable MQTT, entering the broker IP address and port.
Template import parameters
During TapHome template import, enter three parameters:
| Parameter | Description | Example |
|---|---|---|
| MQTT Broker IP | IP address of the MQTT broker | 192.168.1.10 |
| MQTT Broker Port | Broker port (default 1883) | 1883 |
| Shelly ID | MQTT client ID from the Shelly web UI → Settings → MQTT | shellyplusi4-xxxxxxxxxxxx |
Input mode configuration
After importing the template, configure each input in the Shelly web UI (http://{device-ip}) → Inputs:
- Button mode — for momentary push buttons. Use the corresponding Button 1–4 device in TapHome.
- Switch mode — for toggle switches or reed contacts. Use the corresponding Switch 1–4 device in TapHome.
Each physical input can only be one type at a time. If an input is set to switch mode but TapHome receives a button event (or vice versa), the listener script raises an error indicating the mismatch.
Device capabilities
Push-button detection (Button 1–4)
Four push-button devices listen for MQTT NotifyEvent messages on the {device_id}/events/rpc topic. Each button detects three press types and maps them to numeric values:
| Press type | Value |
|---|---|
| Single push | 1 |
| Long push | 2 |
| Double push | 3 |
The button devices are read-only — they report the last detected event. Each button listens for events from its corresponding input component (input:0 through input:3).
Switch/reed-contact detection (Switch 1–4)
Four reed-contact devices listen for MQTT NotifyStatus messages. Each switch reads the binary state of its corresponding input:
| State | Value |
|---|---|
| Closed (active) | 1 |
| Open (inactive) | 0 |
The switch devices are read-only with a 2.5-second poll interval. They are suitable for toggle switches, magnetic reed contacts, or any binary on/off sensor connected to the input terminals.
Additional capabilities
The Shelly Plus i4 API also supports triple-push detection, raw button-down/button-up events, and a programmatic Input.Trigger method (unique to i4 devices) that can emit events without physical input. System diagnostics (uptime, MAC, WiFi RSSI) are available via HTTP RPC but not exposed in this MQTT-only template. These capabilities can be added in a future template update.
Troubleshooting
Button presses not detected
- Verify the input is configured as button mode in the Shelly web UI → Inputs
- Check that TapHome is connected to the MQTT broker and the Shelly ID matches the device’s MQTT client ID
- If TapHome shows “Device is set as switch” error, the input is in switch mode — change it to button mode in the Shelly web UI or use the Switch 1–4 device instead
Switch state not updating
- Verify the input is configured as switch mode in the Shelly web UI → Inputs
- If TapHome shows “Device is set as button” error, the input is in button mode — change it to switch mode or use the Button 1–4 device instead
- Toggle the physical switch and check the MQTT broker for
NotifyStatusmessages on theshellyplusi4-{id}/events/rpctopic
Device not reachable
- Verify the Shelly is connected to Wi-Fi — the blue LED should be constantly on
- Confirm MQTT is enabled in the Shelly web UI → Settings → MQTT and the broker address is correct
- Try using the mDNS hostname (
shellyplusi4-AABBCCDDEE.local) to access the Shelly web UI - Check that the MQTT broker is running and accessible from both TapHome Core and the Shelly device
The Shelly Plus i4 has an MQTT rate limit of 80 notifications per 60-second window. Rapid repeated button presses may exceed this limit and cause some events to be dropped. This is a firmware-level limitation.