TapHome

Shelly RGBW2

Packet Parser → HTTP
Submitted by
Last updated: 03. 2026
Shelly RGBW2

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 powermeters[0].power in watts, converted to kW
  • Total consumptionmeters[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:

ChannelOutputEndpointPoll interval
Ch1R (Red)/light/02.5 s
Ch2G (Green)/light/12.5 s
Ch3B (Blue)/light/22.5 s
Ch4W (White)/light/32.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

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. Use a poll interval of 10-30 seconds.

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 (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.1Internet & SecurityWi-Fi Mode - Client
  4. Enter SSID and password → Save

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:

1
shelly<model>-<MAC>.local

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

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

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

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) = TransitionTimeLight transition duration in milliseconds (import parameter, default 300ms)

Shelly RGBW2 Color

Read (module)
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
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
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
VAR signal := PARSEJSON(jsonStatus, "$.wifi_sta.rssi", 1);
IF (ISNULL(signal), "-", signal + "db");
Cloud enabled
VAR value := PARSEJSON(jsonStatus, "$.cloud.enabled", 1);
IF (ISNULL(value), "-", value)
Cloud connected
VAR value := PARSEJSON(jsonStatus, "$.cloud.connected", 1);
IF (ISNULL(value), "-", value)
MQTT connected
VAR value := PARSEJSON(jsonStatus, "$.mqtt.connected", 1);
IF (ISNULL(value), "-", value)
Device time
VAR value := PARSEJSON(jsonStatus, "$.time", 1);
IF (ISNULL(value), "-", value)
FW update available
VAR value := PARSEJSON(jsonStatus, "$.has_update");
IF (ISNULL(value), "-", value)
Uptime
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
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)
VAR response := SENDHTTPREQUEST("/settings/cloud?enabled=" + enable);
VAR contentJson := response.Content;
VAR wasEnabled := PARSEJSON(contentJson, "enabled");

IF(wasEnabled, "Cloud enabled", "Cloud disabled");
Reboot
VAR response := SENDHTTPREQUEST("/reboot");
VAR contentJson := response.Content;
VAR wasRebooted := PARSEJSON(contentJson, "ok");

IF(wasRebooted, "Reboot successful", "Error");
Set mode Color
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

Electric Meter

Read total consumption
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
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

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

hsb

Color Light

Read (module)
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
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
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
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
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
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
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
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
IF Ct = NaN
    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
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

Sources