
The Shelly UNI is a compact universal Wi-Fi I/O module (20 × 33 × 13 mm) from the Shelly Gen1 platform. It provides one ADC voltage input, two potential-free open-collector outputs and two digital inputs — designed to retrofit legacy appliances without a hub.
TapHome communicates with the device over MQTT. The template subscribes to the shellies/<prefix>/... topic tree and publishes commands to .../relay/{0,1}/command. The module exposes 5 devices: 1 analog input, 2 switches and 2 reed contacts.
Hardware connection
Power supply
Shelly UNI is a low-voltage module and cannot be powered directly from the 230 V mains. Supply either:
- 12–36 V DC via Red (+) and Black (GND), or
- 12–24 V AC via Red and Black (no polarity)
An external low-voltage power adapter is required. Device consumption is below 1 W.
Do not connect the Red/Black leads to mains voltage. Hazardous voltage may still be present on the IN_1 / IN_2 / OUT1 / OUT2 terminals depending on the external circuit — installation must be performed by a qualified electrician.
Pigtail wiring legend
The device ships with a color-coded pigtail cable:
| Wire | Terminal | Function |
|---|---|---|
| Red | VCC | 12–36 V DC (or 12–24 V AC together with Black) |
| Black | GND | Ground (or AC phase with Red) |
| White | ADC_IN | Analog input (0–12 V or 0–30 V range) |
| Yellow | VCC_SENSOR | 3.3 V DC output for one-wire sensors |
| Blue | DATA_SENSOR | One-wire data (DS18B20 / DHT22) |
| Green | GND_SENSOR | Sensor ground |
| Light brown | IN_1 | Digital input 1 |
| Dark brown | IN_2 | Digital input 2 |
The two potential-free outputs are marked OUT1 and OUT2 on the module body.
Digital inputs (IN_1, IN_2)
Each digital input is potential-free and can be driven by either a DC or AC source:
- DC: HIGH when ≥ 2.2 V, LOW below 2.2 V, max 36 V DC
- AC: HIGH when ≥ 12 V, LOW below 12 V, max 24 V AC
Typical use cases are reed contacts (window/door sensors, float switches) and push-buttons shorting the input to GND through an external supply.




Potential-free outputs (OUT1, OUT2)
Each output is an open-collector, potential-free contact with the following absolute limits:
- 100 mA maximum current
- 300 mW maximum power
- 24 V AC or 36 V DC maximum switched voltage
These ratings are too low for mains loads — to switch real loads (lights, pumps, valves) connect the outputs to an external relay or contactor and power that relay’s coil from a matching low-voltage source.

Analog input (ADC)
A single ADC channel on the White (ADC_IN) lead supports two voltage ranges, selectable in the Shelly web UI:
- 0–12 V — higher resolution for low-voltage signals
- 0–30 V — wider range for battery / DC-link monitoring
The selected range is stored on the device only — the TapHome template reads the raw published value and cannot detect which range is active. Make sure the Shelly ADC range matches the signal you wire to the White lead.

