Skip to content

Commit a32ac52

Browse files
authored
[shelly] Add support for Shelly Plus RGBW PM (openhab#17692)
* [shelly] Add support for Shelly Plus RGBW PM Signed-off-by: Jan N. Klug <[email protected]>
1 parent 10b3f0a commit a32ac52

13 files changed

+201
-10
lines changed

bundles/org.openhab.binding.shelly/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ See section [Discovery](#discovery) for details.
8181
### Generation 2 Plus series
8282

8383
| thing-type | Model | Vendor ID |
84-
| -------------------- | -------------------------------------------------------- | ---------------------------- |
84+
|----------------------|----------------------------------------------------------|------------------------------|
8585
| shellyplus1 | Shelly Plus 1 with 1x relay | SNSW-001X16EU, S3SW-001X16EU |
8686
| shellyplus1pm | Shelly Plus 1PM with 1x relay + power meter | SNSW-001P16EU, S3SW-001P16EU |
8787
| shellyplus2pm-relay | Shelly Plus 2PM with 2x relay + power meter, relay mode | SNSW-002P16EU, SNSW-102P16EU |
@@ -97,6 +97,7 @@ See section [Discovery](#discovery) for details.
9797
| shellyhtg3 | Shelly Plus HT Gen 3 with temperature + humidity sensor | S3SN-0U12A |
9898
| shellyplussmoke | Shelly Plus Smoke sensor | SNSN-0031Z |
9999
| shellypluswdus | Shelly Plus Wall Dimmer US | SNDM-0013US |
100+
| shellyplusrgbwpm | Shelly Plus RGBW PM | SNDC-0D4P10WW |
100101
| shellywalldisplay | Shelly Plus Wall Display | SAWD-0A1XX10EU1 |
101102
| shellyblugw | SHelly BLU Gateway | SNGW-BT01 |
102103

bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/ShellyBindingConstants.java

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public class ShellyBindingConstants {
8282
THING_TYPE_SHELLYPLUSPLUGS, //
8383
THING_TYPE_SHELLYPLUSPLUGUS, //
8484
THING_TYPE_SHELLYPLUSDIMMERUS, //
85+
THING_TYPE_SHELLYPLUSRGBWPM, //
8586

8687
// Shelly Wall Display
8788
THING_TYPE_SHELLYPLUSWALLDISPLAY, //

bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/ShellyHandlerFactory.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) {
126126
|| thingType.equals(THING_TYPE_SHELLYRGBW2_COLOR_STR)
127127
|| thingType.equals(THING_TYPE_SHELLYRGBW2_WHITE_STR)
128128
|| thingType.equals(THING_TYPE_SHELLYRGBW2_WHITE_STR) || thingType.equals(THING_TYPE_SHELLYDUORGBW_STR)
129-
|| thingType.equals(THING_TYPE_SHELLYVINTAGE_STR)) {
129+
|| thingType.equals(THING_TYPE_SHELLYVINTAGE_STR)
130+
|| thingType.equals(THING_TYPE_SHELLYPLUSRGBWPM_STR)) {
130131
logger.debug("{}: Create new thing of type {} using ShellyLightHandler", thing.getLabel(),
131132
thingTypeUID.toString());
132133
handler = new ShellyLightHandler(thing, messages, bindingConfig, thingTable, coapServer, httpClient);

bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfile.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ public void initFromThingType(String name) {
208208
isBulb = thingType.equals(THING_TYPE_SHELLYBULB_STR);
209209
isDuo = thingType.equals(THING_TYPE_SHELLYDUO_STR) || thingType.equals(THING_TYPE_SHELLYVINTAGE_STR)
210210
|| thingType.equals(THING_TYPE_SHELLYDUORGBW_STR);
211-
isRGBW2 = thingType.startsWith(THING_TYPE_SHELLYRGBW2_PREFIX);
211+
isRGBW2 = thingType.startsWith(THING_TYPE_SHELLYRGBW2_PREFIX)
212+
|| thingType.equals(THING_TYPE_SHELLYPLUSRGBWPM_STR);
212213
isLight = isBulb || isDuo || isRGBW2;
213214
if (isLight) {
214215
minTemp = isBulb ? MIN_COLOR_TEMP_BULB : MIN_COLOR_TEMP_DUO;

bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api2/Shelly2ApiClient.java

+39
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.util.ArrayList;
2121
import java.util.List;
2222
import java.util.Map;
23+
import java.util.Objects;
2324
import java.util.Random;
2425

2526
import org.eclipse.jdt.annotation.NonNullByDefault;
@@ -67,6 +68,7 @@
6768
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult.Shelly2DeviceStatusPower;
6869
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult.Shelly2DeviceStatusSmoke;
6970
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult.Shelly2DeviceStatusTempId;
71+
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult.Shelly2RGBWStatus;
7072
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2InputStatus;
7173
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2RelayStatus;
7274
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2RpcBaseMessage;
@@ -196,6 +198,7 @@ protected boolean fillDeviceStatus(ShellySettingsStatus status, Shelly2DeviceSta
196198
updated |= updateEmStatus(status, result.em11, channelUpdate);
197199
updated |= updateRollerStatus(status, result.cover0, channelUpdate);
198200
updated |= updateDimmerStatus(status, result.light0, channelUpdate);
201+
updated |= updateRGBWStatus(status, result.rgbw0, channelUpdate);
199202
if (channelUpdate) {
200203
updated |= ShellyComponents.updateMeters(getThing(), status);
201204
}
@@ -587,6 +590,21 @@ protected void fillDimmerSettings(ShellyDeviceProfile profile, Shelly2GetConfigR
587590
}
588591
}
589592

593+
protected void fillRgbwSettings(ShellyDeviceProfile profile, Shelly2GetConfigResult dc) {
594+
if (!profile.isRGBW2 || dc.rgbw0 == null) {
595+
return;
596+
}
597+
598+
List<ShellySettingsRgbwLight> lights = profile.settings.lights;
599+
if (lights != null) {
600+
ShellySettingsRgbwLight ls = lights.get(0);
601+
ls.autoOn = dc.rgbw0.autoOnDelay;
602+
ls.autoOff = dc.rgbw0.autoOffDelay;
603+
ls.name = dc.rgbw0.name;
604+
lights.set(0, ls);
605+
}
606+
}
607+
590608
private boolean updateDimmerStatus(ShellySettingsStatus status, @Nullable Shelly2DeviceStatusLight value,
591609
boolean channelUpdate) throws ShellyApiException {
592610
ShellyDeviceProfile profile = getProfile();
@@ -605,6 +623,27 @@ private boolean updateDimmerStatus(ShellySettingsStatus status, @Nullable Shelly
605623
return channelUpdate ? ShellyComponents.updateDimmers(getThing(), status) : false;
606624
}
607625

626+
private boolean updateRGBWStatus(ShellySettingsStatus status, @Nullable Shelly2RGBWStatus value,
627+
boolean channelUpdate) throws ShellyApiException {
628+
ShellyDeviceProfile profile = getProfile();
629+
if (!profile.isRGBW2 || value == null) {
630+
return false;
631+
}
632+
633+
ShellySettingsLight ds = status.lights.get(0);
634+
ds.brightness = Objects.requireNonNullElse(value.brightness, ds.brightness).intValue();
635+
if (value.rgb != null) {
636+
ds.red = value.rgb[0];
637+
ds.green = value.rgb[1];
638+
ds.blue = value.rgb[2];
639+
}
640+
ds.white = Objects.requireNonNullElse(value.white, ds.white);
641+
ds.ison = value.output;
642+
643+
status.lights.set(0, ds);
644+
return channelUpdate ? ShellyComponents.updateRGBW(getThing(), status) : false;
645+
}
646+
608647
protected @Nullable Integer getDuration(@Nullable Double timerStartedAt, @Nullable Double timerDuration) {
609648
if (timerStartedAt == null || timerDuration == null) {
610649
return null;

bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api2/Shelly2ApiJsonDTO.java

+24
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ public class Shelly2ApiJsonDTO {
5454
public static final String SHELLYRPC_METHOD_LIGHT_STATUS = "Light.GetStatus";
5555
public static final String SHELLYRPC_METHOD_LIGHT_SET = "Light.Set";
5656
public static final String SHELLYRPC_METHOD_LIGHT_SETCONFIG = "Light.SetConfig";
57+
public static final String SHELLYRPC_METHOD_RGBW_STATUS = "RGBW.GetStatus";
58+
public static final String SHELLYRPC_METHOD_RGBW_SET = "RGBW.Set";
5759
public static final String SHELLYRPC_METHOD_LED_SETCONFIG = "WD_UI.SetConfig";
5860
public static final String SHELLYRPC_METHOD_WIFIGETCONG = "Wifi.GetConfig";
5961
public static final String SHELLYRPC_METHOD_WIFISETCONG = "Wifi.SetConfig";
@@ -499,6 +501,9 @@ public class Shelly2DevConfigMqtt {
499501
@SerializedName("light:0")
500502
public Shelly2GetConfigLight light0;
501503

504+
@SerializedName("rgbw:0")
505+
public Shelly2GetConfigLight rgbw0;
506+
502507
@SerializedName("smoke:0")
503508
public Shelly2ConfigSmoke smoke0;
504509
}
@@ -723,6 +728,20 @@ public class Shelly2DeviceStatusSmoke {
723728
public Boolean mute;
724729
}
725730

731+
public static class Shelly2RGBWStatus {
732+
public Integer id;
733+
public String source;
734+
public Boolean output;
735+
public Integer[] rgb;
736+
public Double brightness;
737+
public Integer white;
738+
public Shelly2DeviceStatusTemp temperature;
739+
public Shelly2Energy aenergy;
740+
public Double apower;
741+
public Double voltage;
742+
public Double current;
743+
}
744+
726745
public Shelly2DeviceStatusBle ble;
727746
public Shelly2DeviceStatusCloud cloud;
728747
public Shelly2DeviceStatusMqqt mqtt;
@@ -740,6 +759,9 @@ public class Shelly2DeviceStatusSmoke {
740759
@SerializedName("input:100")
741760
public Shelly2InputStatus input100; // Digital Input from Add-On
742761

762+
@SerializedName("rgbw:0")
763+
public Shelly2RGBWStatus rgbw0;
764+
743765
@SerializedName("switch:0")
744766
public Shelly2RelayStatus switch0;
745767
@SerializedName("switch:1")
@@ -965,6 +987,8 @@ public static class Shelly2RpcRequestParams {
965987
public Integer brightness;
966988
@SerializedName("toggle_after")
967989
public Integer toggleAfter;
990+
public Integer white;
991+
public Integer[] rgb;
968992

969993
// Shelly.SetAuth
970994
public String user;

bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api2/Shelly2ApiRpc.java

+52
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceSettings;
6969
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusLight;
7070
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult;
71+
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult.Shelly2RGBWStatus;
7172
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusSys.Shelly2DeviceStatusSysAvlUpdate;
7273
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2NotifyEvent;
7374
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2RpcBaseMessage;
@@ -306,6 +307,14 @@ public ShellyDeviceProfile getDeviceProfile(String thingType, @Nullable ShellySe
306307
fillDimmerSettings(profile, dc);
307308
}
308309
profile.status.lights = profile.isBulb ? new ArrayList<>() : null;
310+
if (profile.isRGBW2) {
311+
ArrayList<ShellySettingsRgbwLight> rgbwLights = new ArrayList<>();
312+
rgbwLights.add(new ShellySettingsRgbwLight());
313+
profile.settings.lights = rgbwLights;
314+
profile.status.lights = new ArrayList<>();
315+
profile.status.lights.add(new ShellySettingsLight());
316+
fillRgbwSettings(profile, dc);
317+
}
309318
profile.status.thermostats = profile.isTRV ? new ArrayList<>() : null;
310319

311320
if (profile.hasBattery) {
@@ -920,6 +929,26 @@ public void setRollerPos(int relayIndex, int position) throws ShellyApiException
920929

921930
@Override
922931
public ShellyStatusLight getLightStatus() throws ShellyApiException {
932+
ShellyDeviceProfile profile = getProfile();
933+
if (profile.isRGBW2) {
934+
Shelly2RGBWStatus ls = apiRequest(
935+
new Shelly2RpcRequest().withMethod(SHELLYRPC_METHOD_RGBW_STATUS).withId(0),
936+
Shelly2RGBWStatus.class);
937+
ShellyStatusLightChannel lightChannel = new ShellyStatusLightChannel();
938+
lightChannel.red = ls.rgb[0];
939+
lightChannel.green = ls.rgb[1];
940+
lightChannel.blue = ls.rgb[2];
941+
lightChannel.white = ls.white;
942+
lightChannel.brightness = ls.brightness.intValue();
943+
944+
ShellyStatusLight status = new ShellyStatusLight();
945+
status.lights = new ArrayList<>();
946+
status.lights.add(lightChannel);
947+
status.ison = ls.output;
948+
949+
return status;
950+
}
951+
923952
throw new ShellyApiException("API call not implemented");
924953
}
925954

@@ -1122,6 +1151,29 @@ public void setLightParm(int lightIndex, String parm, String value) throws Shell
11221151

11231152
@Override
11241153
public void setLightParms(int lightIndex, Map<String, String> parameters) throws ShellyApiException {
1154+
Shelly2RpcRequestParams params = new Shelly2RpcRequestParams();
1155+
if (getProfile().isRGBW2) {
1156+
String brightness = parameters.get(SHELLY_COLOR_BRIGHTNESS);
1157+
if (brightness != null) {
1158+
params.brightness = Integer.parseInt(brightness);
1159+
}
1160+
String red = parameters.get(SHELLY_COLOR_RED);
1161+
String green = parameters.get(SHELLY_COLOR_GREEN);
1162+
String blue = parameters.get(SHELLY_COLOR_BLUE);
1163+
if (red != null && green != null && blue != null) {
1164+
params.rgb = new Integer[] { Integer.parseInt(red), Integer.parseInt(green), Integer.parseInt(blue) };
1165+
}
1166+
String white = parameters.get(SHELLY_COLOR_WHITE);
1167+
if (white != null) {
1168+
params.white = Integer.parseInt(white);
1169+
}
1170+
if (parameters.containsKey(SHELLY_LIGHT_TURN)) {
1171+
params.on = SHELLY_API_ON.equals(parameters.get(SHELLY_LIGHT_TURN));
1172+
}
1173+
params.id = lightIndex;
1174+
1175+
apiRequest(SHELLYRPC_METHOD_RGBW_SET, params, String.class);
1176+
}
11251177
throw new ShellyApiException("API call not implemented");
11261178
}
11271179

bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreator.java

+6
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public class ShellyThingCreator {
8989
public static final String SHELLYDT_PLUSDIMMER10V = "SNDM-00100WW";
9090
public static final String SHELLYDT_PLUSDIMMER0110VG3 = "S3DM-0010WW";
9191
public static final String SHELLYDT_PLUSWALLDISPLAY = "SAWD-0A1XX10EU1";
92+
public static final String SHELLYDT_PLUSRGBWPM = "SNDC-0D4P10WW";
9293

9394
// Shelly Pro Series
9495
public static final String SHELLYDT_PRO1 = "SPSW-001XE16EU";
@@ -189,6 +190,7 @@ public class ShellyThingCreator {
189190
public static final String THING_TYPE_SHELLYPLUSDIMMERUS_STR = "shellypluswdus";
190191
public static final String THING_TYPE_SHELLYPLUSDIMMER10V_STR = "shellyplus10v";
191192
public static final String THING_TYPE_SHELLYPLUSDIMMER0110VG3_STR = "shelly0110dimg3";
193+
public static final String THING_TYPE_SHELLYPLUSRGBWPM_STR = "shellyplusrgbwpm";
192194

193195
// Shelly Wall Display
194196
public static final String THING_TYPE_SHELLYPLUSWALLDISPLAY_STR = "shellywalldisplay";
@@ -305,6 +307,8 @@ public class ShellyThingCreator {
305307
THING_TYPE_SHELLYPLUSDIMMERUS_STR);
306308
public static final ThingTypeUID THING_TYPE_SHELLYPLUSDIMMER10V = new ThingTypeUID(BINDING_ID,
307309
THING_TYPE_SHELLYPLUSDIMMER10V_STR);
310+
public static final ThingTypeUID THING_TYPE_SHELLYPLUSRGBWPM = new ThingTypeUID(BINDING_ID,
311+
THING_TYPE_SHELLYPLUSRGBWPM_STR);
308312

309313
// Shelly Wall Display
310314
public static final ThingTypeUID THING_TYPE_SHELLYPLUSWALLDISPLAY = new ThingTypeUID(BINDING_ID,
@@ -398,6 +402,7 @@ public class ShellyThingCreator {
398402
THING_TYPE_MAPPING.put(SHELLYDT_PLUSDIMMERUS, THING_TYPE_SHELLYPLUSDIMMERUS_STR);
399403
THING_TYPE_MAPPING.put(SHELLYDT_PLUSDIMMER10V, THING_TYPE_SHELLYPLUSDIMMER10V_STR);
400404
THING_TYPE_MAPPING.put(SHELLYDT_PLUSDIMMER0110VG3, THING_TYPE_SHELLYPLUSDIMMER10V_STR);
405+
THING_TYPE_MAPPING.put(SHELLYDT_PLUSRGBWPM, THING_TYPE_SHELLYPLUSRGBWPM_STR);
401406

402407
// Plus Mini Series
403408
THING_TYPE_MAPPING.put(SHELLYDT_MINI1, THING_TYPE_SHELLY1MINI_STR);
@@ -487,6 +492,7 @@ public class ShellyThingCreator {
487492
THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPLUSDIMMERUS_STR, THING_TYPE_SHELLYPLUSDIMMERUS_STR);
488493
THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPLUSDIMMER10V_STR, THING_TYPE_SHELLYPLUSDIMMER10V_STR);
489494
THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPLUSDIMMER0110VG3_STR, THING_TYPE_SHELLYPLUSDIMMER10V_STR);
495+
THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPLUSRGBWPM_STR, THING_TYPE_SHELLYPLUSRGBWPM_STR);
490496

491497
THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPLUSWALLDISPLAY_STR, THING_TYPE_SHELLYPLUSWALLDISPLAY_STR);
492498

bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyComponents.java

+21
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,27 @@ public static boolean updateSensors(ShellyThingInterface thingHandler, ShellySet
569569
return updated;
570570
}
571571

572+
public static boolean updateRGBW(ShellyThingInterface thingHandler, ShellySettingsStatus orgStatus)
573+
throws ShellyApiException {
574+
boolean updated = false;
575+
ShellyDeviceProfile profile = thingHandler.getProfile();
576+
if (profile.isRGBW2) {
577+
if (!thingHandler.areChannelsCreated()) {
578+
return false;
579+
}
580+
ShellySettingsLight light = orgStatus.lights.get(0);
581+
ShellyColorUtils col = new ShellyColorUtils();
582+
col.setRGBW(light.red, light.green, light.blue, light.white);
583+
updated |= thingHandler.updateChannel(CHANNEL_GROUP_COLOR_CONTROL, CHANNEL_COLOR_RED, col.percentRed);
584+
updated |= thingHandler.updateChannel(CHANNEL_GROUP_COLOR_CONTROL, CHANNEL_COLOR_GREEN, col.percentGreen);
585+
updated |= thingHandler.updateChannel(CHANNEL_GROUP_COLOR_CONTROL, CHANNEL_COLOR_BLUE, col.percentBlue);
586+
updated |= thingHandler.updateChannel(CHANNEL_GROUP_COLOR_CONTROL, CHANNEL_COLOR_WHITE, col.percentWhite);
587+
updated |= thingHandler.updateChannel(CHANNEL_GROUP_COLOR_CONTROL, CHANNEL_COLOR_PICKER, col.toHSB());
588+
589+
}
590+
return updated;
591+
}
592+
572593
public static boolean updateDimmers(ShellyThingInterface thingHandler, ShellySettingsStatus orgStatus)
573594
throws ShellyApiException {
574595
boolean updated = false;

bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyLightHandler.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public boolean updateDeviceStatus(ShellySettingsStatus genericStatus) throws She
353353
postEvent(ALARM_TYPE_OVERPOWER, false);
354354
}
355355

356-
if (profile.inColor) {
356+
if (profile.inColor || (profile.isGen2 && profile.isRGBW2)) {
357357
logger.trace("{}: update color settings", thingName);
358358
col.setRGBW(getInteger(light.red), getInteger(light.green), getInteger(light.blue),
359359
getInteger(light.white));
@@ -376,7 +376,7 @@ public boolean updateDeviceStatus(ShellySettingsStatus genericStatus) throws She
376376
updated |= updateChannel(colorGroup, CHANNEL_COLOR_PICKER, col.toHSB());
377377
}
378378

379-
if (!profile.inColor || profile.isBulb) {
379+
if ((!profile.inColor && !profile.isGen2) || profile.isBulb) {
380380
String whiteGroup = buildWhiteGroupName(profile, channelId);
381381
col.setBrightness(getInteger(light.brightness));
382382
updated |= updateChannel(whiteGroup, CHANNEL_BRIGHTNESS + "$Switch", col.power);
@@ -458,7 +458,7 @@ private void sendColors(ShellyDeviceProfile profile, Integer lightId, ShellyColo
458458
if (autoOn && (newCol.brightness >= 0)) {
459459
parms.put(SHELLY_LIGHT_TURN, profile.inColor || newCol.brightness > 0 ? SHELLY_API_ON : SHELLY_API_OFF);
460460
}
461-
if (profile.inColor) {
461+
if (profile.inColor || (profile.isGen2 && profile.isRGBW2)) {
462462
if (oldCol.red != newCol.red || oldCol.green != newCol.green || oldCol.blue != newCol.blue
463463
|| oldCol.white != newCol.white) {
464464
logger.debug("{}: Setting RGBW to {}/{}/{}/{}", thingName, newCol.red, newCol.green, newCol.blue,

0 commit comments

Comments
 (0)