Skip to content

Support for Shelly RGBW DUO #588

@sebastiannielsen

Description

@sebastiannielsen

Is your feature request related to a problem? Please describe.
Duo bulb not supported

Describe the solution you'd like
Support for Duo Bulb

Additional context

Have tried with the following code, but it isn't working right, power measurement works fine, but not light switch:

MODEL_SHELLYCB = f"{ATTR_SHELLY} Color Bulb"
MODEL_SHELLYCB_ID = "SHCB-1" # Shelly Color Bulb Duo RGB
MODEL_SHELLYCB_PREFIX = "shellycolorbulb"

if model_id == MODEL_SHELLYCB_ID or dev_id_prefix == MODEL_SHELLYCB_PREFIX:

model = MODEL_SHELLYCB
inputs = 0
rgbw_lights = 1
white_lights = 1

white_lights = {
    0: {
        KEY_COLOR_TEMP_TEMPLATE: TPL_COLOR_TEMP_WHITE_LIGHT,
        KEY_COMMAND_ON_TEMPLATE: TPL_COMMAND_ON_WHITE_LIGHT_DUO,
        KEY_COMMAND_TOPIC: TOPIC_LIGHT_SET,
        KEY_MAX_MIREDS: 370,
        KEY_MIN_MIREDS: 153,
        KEY_STATE_TOPIC: TOPIC_COLOR_0_STATUS,
    }
}
light_sensors = {
    SENSOR_POWER: OPTIONS_SENSOR_LIGHT_POWER,
    SENSOR_ENERGY: OPTIONS_SENSOR_LIGHT_ENERGY,
}
sensors = {
    SENSOR_IP: OPTIONS_SENSOR_IP,
    SENSOR_RSSI: OPTIONS_SENSOR_RSSI,
    SENSOR_SSID: OPTIONS_SENSOR_SSID,
    SENSOR_UPTIME: OPTIONS_SENSOR_UPTIME,
}
buttons = {BUTTON_RESTART: OPTIONS_BUTTON_RESTART}
updates = {UPDATE_FIRMWARE: OPTIONS_UPDATE_FIRMWARE}

Here is a example of MQTT status its spitting out:

Meddelande 270 mottaget på shellies/shellycolorbulb-3494546E7DE6/color/0/status vid 23:13 :
{
"ison": true,
"source": "mqtt",
"has_timer": false,
"timer_started": 0,
"timer_duration": 0,
"timer_remaining": 0,
"mode": "color",
"red": 14,
"green": 255,
"blue": 242,
"white": 0,
"gain": 100,
"temp": 3000,
"brightness": 100,
"effect": 0,
"transition": 0
}

(it spit out on color/0/status regardless of its in color or white mode)
White mode:

Meddelande 279 mottaget på shellies/shellycolorbulb-3494546E7DE6/color/0/status vid 23:14 :
{
"ison": true,
"source": "http",
"has_timer": false,
"timer_started": 0,
"timer_duration": 0,
"timer_remaining": 0,
"mode": "white",
"red": 14,
"green": 255,
"blue": 242,
"white": 0,
"gain": 100,
"temp": 3000,
"brightness": 100,
"effect": 0,
"transition": 0
}

It also spits out the following statuses, why energy meter works:

Meddelande 284 mottaget på shellies/shellycolorbulb-3494546E7DE6/color/0 vid 23:14 :
on
QoS: 0 - Retain: false
Meddelande 283 mottaget på shellies/shellycolorbulb-3494546E7DE6/light/0/energy vid 23:14 :
135
QoS: 0 - Retain: false
Meddelande 282 mottaget på shellies/shellycolorbulb-3494546E7DE6/light/0/power vid 23:14 :
8.59
QoS: 0 - Retain: false

It also seems to expect a plain "on" or "off" payload (no JSON) on:
shellies/shellycolorbulb-3494546E7DE6/color/0/command

to turn off and on.

If seems to require, to set color, a set JSON payload on
shellies/shellycolorbulb-3494546E7DE6/color/0/set

With the following content:
{
"mode": "color",
"red": 0, ## 0-255
"green": 0, ## 0-255
"blue": 0, ## 0-255
"white": 0, ## 0-255
"gain": 100, ## 0-100
"effect": 0 ## 0 = no effect, 1 = meteror shower, 2 = gradual change, 3 = flash
}
OR
{
"mode": "white",
"temp": 4750, ## 3000 to 6500
"brightness": 100 ## 0-100
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions