Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Shelly RGBW DUO #588

Closed
sebastiannielsen opened this issue Aug 1, 2024 · 4 comments · Fixed by #585
Closed

Support for Shelly RGBW DUO #588

sebastiannielsen opened this issue Aug 1, 2024 · 4 comments · Fixed by #585
Labels

Comments

@sebastiannielsen
Copy link

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
}

@sebastiannielsen sebastiannielsen added the feature-request New feature or request label Aug 1, 2024
@bieniu
Copy link
Owner

bieniu commented Aug 3, 2024

Discussed many times, at the moment there is no way to properly and fully configure this bulb via MQTT. At least I don't know how to do it. If someone creates the correct configuration we can add it to the script, I won't work on it because my bulb died.

@sebastiannielsen
Copy link
Author

Actually tried out the script in the PR and it works out well:
#585

image
image
20240803_110315

image
20240803_110612

It even works with the effects values.

So I say, you should work on getting that PR merged.

@inch1957
Copy link

Hello bieniu,
regarding this open issue, I have an old version of your script (the version is not documented, but my file is dated May 2023), where there are entries concerning this device type:
MODEL_SHELLYBULB_ID = "SHBLB-1" # Shelly Bulb
MODEL_SHELLYBULB_PREFIX = "shellybulb"

MODEL_SHELLYBULBRGBW_ID = "SHCB-1" # Shelly DUO RGBW
MODEL_SHELLYBULBRGBW_PREFIX = "shellycolorbulb"

And further down of course the appropriate codings...
old_shellies_discovery.txt

De Facto, I have (did have...) 2 of these bulbs in my Home-assistant. I deleted one and with the latest version of your script it will of course no longer get re-installed. The original entry is there and working.

Somewhere in the works your coding seems to have got dropped...

Hope this info helps, thanks for your great work on making all this so simple!

Copy link
Contributor

Stale issue message

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants