diff --git a/sonoff/xdrv_04_light.ino b/sonoff/xdrv_04_light.ino index f3f739b1b..256f001e0 100644 --- a/sonoff/xdrv_04_light.ino +++ b/sonoff/xdrv_04_light.ino @@ -657,7 +657,7 @@ uint16_t LightGetColorTemp(void) // for Alexa, send back the original CT value if close enough // avoids rounding errors - if ((ct > _light_ct ? ct - _light_ct : _light_ct - ct) < 5) + if ((ct > _light_ct ? ct - _light_ct : _light_ct - ct) > 5) _light_ct = ct; return _light_ct; } diff --git a/sonoff/xplg_wemohue.ino b/sonoff/xplg_wemohue.ino index d505ae982..45dc8c750 100644 --- a/sonoff/xplg_wemohue.ino +++ b/sonoff/xplg_wemohue.ino @@ -592,7 +592,8 @@ void HueLightStatus1(uint8_t device, String *response) light_status += "\"sat\":" + String((uint8_t)(254.0f * sat + 0.5f)) + ","; } if (LST_COLDWARM == light_subtype || LST_RGBWC == light_subtype) { // white temp - light_status += "\"ct\":" + String(ct) + ","; + // ct = 0 is non valid, so we put 284 as default value (medium white) + light_status += "\"ct\":" + String( (ct < 100) ? 284 : ct) + ","; } response->replace("{light_status}", light_status); response->replace("{m}", g_gotct?"ct":"hs");