Shelly is a product family of compact Wi-Fi relays, dimmers, plugs, meters and sensors, made by the Bulgarian company Shelly Group, that adds connected control to ordinary electrical circuits without replacing the wall switches people already use. In home automation, Shelly devices are valued because they run locally on the home network, expose open APIs such as HTTP, MQTT and WebSocket RPC, and work with the cloud as an option rather than a requirement.
Most Shelly modules are small enough to fit behind a standard wall switch or inside a ceiling box. They switch or measure mains loads, report state changes within a fraction of a second and can execute on-device scripts, which makes them a common building block for automation rules in a smart home built around Home Assistant, openHAB or a similar controller.
How Shelly modules control a circuit
A Shelly module combines a microcontroller with Wi-Fi, a relay or semiconductor switch and, in many models, a power metering chip on a single small board. The module is wired between the supply and the load, while the existing wall switch is connected to a dedicated switch input (often labeled SW). The switch no longer carries the load current; it only sends a signal that the firmware interprets.
This design keeps manual control intact. When the network or the controller is down, pressing the wall switch still toggles the light because the decision is made inside the module itself. The firmware can treat the input as a toggle, a momentary push button or a detached input that only reports events to an external system.
Each device hosts a built-in web interface and an API. Commands arrive over the local network, and state changes are pushed back as events, so a controller sees a manual switch press almost immediately. Optional Shelly Cloud access adds remote control through a vendor app, but local control does not depend on it.
The table below summarizes the main hardware building blocks and what each contributes.
| Component | Function | Practical consequence |
|---|---|---|
| Wi-Fi microcontroller | Runs firmware, API and scripts | No hub required for basic operation |
| Relay output | Switches the load, often up to 16 A | Controls lights, pumps, heaters |
| Switch input | Reads the existing wall switch | Manual control survives outages |
| Metering chip | Measures power, voltage, energy | Feeds energy dashboards (PM models) |
| Bluetooth radio | Setup and sensor gateway | Present from the Plus generation on |
Shelly device generations and product lines
Shelly hardware has evolved through several generations, and the generation determines which API, scripting and integration options a device supports. Installers should check the generation before planning an automation, because Gen1 and later devices behave differently at the protocol level.
| Generation | Platform | Local API | Notable capabilities |
|---|---|---|---|
| Gen1 | ESP8266-based | HTTP REST, MQTT, CoAP | Original Shelly 1, 2.5, Dimmer |
| Gen2 (Plus and Pro) | ESP32-based | RPC over HTTP, WebSocket, MQTT | mJS scripting, Bluetooth, Ethernet on Pro |
| Gen3 | Newer ESP32 variants | Gen2-compatible RPC | More memory, Matter on selected models |
| Gen4 | Multi-protocol chips | Gen2-compatible RPC | Wi-Fi, Bluetooth and Zigbee or Matter |
Within each generation, the catalog splits into functional lines. The naming is consistent enough to read: the suffix PM means power metering, “2PM” means two metered channels, and Pro models are DIN-rail units intended for the electrical cabinet rather than the wall box.
- Relays such as Shelly 1, 1PM and 2PM for lights, fans and resistive loads
- Dimmers for leading- or trailing-edge dimming of compatible LED and halogen lamps
- Plugs for appliances that should not be hardwired
- Energy meters such as the EM and 3EM families with current clamps
- Sensors for temperature, humidity, doors, windows, motion and flooding
Local control, APIs and scripting
Shelly is attractive to advanced users primarily because of its local-first API design. A device can be controlled with a single HTTP request, subscribed to over MQTT or managed through a persistent WebSocket RPC connection, all without leaving the home network.
From Gen2 onward, devices also run on-device scripts written in a restricted JavaScript dialect called mJS. A script can react to an input event, call another Shelly over HTTP, read a sensor or implement a timer. This allows simple trigger and action logic to execute even when the central controller is offline, although memory limits keep scripts short.
The following comparison shows which interface suits which job.
| Interface | Typical use | Strength | Limitation |
|---|---|---|---|
| HTTP or RPC calls | Direct commands from scripts | Simple, no broker needed | Polling for state is inefficient |
| MQTT | Broker-based home automation | Scales well, retained states | Requires a broker and topic design |
| WebSocket RPC | Controllers such as Home Assistant | Instant push of events | Gen2 and later only |
| On-device scripts | Local rules and failover logic | Runs without a controller | Limited memory and debugging |
| Shelly Cloud app | Remote access, scenes, schedules | Easy for non-technical users | Depends on vendor servers |
Shelly compared with other smart home approaches
Shelly occupies a specific niche: retrofit Wi-Fi modules with open local control. It is neither a hub ecosystem like Samsung SmartThings nor a mesh radio standard like Zigbee, and it differs from cloud-centered brands such as Tuya in how much control stays on the device.
| Option | Radio and topology | Local control | Typical user |
|---|---|---|---|
| Shelly | Wi-Fi, some Zigbee or Matter | Full local API by default | Retrofit installers, tinkerers |
| Tuya-based modules | Wi-Fi or Zigbee | Mostly cloud, local varies | Budget consumers |
| ESPHome devices | Wi-Fi | Full, firmware built by user | Hobbyists comfortable with YAML |
| Zigbee relays | Zigbee mesh via coordinator | Local through Zigbee2MQTT or a hub | Large battery-sensor networks |
| Control4 or Crestron | Proprietary wired and wireless | Local, dealer-programmed | Professionally integrated homes |
The decisive difference is ownership of the control path. A Shelly relay keeps working and stays scriptable even if the manufacturer cloud disappears, which reduces long-term vendor lock-in risk compared with cloud-dependent devices.
Installation, limitations and common mistakes
Shelly modules are installed in mains-voltage circuits, so installation must follow local electrical codes and, in many countries, be carried out by a qualified electrician. Most mistakes come from wiring, load selection or network planning rather than from the firmware.
- Missing neutral: many models need a neutral wire; only specific variants run without one
- Overheating in deep boxes: modules near their current limit in an insulated box can derate or trip
- Inductive and capacitive loads: motors and LED drivers can stress relay contacts beyond the nominal rating
- Weak Wi-Fi: a module behind a metal switch plate may drop off a distant access point
- Too many Wi-Fi clients: dozens of devices can overload consumer routers with small client tables
Firmware updates occasionally change API behavior, so a sensible practice is to stage updates on one device before rolling them out. Assigning static DHCP reservations also prevents broken integrations when addresses change.
In simple terms
A Shelly is a small box that hides behind your light switch and makes the light controllable from a phone or an automation system. Your normal switch keeps working exactly as before, so nobody in the house has to learn anything new.
What makes Shelly special is that it talks to your home network directly. It does not need the manufacturer’s internet service to follow your rules, so the lights still respond even when the internet connection is down. The key takeaway: Shelly turns ordinary wiring into smart, locally controlled circuits at low cost.
A practical example
A homeowner renovating a two-story house wants the hallway lights to turn on automatically at night when someone walks by, without changing the existing switches. An electrician installs a Shelly 1PM behind each hallway switch and a battery motion sensor on each landing. All devices connect to a Home Assistant server over the local Wi-Fi network.
An automation rule turns the lights on at 30 percent brightness between sunset and sunrise when motion is detected and switches them off after two minutes. A short mJS script on each relay also turns the light on whenever the switch is pressed, even if Home Assistant is restarting. The metering function reveals that the hallway circuit uses about 18 W when on.
The outcome is hands-free night lighting that still works with the original switches, keeps running during internet outages and provides energy data without additional hardware.