Table of Contents
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 both Gen1 (CoAP) and Gen2 (WebSocket) devices, 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) — 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
Gen1 vs Gen2 Devices
Shelly has two hardware generations with different 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: The newest hardware, backward-compatible with Gen2 API.
Both generations are supported in Home Assistant. The integration automatically detects which protocol to use.
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 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 Shelly EM or Plug S (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, EM, 2.5, Plus Plug) report these entities 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.
- Gen2 scripting: Gen2 devices support Mongoose OS 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.