Adding Your First Device
This guide provides detailed instructions for adding your first Shelly device to the CLI.
Prerequisites
Before you begin, ensure you have:
- Shelly CLI installed (Installation Guide)
- A Shelly device powered on and connected to your WiFi
- The device IP address or mDNS hostname
- Device authentication credentials (if password-protected)
Finding Your Device
Option 1: Use Discovery
The easiest way to find your device:
| |
This scans your local network using mDNS and returns all discovered Shelly devices.
Option 2: Check Your Router
Look in your router’s DHCP client list for devices starting with “shelly”.
Option 3: Use the Shelly App
If you’ve already configured the device with the Shelly app:
- Open the Shelly app
- Tap on your device
- Go to Settings → Device Information
- Note the IP address
Option 4: Device Access Point
New, unconfigured devices broadcast their own WiFi:
- Connect to the device’s AP (e.g.,
shelly-plus-1-XXXXXX) - The device is at
192.168.33.1 - Configure WiFi through the web UI first
Registering the Device
Basic Registration
| |
Example:
| |
Rules for device names:
- Use lowercase letters, numbers, and hyphens
- No spaces (use hyphens instead)
- Keep it short and descriptive
- Examples:
living-room,kitchen-light,garage-door
Registration with Authentication
If your device has a password set:
| |
Security tip: Avoid passwords in shell history by using a prompt:
| |
Registration with Generation Hint
If auto-detection fails, specify the generation:
| |
| Generation | Devices |
|---|---|
1 | Shelly 1, 2, 2.5, Plug, Bulb, RGBW, Dimmer |
2 | Shelly Plus 1/2PM, Pro 1/2/4PM |
3 | Shelly Plus 1 Mini, i4 DC |
4 | Shelly Wall Display |
Updating an Existing Device
To update credentials or address:
| |
The --force flag overwrites existing device configuration.
Verifying Connection
After registration, verify the device responds:
| |
Expected output:
| |
| |
| |
Configuration File
Your device is stored in ~/.config/shelly/config.yaml:
| |
Important: Passwords are stored in plain text. Ensure the config file has restricted permissions:
| |
Troubleshooting
“Device not found” or Connection Timeout
| |
Possible causes:
- Device on different subnet
- Firewall blocking connections
- Device in AP mode (not connected to your WiFi)
Authentication Failed
| |
Possible causes:
- Incorrect username (try
admin) - Incorrect password
- Auth not enabled on device (try without credentials)
Generation Detection Failed
Explicitly specify the generation:
| |
To determine generation:
- Check model number on the device
- Gen1: Model starts with
SH(e.g., SHSW-1) - Gen2+: Model starts with
SN(e.g., SNSW-001X16EU)
Device Shows Offline
| |
Possible causes:
- IP address changed (use discovery to find new IP)
- Device rebooting
- Network issues
Next Steps
Now that you’ve added your first device:
- Create Device Groups - Group multiple devices
- Set Up Scenes - Create multi-device scenes
- Configure Aliases - Create command shortcuts
- Explore the TUI - Visual device control