Shelly

On this page 7

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.

ComponentFunctionPractical consequence
Wi-Fi microcontrollerRuns firmware, API and scriptsNo hub required for basic operation
Relay outputSwitches the load, often up to 16 AControls lights, pumps, heaters
Switch inputReads the existing wall switchManual control survives outages
Metering chipMeasures power, voltage, energyFeeds energy dashboards (PM models)
Bluetooth radioSetup and sensor gatewayPresent from the Plus generation on
Core components of a typical Shelly relay module

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.

GenerationPlatformLocal APINotable capabilities
Gen1ESP8266-basedHTTP REST, MQTT, CoAPOriginal Shelly 1, 2.5, Dimmer
Gen2 (Plus and Pro)ESP32-basedRPC over HTTP, WebSocket, MQTTmJS scripting, Bluetooth, Ethernet on Pro
Gen3Newer ESP32 variantsGen2-compatible RPCMore memory, Matter on selected models
Gen4Multi-protocol chipsGen2-compatible RPCWi-Fi, Bluetooth and Zigbee or Matter
Shelly generations and their main differences

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.

InterfaceTypical useStrengthLimitation
HTTP or RPC callsDirect commands from scriptsSimple, no broker neededPolling for state is inefficient
MQTTBroker-based home automationScales well, retained statesRequires a broker and topic design
WebSocket RPCControllers such as Home AssistantInstant push of eventsGen2 and later only
On-device scriptsLocal rules and failover logicRuns without a controllerLimited memory and debugging
Shelly Cloud appRemote access, scenes, schedulesEasy for non-technical usersDepends on vendor servers
Ways to control a Shelly device

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.

OptionRadio and topologyLocal controlTypical user
ShellyWi-Fi, some Zigbee or MatterFull local API by defaultRetrofit installers, tinkerers
Tuya-based modulesWi-Fi or ZigbeeMostly cloud, local variesBudget consumers
ESPHome devicesWi-FiFull, firmware built by userHobbyists comfortable with YAML
Zigbee relaysZigbee mesh via coordinatorLocal through Zigbee2MQTT or a hubLarge battery-sensor networks
Control4 or CrestronProprietary wired and wirelessLocal, dealer-programmedProfessionally integrated homes
How Shelly differs from related options

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.