---
title: "Shelly RGBW2"
description: "Shelly RGBW2 Wi-Fi RGBW LED controller with two operating modes. Control RGB color strips or four independent white channels via HTTP from TapHome."
url: "https://taphome.com/en/compatibility/shelly-rgbw2/"
language: en
lastmod: 2026-10-08
generator: hugo
ai:
  topics: ["http","lighting","wifi","rgbw","led-controller","dimmer"]
  questions: ["How to integrate Shelly RGBW2 with TapHome?","What is the difference between Color and White mode on Shelly RGBW2?","How to control RGB LED strips via TapHome?","How to dim four independent white channels with Shelly RGBW2 in TapHome?","Why does the Shelly RGBW2 template show a mode error in TapHome?","How to set transition time for Shelly RGBW2 light changes?"]
---

# Shelly RGBW2

Communication: Packet Parser → HTTP

- [Shelly RGBW2 Product Page](https://www.shelly.com/en/products/shop/shelly-rgbw2)
- [Shelly RGBW2 API Documentation](https://shelly-api-docs.shelly.cloud/gen1/#shelly-rgbw2-color-mode)

> Network address
> 
> TapHome reaches this device at the address entered on import. Give the device a fixed address — an IP reservation in the router, or its mDNS name if it supports one — otherwise the integration stops working when the router changes the address.
> 
> [Network Preparation](https://taphome.com/en/docs/setup/network-preparation/)

## Integration guide

The Shelly RGBW2 is a Wi-Fi RGBW LED strip controller with four PWM outputs (12/24 V DC). It supports two mutually exclusive operating modes — Color and White — each requiring its own TapHome template. TapHome communicates with the device over HTTP on the local network; no cloud connection is required.

In **Color mode**, the four outputs drive an RGBW LED strip as a single color light with hue, saturation, brightness, and an optional white (CCT) channel. In **White mode**, the four outputs act as independent dimmers, each controlling a separate white LED strip or zone.

You must choose the operating mode in the Shelly web interface (or via the API) before importing the corresponding template. Each template validates the current mode on every poll and shows an error if the device is set to the wrong mode.

## Configuration

Both templates connect over Wi-Fi. During TapHome template import, enter the device's IP address (default placeholder `192.168.0.1`) and an optional transition time in milliseconds (default `300`).

The transition time parameter controls how quickly the light fades between brightness levels. It applies to all write commands (on/off, brightness, color changes) and affects the debounce window — the template ignores polled values for `transitionTime + 500 ms` after each write to prevent stale reads during transitions.

## Color mode template

### Color light

The template exposes the RGBW strip as a single HSB color light with two sub-modes:

- **RGB color** — hue and saturation control the strip color. The template converts between the Shelly API's RGB values (red, green, blue 0-255) and TapHome's HSB model. Brightness is controlled via the `gain` parameter (0-100).
- **White (CCT)** — when correlated color temperature is set, the template switches to white-channel control. CCT range is 3000-6500 K. Brightness is controlled via the `white` parameter (0-100).

The light state is read from the `/status` response (`lights[0]`) and controlled via the `/light/0` endpoint. Turning on sends `turn=on` with the current color or white values; turning off sends `turn=off`. All write commands include the transition time parameter.

### Power metering (Color)

The Color template includes one energy meter that reads from `meters[0]`:

- **Real-time power** — `meters[0].power` in watts, converted to kW
- **Total consumption** — `meters[0].total` in watt-minutes, converted to kWh

If the light is on but power reads zero, the template displays a warning suggesting to configure the device model in the Shelly app settings.

## White mode template

### Four independent dimmers

The White template exposes four independent dimmer channels, one per PWM output:

| Channel | Output | Endpoint | Poll interval |
|---------|--------|----------|---------------|
| Ch1 | R (Red) | `/light/0` | 2.5 s |
| Ch2 | G (Green) | `/light/1` | 2.5 s |
| Ch3 | B (Blue) | `/light/2` | 2.5 s |
| Ch4 | W (White) | `/light/3` | 2.5 s |

Each dimmer reads `lights[N].ison` and `lights[N].brightness` (0-100, normalized to 0-1) from the `/status` response. Write commands use `/light/N?turn=on|off&brightness=VALUE`. All channels use the same transition time and debounce logic.

### Power metering (White)

Each channel has its own energy meter, reading from `meters[0]` through `meters[3]`. The first channel polls at 2.5 seconds; channels 2-4 poll at 15-second intervals. Each meter provides real-time power (W to kW) and cumulative energy (watt-minutes to kWh).

## Service diagnostics

Both templates expose 10 service attributes for device monitoring:

- **Network** — IP address, MAC address (formatted with colons), WiFi signal strength (dB)
- **Connectivity** — cloud enabled/connected, MQTT connected
- **Device info** — device time, uptime (formatted as days/hours/minutes), RAM usage
- **Firmware** — firmware update available

## Service actions

Both templates share three service actions:

- **Enable cloud** — enables or disables Shelly Cloud connectivity
- **Reboot** — triggers a device reboot
- **Set mode** — the Color template includes "Set mode Color" (`/settings?mode=color`) and the White template includes "Set mode White" (`/settings?mode=white`). These actions switch the device's operating mode via the API.

### Additional capabilities

The Shelly RGBW2 also exposes light effects (Color mode, effect index 0-3), physical input state, internal temperature, overtemperature flag, and power protection settings in its API. These capabilities can be added in a future template update.

## Troubleshooting

### Device not responding

1. Verify the Shelly is connected to Wi-Fi and has a valid IP address
2. Try using the mDNS hostname (`shellyrgbw2-AABBCCDDEE.local`) instead of the IP address — the IP may have changed after a DHCP renewal
3. Open `http://{device-ip}/shelly` in a browser — if it responds, the device is reachable
4. Check that TapHome CCU and Shelly are on the same network / VLAN

### "Mode White/Color is not supported" error

This error means the device is set to the wrong operating mode for the imported template. To resolve:

1. Open the Shelly web interface at `http://{device-ip}`
2. Switch the operating mode to match the template (Color or White)
3. Alternatively, use the "Set mode Color" or "Set mode White" service action from the other template to switch modes via the API, then reimport the correct template

### Power readings show zero

1. Confirm LEDs are connected to the Shelly RGBW2 outputs
2. Open the Shelly app or web interface and verify the device model is configured under Settings -> Device Model
3. Check that the light is turned on — the meter only reads when current flows through the outputs
4. Poll `/status` manually and verify `meters[0].power` returns a non-zero value

### Color light not changing

1. Verify the device is in Color mode (check `/status` response — `mode` should be `"color"`)
2. Ensure the light is turned on before changing hue or saturation
3. If both `gain` and `white` are non-zero, the template automatically resets them to zero and turns off the light — this prevents undefined behavior where RGB and white channels compete

> [!WARNING]
> Gen1 Shelly devices support only **2 concurrent HTTP connections**. If TapHome and another system (e.g., Home Assistant) poll the same device simultaneously, communication may become unreliable. If another system polls the device as well, increase the template poll intervals (2.5 s for the light channels by default) to reduce connection contention.

## How to install in TapHome

### Prerequisites

- Shelly device installed and powered on
- Local Wi-Fi network (2.4 GHz)
- TapHome CCU on the same network

### Step 1 — Connect Shelly to Wi-Fi

**Option A — Shelly app (recommended):**

1. Download the [Shelly app](https://www.shelly.com/en/support/shelly-app) (iOS / Android)
2. Tap **+** → **Add Device** and follow the Bluetooth pairing wizard
3. Enter your Wi-Fi credentials when prompted

**Option B — AP mode (no app):**

1. On first power-up the device creates a hotspot: `ShellyXXX-AABBCCDDEE`
2. Connect your phone/PC to that hotspot
3. Open `http://192.168.33.1` → **Internet & Security** → **Wi-Fi Mode - Client**
4. Enter SSID and password → **Save**

> [!NOTE]
> Shelly only supports **2.4 GHz** networks. 5 GHz networks will not appear in the scan.

### Step 2 — Find the device address

Shelly Gen1 devices support **mDNS** (Zeroconf). You can reach the device using a hostname instead of an IP address:

```
shelly<model>-<MAC>.local
```

For example: `shelly1pm-AABBCCDDEE.local` (MAC address in uppercase hex, no colons).

> [!TIP]
> **Recommended: use the TapHome IP Scanner.** Open the TapHome app and use the **IP Scanner** (Settings → Network → Scan). The scanner will discover devices on your network and show both the IP address and the mDNS hostname. Use the **hostname** instead of the IP address for a more reliable connection — it stays the same even if the device's IP changes after a router reboot.

**Alternative methods** to find the IP address:

- **Shelly app:** Device detail → **Device info** → IP address
- **Shelly web UI:** Connect to the device AP before Wi-Fi setup — the IP is shown after saving
- **Router DHCP table:** Look for a hostname like `shelly1pm-AABBCCDDEE`

### Step 3 — Configure in TapHome

1. In TapHome, add a new **Packet Parser (HTTP)** module
2. **Address:** enter the mDNS hostname (e.g., `shelly1pm-AABBCCDDEE.local`) or IP address from Step 2
3. **Port:** `80` (default, no change needed)
4. Import the template — TapHome will poll `/status` to read device state

> [!NOTE]
> HTTP authentication is disabled by default on Shelly devices. If you have enabled login protection, TapHome does not support HTTP Basic Auth at this time — keep auth disabled for TapHome integration.

## Available devices 2

These devices appear in TapHome after import.

Shelly RGBW2 Color Module

Service Attributes

|                     |
|---------------------|
| IP Address          |
| MAC Address         |
| WIFI signal         |
| Cloud enabled       |
| Cloud connected     |
| MQTT connected      |
| Device time         |
| FW update available |
| Uptime              |
| RAM                 |

Service Actions

|                |
|----------------|
| Enable cloud   |
| Reboot         |
| Set mode Color |

Custom Variables

|                                             |                                                                              |
|---------------------------------------------|------------------------------------------------------------------------------|
| `transitionTime` (numeric) = TransitionTime | Light transition duration in milliseconds (import parameter, default 300 ms) |

Read (module)

```taphome
VAR now := NOW();

IF now.Ticks < debounceTimestamp
    RETURN(0);
END

VAR response := SENDHTTPREQUEST("/status");

IF response.IsSuccess
    jsonStatus := response.Content;
    
    if PARSEJSON(jsonStatus, "$.mode", 1) = "white"
    adderror("Mode White is not supported");
    end
ELSE
    jsonStatus := NULL;
END
```

Service Attributes

IP Address

```taphome
VAR response := SENDHTTPREQUEST("/status");

IF response.IsSuccess
    jsonStatus := response.Content;
ELSE
    jsonStatus := NULL;
END

VAR address := PARSEJSON(jsonStatus, "$.wifi_sta.ip", 1);
IF (ISNULL(address), "-", address)
```

MAC Address

```taphome
VAR value := PARSEJSON(jsonStatus, "$.mac", 1);
IF ISNULL(value)
    RETURN("-");
END;

STRING mac;
INT i := 0;
INT len := LENGTH(value);

WHILE i < len
    mac += GETAT(value, i);
    i += 1;
    
    IF MOD(i, 2) = 0 AND i < len
        mac += ":";
    END
LOOP

mac
```

WIFI signal

```taphome
VAR signal := PARSEJSON(jsonStatus, "$.wifi_sta.rssi", 1);
IF (ISNULL(signal), "-", signal + "db");
```

Cloud enabled

```taphome
VAR value := PARSEJSON(jsonStatus, "$.cloud.enabled", 1);
IF (ISNULL(value), "-", value)
```

Cloud connected

```taphome
VAR value := PARSEJSON(jsonStatus, "$.cloud.connected", 1);
IF (ISNULL(value), "-", value)
```

MQTT connected

```taphome
VAR value := PARSEJSON(jsonStatus, "$.mqtt.connected", 1);
IF (ISNULL(value), "-", value)
```

Device time

```taphome
VAR value := PARSEJSON(jsonStatus, "$.time", 1);
IF (ISNULL(value), "-", value)
```

FW update available

```taphome
VAR value := PARSEJSON(jsonStatus, "$.has_update");
IF (ISNULL(value), "-", value)
```

Uptime

```taphome
VAR value := PARSEJSON(jsonStatus, "$.uptime", 1);
IF ISNULL(value)
    RETURN("-");
END

VAR days := FLOOR(value/86400, 1);
value := MOD(value, 86400);
VAR hours := FLOOR(value/3600, 1);
value := MOD(value, 3600);
VAR minutes := FLOOR(value/60, 1);

days + "day(s) " + hours + "h " + minutes + "m"
```

RAM

```taphome
VAR ramFree := PARSEJSON(jsonStatus, "$.ram_free", 1);
VAR ramTotal := PARSEJSON(jsonStatus, "$.ram_total", 1);

IF ISNULL(ramFree) OR ISNULL(ramTotal)
    RETURN("-");
END

ramFree + " bytes free of " + ramTotal
```

Service Actions

Enable cloud

Parameters: Enable (Enable / Disable)

```taphome
VAR response := SENDHTTPREQUEST("/settings/cloud?enabled=" + enable);
VAR contentJson := response.Content;
VAR wasEnabled := PARSEJSON(contentJson, "enabled");

IF(wasEnabled, "Cloud enabled", "Cloud disabled");
```

Reboot

```taphome
VAR response := SENDHTTPREQUEST("/reboot");
VAR contentJson := response.Content;
VAR wasRebooted := PARSEJSON(contentJson, "ok");

IF(wasRebooted, "Reboot successful", "Error");
```

Set mode Color

```taphome
VAR response := SENDHTTPREQUEST("/settings?mode=color");
IF(response.isSuccess, "Color mode is set", "Error");
```

Electric Meter Electricity Meter Read-only

Power consumption and energy metering — instantaneous power (kW) and cumulative energy (kWh)

numeric Unit: W / kWh

Read total consumption

```taphome
IF LENGTH(jsonStatus) = 0
    RETURN(NaN);
END

VAR power := PARSEJSON(jsonStatus, "$.meters[0].power");
VAR total := PARSEJSON(jsonStatus, "$.meters[0].total");
BOOL isOn := PARSEJSON(jsonStatus, "$.lights[0].ison");

IF ISNULL(power) OR ISNULL(total) OR (ison AND power=0)
	ADDWARNING("To enable power monitoring, open device settings in Shelly app or web browser and configure device model in Settings->Device Model");
	
    RETURN(NaN);
END

total / 60000.0
```

Read demand

```taphome
IF LENGTH(jsonStatus) = 0
    RETURN(NaN);
END

VAR power := PARSEJSON(jsonStatus, "$.meters[0].power", 1);

IF ISNULL(power)
    RETURN(NaN);
END

power / 1000.0
```

Color Light HSB Light Read and write

RGBW color light with HSB control — hue, saturation, brightness, and optional CCT white channel (3000–6500 K)

hsb

Read (module)

```taphome
if PARSEJSON(jsonStatus, "$.lights[0].white", 1) > 0 and PARSEJSON(jsonStatus, "$.lights[0].gain", 1)
    SENDHTTPREQUEST("light/0?gain=0&white=0");
    SENDHTTPREQUEST("light/0?turn=off");
end
```

Read brightness

```taphome
VAR now := NOW();

IF now.Ticks < debounceTimestamp
    RETURN(Hb);
END

INT value;
IF !ISNAN(Ct)
    value := PARSEJSON(jsonStatus, "$.lights[0].white", 1);
ELSE
    value := PARSEJSON(jsonStatus, "$.lights[0].gain", 1);
END

IF ISNULL(value)
    RETURN(NaN);
END

BOOL isOn := PARSEJSON(jsonStatus, "$.lights[0].ison", 1);

IF ISNULL(isOn)
    RETURN(NaN);
END

IF(isOn, value/100.0, 0);
```

Write brightness

```taphome
IF St > 0.5
    IF !ISNAN(Ct)
    SENDHTTPREQUEST("light/0?turn=on&transition=" + transitionTime + "&gain=0&white=" + ROUND(Hb*100.0));
    ELSE
    SENDHTTPREQUEST("light/0?turn=on&transition=" + transitionTime + "&white=0&gain=" + ROUND(Hb*100.0));
    END
ELSE
    SENDHTTPREQUEST("light/0?turn=off&transition=" + transitionTime);
END

VAR now := NOW();
debounceTimestamp := now.Ticks + transitionTime + 500;
```

Read hue

```taphome
VAR now := NOW();

IF now.Ticks < debounceTimestamp
    RETURN(Hd);
END

INT r := PARSEJSON(jsonStatus, "$.lights[0].red", 1);
INT g := PARSEJSON(jsonStatus, "$.lights[0].green", 1);
INT b := PARSEJSON(jsonStatus, "$.lights[0].blue", 1);

VAR HSVColor := RGBTOHSV(r, g, b);
ROUND(HSVColor.Hue);
```

Write hue

```taphome
IF !ISNAN(Ct)
    RETURN(0);
END

VAR color := HSVTORGB(Hd, Sa, 1);

SENDHTTPREQUEST("light/0?mode=color&transition=" + transitionTime + "&gain=" + ROUND(Hb*100) + "&red=" + color.RED + "&green=" + color.GREEN + "&blue=" + color.BLUE + "&white=0");


VAR now := NOW();
debounceTimestamp := now.Ticks + transitionTime + 500;
```

Read saturation

```taphome
VAR now := NOW();

IF now.Ticks < debounceTimestamp
    RETURN(Sa);
END

INT r := PARSEJSON(jsonStatus, "$.lights[0].red", 1);
INT g := PARSEJSON(jsonStatus, "$.lights[0].green", 1);
INT b := PARSEJSON(jsonStatus, "$.lights[0].blue", 1);
 
VAR HSVColor := RGBTOHSV(r, g, b);
ROUND(HSVColor.Saturation * 100.0) / 100.0;
```

Write saturation

```taphome
IF !ISNAN(Ct)
    RETURN(0);
END

VAR color := HSVTORGB(Hd, Sa, 1);

SENDHTTPREQUEST("light/0?mode=color&transition=" + transitionTime + "&gain=" + ROUND(Hb*100) + "&red=" + color.RED + "&green=" + color.GREEN + "&blue=" + color.BLUE + "&white=0");


VAR now := NOW();
debounceTimestamp := now.Ticks + transitionTime + 500;
```

Read color temperature

```taphome
VAR now := NOW();

IF now.Ticks < debounceTimestamp
    RETURN(Ct);
END

INT value := PARSEJSON(jsonStatus, "$.lights[0].temp", 1);
IF PARSEJSON(jsonStatus, "$.lights[0].white", 1) = 0
    RETURN(NaN);
END
 
Ct
```

Write color temperature

```taphome
IF ISNAN(Ct)
    RETURN(0);
END

VAR temp := MIN(Ct, 6500);
temp := MAX(temp, 3000);

SENDHTTPREQUEST("light/0?transition=" + transitionTime + "&white=" + ROUND(Hb*100) + "&gain=0");

VAR now := NOW();
debounceTimestamp := now.Ticks + transitionTime + 500;
```

**Connection:** Packet Parser → HTTP • Hostname: `shellyrgbw2-{MAC}.local`

Possible improvements (7)

- Light effect — Color mode: effect index (0=off, 1–3=predefined effects), settable via /light/0?effect=N
- Input State — Physical input state (0/1), available in /status response
- WiFi RSSI (numeric) — WiFi RSSI in dBm as numeric value — template reads it as string with 'db' suffix
- Power protection — Max power setting in Watts, available in /settings; read + write possible via /settings?max\_power=N
- OTA firmware update — Trigger OTA firmware update via /ota?update=true
- Internal device temperature — Internal temperature in C, available in /status response (Gen1 devices)
- Overheated — Overtemperature flag, boolean, available in /status response

## Import parameters

Enter these values when you import the XML.

| Asked in the app     | Default       |
|----------------------|---------------|
| IP address           | `192.168.0.1` |
| Transition time (ms) | `300`         |

## Sources

- Shelly Gen1 API Reference
  
  [shelly-api-docs.shelly.cloud](https://shelly-api-docs.shelly.cloud/gen1/) 2026-03-12
- Home Assistant Shelly Integration
  
  [www.home-assistant.io](https://www.home-assistant.io/integrations/shelly/) 2026-03-12
- Shelly RGBW2 API — Color & White Mode Endpoints
  
  [shelly-api-docs.shelly.cloud](https://shelly-api-docs.shelly.cloud/gen1/#shelly-rgbw2-color-mode) 2026-03-30
- Shelly RGBW2 Knowledge Base
  
  [kb.shelly.cloud](https://kb.shelly.cloud/knowledge-base/shelly-rgbw2) 2026-03-30

## Related Documentation

- [Packet Parser Integration](https://taphome.com/en/compatibility/packet-parser-guide/)
- [Packet Parser (HTTP, TCP, UDP, FTP, MQTT)](https://taphome.com/en/docs/integration/packet-parser/)
- [Packet parser functions](https://taphome.com/en/docs/script/packet-parser/)
- [Parsing functions](https://taphome.com/en/docs/script/parsing-functions/)

