Skip to end of metadata
Go to start of metadata

UserGuide: https://shelly.cloud/wp-content/uploads/2019/02/ShellyRGBW2_userguide_EN.pdf

Depending on mode of operation, two sets of MQTT topics can be used to control and monitor the device.

Color-mode MQTT

When used to control an RGB + White, the device can be controlled using the same MQTT protocol as Shelly Bulb and looks like a single logical device.

Command topics

RGBW2 subscribes to the following topics:

  • shellies/shellyrgbw2-<deviceid>/color/0/command accepts on and off payloads
  • shellies/shellyrgbw2-<deviceid>/color/0/set accepts a json payload described below:
{
    "turn": "on",    /* bool, can be set with on and off commands */
    "red": 0,        /* red brightness, 0..255, applies in mode="color" */
    "green": 0,      /* green brightness, 0..255, applies in mode="color" */
    "blue": 255,     /* blue brightness, 0..255, applies in mode="color" */
    "white": 0,      /* white brightness, 0..255, applies in mode="color" */
    "gain": 100,     /* gain for all channels, 0..100, applies in mode="color" */
    "effect": 0      /* applies an effect when set */
}

Status topics

RGBW2 in color mode publishes to:

  • shellies/shellyrgbw2-<deviceid>/color/0: current on/off state
  • shellies/shellyrgbw2-<deviceid>/color/0/status: a json payload with the entiree device state
mosquitto_sub -t 'shellies/shellyrgbw2-11ABD9/color/0/status'
shellies/shellyrgbw2-11ABD9/color/0/status
{
    "ison":true,
    "red":34,
    "green":34,
    "blue":34,
    "white":34,
    "gain":5,
    "effect":0,
    "power":0.00,
    "overpower":false
}


White-mode MQTT

This mode allows for independent control of the 4 output channels with an identical set of MQTT topics. Channels are indexed 0 to 3.

Command topics

  • shellies/shellyrgbw2-<deviceid>/white/<n>/command accepts on and off payloads
  • shellies/shellyrgbw2-<deviceid>/white/<n>/set accepts a JSON payload with two possible keys:
    • brightness sets output level, 0 to 100;
    • turn can be on or off, acts just like publishing to .../command

mosquitto_pub -t shellies/shellyrgbw2-11ABD9/white/2/set \
    -m '{"brightness":70}'

mosquitto_pub -t shellies/shellyrgbw2-11ABD9/white/2/set \
    -m '{"turn":"off","brightness":33}'

Status topics

Information about each output channel is published on shellies/shellyrgbw2-<deviceid>/white/<n>/status as a json message.

  • No labels