Table of Contents
Quick Answer
Add Shelly devices to Home Assistant via Settings → Integrations → Shelly. Shelly Gen2, Gen3 and Gen4 devices auto-discover on your local network. Gen1 devices use the same integration but may need firmware updated first. All Shelly devices support full local control — no cloud subscription, no Shelly account required once connected.
Shelly makes some of the most Home Assistant-friendly smart home devices available. These small relays, dimmers, and plugs fit inside existing electrical boxes, turning dumb switches and outlets into smart ones — without replacing your wall plates. And their local API support is outstanding.
The Shelly integration in Home Assistant supports Gen1 (CoAP) devices and the Gen2-and-later (WebSocket/RPC) devices, including today's Gen3 and Gen4 models, auto-discovers them on your network, and provides full local control with near-instant response times. This guide walks through everything you need to know.
Why Shelly for Home Assistant?
- Local-first: Shelly devices communicate directly with HA via CoAP (Gen1) or WebSocket (Gen2 and later) — no cloud required
- Auto-discovery: HA finds Shelly devices automatically on your network
- Power monitoring: Many models report energy usage in real time
- Retrofit-friendly: Install inside existing switch boxes without changing your wall plates
- Open API: Extensive local REST and WebSocket API for custom integrations
Shelly Device Generations (Gen1 to Gen4)
Shelly now has four hardware generations, which use two different local protocols:
- Gen1 (Shelly 1, 2.5, Plug, Dimmer 1): Uses CoAP for state reporting and REST for control. Solid and well-supported.
- Gen2 (Shelly Plus, Pro series): Uses WebSocket and JSON-RPC. Faster, more features, supports Bluetooth and scripting.
- Gen3 (e.g. Shelly 1PM Gen3, Plug S Gen3, EM Gen3, 2024): Same Gen2-style API, with newer chips.
- Gen4 (e.g. Shelly 1 Gen4, 1PM Gen4, launched 2025): The current generation. Adds Zigbee and Matter alongside Wi-Fi and Bluetooth. In Wi-Fi mode it uses the same Shelly integration; if you switch a Gen4 device to Zigbee, pair it with ZHA or Zigbee2MQTT instead.
All four generations are supported in Home Assistant over Wi-Fi. The integration automatically detects which protocol to use. If you are buying new, choose Gen3 or Gen4 models.
Setting Up the Integration
Step 1: Connect Shelly to Your Network
When you power on a new Shelly device, it broadcasts its own WiFi hotspot (ShellyXXX-XXXXXX). Connect to it with your phone and use the Shelly app to connect it to your home WiFi network.
Step 2: Auto-Discovery in HA
Once on your network, Home Assistant will typically discover Shelly devices automatically within a few minutes. You'll see a notification in HA: "New devices discovered". Click "Configure" to add them.
Step 3: Manual Addition
If auto-discovery doesn't find your device, go to Settings → Devices & Services → Add Integration → Shelly. Enter the device's IP address (find it in the Shelly app or your router's DHCP table).
Step 4: Assign to Areas
After adding, assign each Shelly device to the appropriate area in your home for better organisation and voice control.
Enabling Local Control
The Shelly integration uses local control by default — this is one of its biggest advantages. However, there are a few settings to verify:
Disable Cloud (Recommended)
For privacy and reliability, disable Shelly's cloud connectivity. Access the device's web interface at its IP address, go to Internet & Security → Cloud, and toggle cloud off. Your device will still work perfectly via local API.
Set Static IP
Assign a static IP or DHCP reservation for each Shelly device to prevent IP address changes from breaking the integration.
CoAP Configuration (Gen1)
For Gen1 devices, ensure CoAP is enabled in the device's settings. The HA integration uses CoAP for real-time state updates — without it, you'll only get polled updates every few seconds.
Automation Ideas
Single-Wire Switch Retrofit
Install a Shelly 1 Gen4 (or an older Shelly 1) behind an existing light switch. The original switch still works physically, but now HA can also control the light. Create an automation so pressing the physical switch triggers an HA scene rather than just toggling the light.
Energy Monitoring Alerts
Use a Shelly EM Gen3 or Plug S Gen3 (with power monitoring) to track appliance energy use. Set up an HA automation that notifies you if the washing machine has been running for more than 2 hours (indicating it may have finished or stalled).
Overload Protection
Use Shelly's built-in overload protection combined with HA automations to automatically cut power to an outlet if energy draw exceeds a threshold, and send you a push notification.
Power Monitoring
Models with power monitoring (Shelly Plug S Gen3, EM Gen3, 1PM Gen4, and older Plug S, EM, 2.5 and Plus Plug S) report entities like these to HA:
sensor.shelly_plug_power— current wattssensor.shelly_plug_energy— total kWh since resetsensor.shelly_plug_voltage— line voltagesensor.shelly_plug_current— amps
You can use these in the Energy dashboard, create cost-tracking automations, or build Lovelace cards showing real-time consumption per room.
Tips & Best Practices
- Update firmware first: Before integrating, update Shelly firmware through the Shelly app. Older firmware versions have known issues with the HA integration.
- Use DHCP reservations: Static IPs prevent "device unavailable" errors after router reboots.
- Name devices clearly: Set a descriptive name in the Shelly web UI (e.g., "Kitchen Counter Socket") before adding to HA — this becomes the default entity name.
- Scripting: Gen2 and newer devices (including Gen3 and Gen4) support on-device scripts. You can run simple logic directly on the device even without HA connectivity.
- MQTT mode: For large deployments, consider using Shelly's MQTT mode with an MQTT broker in HA for more reliable multi-device state management.
Bottom Line
Shelly devices are a top choice for Home Assistant users who want reliable, locally-controlled smart home hardware. The HA integration is excellent — auto-discovery works, local control is fast, and power monitoring adds genuine utility. If you're building out a smart home on a budget, Shelly devices are among the best-value options available.
SmartWired participates in the Amazon Associates Programme. We may earn a commission from qualifying purchases at no extra cost to you.