Configuration
Device ID and MQTT prefix
Each Shelly UNI has a unique Shelly-ID equal to the last 6 characters of its MAC address (e.g. 35FA58). The resulting MQTT topic prefix is shellyuni-<Shelly-ID> (e.g. shellyuni-35fa58).
The Shelly-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
Shelly Gen1 devices advertise themselves via mDNS as
shellyuni-<Shelly-ID>.local. You can use this hostname instead of a fixed IP address to reach the web UI.
Enabling MQTT
On a fresh device, MQTT is disabled. Enable it before importing the TapHome template:
- Connect to the device’s access point
shellyuni-XXXXXX(password printed on the device) or reach it on your LAN - Open the web UI at
http://192.168.33.1/(AP mode) or the LAN IP - Go to Internet & Security → Advanced — Developer Settings
- Check Enable action execution via MQTT
- Set the broker IP and port (default
1883), leave username and password empty — TapHome does not support MQTT authentication on Gen1 - Save and reboot the device
Enabling MQTT disables the Shelly Cloud connection on Gen1 devices. This is by design — the device cannot maintain both connections simultaneously. The Shelly mobile app will no longer control the device over the cloud; use MQTT or the local web UI instead.
Shelly Gen1 devices do not support MQTT over TLS. Communication between the device and the broker is unencrypted (plain MQTT, port 1883). Keep the broker on a trusted local network.
Template setup
When importing the template into TapHome, supply:
- IpAddress — MQTT broker IP
- Port — broker port (default
1883) - DeviceID — the 6-character Shelly-ID of the specific UNI (e.g.
35fa58)
The DeviceID import parameter is used to build the MQTTprefix custom variable (default shellyuni-$[DeviceID]). If you have set a custom mqtt_id on the Shelly device (overriding the default), edit the MQTTprefix variable on the module after import to match.
Disable HTTP authentication on the Shelly device (Internet & Security → Restrict Login). TapHome does not use HTTP on this template, but leaving auth enabled can complicate troubleshooting and firmware updates.
Device capabilities
Analog voltage measurement
The Analog Input device reads the ADC voltage from shellies/<prefix>/adc/0 and exposes it as a numeric value in volts. The script parses the incoming payload with TODOUBLE(TOSTRING(PAYLOAD)) — no scaling is applied.
The actual measurement range (0–12 V or 0–30 V) is configured on the Shelly device itself and is not reported over MQTT. The TapHome template cannot verify which range is active.
Switch outputs
Both open-collector outputs are exposed as standard TapHome Switch devices:
- Switch 1 — OUT_1, topic
shellies/<prefix>/relay/0, command topic.../relay/0/command - Switch 2 — OUT_2, topic
shellies/<prefix>/relay/1, command topic.../relay/1/command
The listener maps payload on → ON (St=1) and off → OFF (St=0). Commands from TapHome are published as on / off on the respective command topic.
The outputs are potential-free and limited to 100 mA / 300 mW. Do not connect mains loads directly — use an external relay or contactor for anything heavier than low-power signaling devices.
Digital inputs (reed contacts)
Both digital inputs are exposed as Reed Contact devices with inverted logic:
- Reed Contact 1 — IN_1, topic
shellies/<prefix>/input/0 - Reed Contact 2 — IN_2, topic
shellies/<prefix>/input/1
The Shelly firmware publishes 1 when the input sees a voltage above its threshold and 0 when the input is pulled to GND. Since reed contacts and push-buttons typically short the input to GND in the closed / active state, the TapHome script inverts the payload:
| |
This means Rc=1 in TapHome = contact closed (active, window open sensor triggered, button pressed), Rc=0 = contact open (inactive).
Additional capabilities
The Shelly UNI hardware also supports up to 3 × DS18B20 temperature sensors on the one-wire bus and — as an alternative — 1 × DHT22 humidity/temperature sensor. These sensors publish on shellies/<prefix>/ext_temperature/{0,1,2} and shellies/<prefix>/ext_humidity/0. The current MQTT template does not wire these topics into TapHome devices; they can be added in a future template update.
Similarly, the device exposes an online/offline LWT topic and short/long-press input events on input_event/{0,1} that are not consumed by this template.
For scene triggers based on button events (short press, long press), the
input_eventtopic can be subscribed to from a separate MQTT client today — the TapHome template only tracks the raw input state.
Troubleshooting
Device not responding
- Verify the Shelly UNI is powered (Red/Black on 12–36 V DC or 12–24 V AC) and connected to Wi-Fi
- Open the Shelly web UI via the mDNS hostname
shellyuni-<Shelly-ID>.localor its DHCP IP - Confirm MQTT is enabled (Internet & Security → Advanced) and the broker IP/port match the TapHome import parameters
- Use an MQTT client (e.g. MQTT Explorer) to subscribe to
shellies/#and verify the device publishes messages
Switches do not toggle
- Check the command topic path — it must be
shellies/<prefix>/relay/0/command(not.../relay/0/set) - Confirm that the TapHome module’s
MQTTprefixvariable matches the topic prefix the device actually publishes on - Remember that the outputs are potential-free — without an external circuit supplying voltage, the output state changes but no load switches
Reed contact state is reversed
The template expects payload=0 to mean “contact closed”. If your external wiring pulls the input HIGH when the contact is active (inverse wiring), the state will appear reversed in TapHome. Rewire so that the contact shorts IN_1 / IN_2 to GND when active, or adjust the logic in a custom script.
ADC value out of expected range
The ADC range (0–12 V or 0–30 V) is set on the device and cannot be read back over MQTT. If the numeric value in TapHome looks wrong (e.g. 2× higher or lower than expected), open the Shelly web UI and check Settings → ADC range. The template assumes the device publishes the voltage directly and does no conversion.