The Shelly Dimmer 2 integrates with Home Assistant primarily through the official Shelly integration. This connection allows you to control light brightness and power states locally without relying on a cloud service.
Connecting the Shelly Dimmer 2
The Shelly Dimmer 2 is designed to be discovered automatically by Home Assistant. Because the device uses a local API, the communication happens directly over your home network. This ensures that your lights respond quickly and continue to work even if your internet connection drops.
To add the device, navigate to Settings > Devices & Services. If the device is on the same network and has not been configured to a static IP that is hidden, Home Assistant will typically show a notification that a new Shelly device has been discovered. Click Configure and follow the prompts to finalize the connection. Labels and menu names may differ slightly depending on the version of the software you use.
If the device is not discovered automatically, you can add it manually. Select Add Integration, search for Shelly, and enter the IP address of the Dimmer 2. You can find this IP address in your router's client list or through the Shelly mobile app. Assigning a static IP address to your dimmer through your router settings is a helpful step to prevent the device from changing addresses after a power outage, which would break the connection to Home Assistant.
Local Control and API Settings
Local control is the most reliable way to manage your lighting. By default, Shelly devices allow local HTTP requests. This means Home Assistant sends a command directly to the Dimmer 2's internal web server to change the brightness or toggle the power.
To ensure the most stable connection, check the device settings in the Shelly app or web interface. Ensure that the "Cloud" connection is optional and that the local API is enabled. If you have set a password on the device for security, you will need to provide this password during the Home Assistant integration process. Without the correct credentials, Home Assistant cannot authenticate the local API requests.
One common misconception is that you must use the Shelly Cloud to get the device into Home Assistant. This is incorrect. The Shelly integration is designed to work locally. In fact, removing the cloud dependency often results in faster response times and better privacy for your home automation.
Calibrating the Dimmer Range
The Shelly Dimmer 2 requires calibration to understand the minimum and maximum brightness of your specific light bulbs. Without this, you may notice the lights flickering at low levels or failing to turn off completely.
Calibration is handled through the device's own settings rather than through Home Assistant's dashboard. You can access these settings by typing the device's IP address into a web browser. In the settings menu, look for the calibration section. The device will run a sequence where it slowly increases and decreases the power to the bulb to find the "cut-off" point where the light first turns on and the point where it reaches full brightness.
For a worked example, consider a 60W dimmable LED bulb. During calibration, the Shelly Dimmer 2 might find that the bulb only begins to emit light at 15% power. It will then set 15% as the "Minimum Brightness" floor. When you move the slider in Home Assistant to 1%, the device will actually output 15% power to ensure the bulb stays lit and does not flicker. If the bulb is rated for 100W and you are using a 40W bulb, the calibration process ensures the voltage curve matches the lower wattage requirement.
Managing Dimmer Modes
The Shelly Dimmer 2 can be configured to react differently to the physical switch attached to it. You can choose between different "Button Types" in the device settings to match your hardware.
- Momentary switches: These are push-buttons that spring back. A single press toggles the light, while holding the button dims the light up or down.
- Toggle switches: These are standard flip switches. Flipping the switch toggles the power, and flipping it rapidly can trigger dimming modes.
Changing these settings is important because it determines how the physical interaction in your room translates to the digital state in Home Assistant. If you use a toggle switch but the device is set to momentary, the light may behave erratically or refuse to dim. These settings are adjusted in the device's web interface under Settings > Button Type.
Automating Lighting for Calm
Once the Dimmer 2 is integrated, you can use Home Assistant to create lighting scenes that support a slower pace of living. Instead of harsh on/off transitions, you can create automations that gently fade the lights over several minutes.
For a wind-down routine, you can create a script that reduces the brightness from 80% to 10% over a period of 30 minutes. This gradual change mimics the setting sun and may help you feel calmer as you prepare for sleep. You can trigger this automation based on a specific time of day or when you activate a "Night" mode in your dashboard.
You can also group multiple Shelly Dimmers together in Home Assistant. By creating a "Light Group," you can adjust the brightness of an entire room with one slider. This prevents the staggered effect where some lights react a fraction of a second faster than others, creating a more harmonious visual environment.
How do I fix flickering lights?
Flickering usually occurs because the bulb is not fully compatible with trailing-edge or leading-edge dimming, or the minimum brightness level is set too low. Run the calibration process again and ensure you are using bulbs specifically labeled as "dimmable."
Can I use the Dimmer 2 without a neutral wire?
The Shelly Dimmer 2 is designed to work without a neutral wire in many installations, but this depends on the load and the wiring of your home. Always check your local electrical codes and ensure the bulb wattage is within the supported range for no-neutral operation.
Why does the light turn on by itself after power loss?
This is controlled by the "Power On Default" setting. In the device web interface, you can choose whether the light should stay off, turn on, or return to its previous state after a power failure. Setting this to "Restore Previous State" is often the most natural feeling for a home.