Milight Nightmode "OFF" - LED is still ON

Hi,

in Milight Binding v2 switching Nightmode ON works fine.
But when switching it OFF the LED is still ON.

So for turning the light off I would need to switch OFF nightmode and after that additionally set brightness to OFF?

Is that a bug or intended? :wink:

cheers,
Stefan

Hey Stefan,

when I developed the binding, I thought of the Nightmode functionality to be similar like the “disco” functionality. If you turn the function off, the previous state should be restored (which is “ON” in your case). If you think that doesn’t make sense we can discuss an altered behavior.

Thanks,
David

Hi David,

thx for your response!
Yes, restoring the previous state sounds ok, but it doesn’t work somehow. For example:

Everything (Brightness, NightMode, Color) is OFF > Switch NM ON > LED Turns on in NM, correct.
Switch NM OFF > LED turns OFF and immediately ON again (in NM), :frowning:

Another thing I have some problems with is how to correctly switch OFF a colored light so that it starts in WhiteMode next time I set Brightness ON…

Right now e.g. after setting

sendCommand(LED_Kueche_Color, new HSBType(new DecimalType(0),new PercentType(100),new PercentType(100)))

I have to do

sendCommand(LED_Kueche_Color, new HSBType(new DecimalType(0),new PercentType(0),new PercentType(100)))
Thread::sleep(500)
LED_Kueche_Brightness.sendCommand(ON)
Thread::sleep(500)
LED_Kueche_Brightness.sendCommand(OFF)

to make sure the LED is white next time I switch it ON with LED_Kueche_Brightness.sendCommand(ON).
Otherwise it starts (in my example) in red color.

cheers,
Stefan

Hi Stefan,
that’s how milights work, actually. Everytime you switch off a lightbulb the last chosen color is saved and restored upon switching it on again.

yeah I know, but in the 1.9 binding there was a “WhiteMode” which I used as the standard light switch.
That “neutralized” my colors or brightness changes :relieved:

I just fiddled around a little bit an just made a rule to change the color to “white” whenever the milight is switched on:
(simplified)

milight.items

Dimmer l_brightness_wz_fernsehlicht "Fernsehlicht" <light> (gWZL) ["Lighting"] {channel="milight:rgbLed:ACCF12DDG57F:7:ledbrightness"}
Color l_color_wz_fernsehlicht "Fernsehlicht Farbe" <colorwheel> (gWZL) {channel="milight:rgbLed:ACCF12DDG57F:7:ledcolor"}

milight.rules

rule "Fernsehlicht_Helligkeit"
when
  Item l_brightness_wz_fernsehlicht received command
then
   if (receivedCommand==100) {
      Thread::sleep(500)
      l_color_wz_fernsehlicht.sendCommand(new HSBType(new DecimalType(0),new PercentType(0),new PercentType(100)))
    }
end

I hope that’ll do.

You can of course fiddle around with unbound items to receive the commands and then adjust the lights in this way.

1 Like