[SOLVED] Milight dual white brightness

Almost all working now, the last remaining issue may be a more general openhab issue than specific to this binding. I’m trying to implement brightness as a slider. The android app does display a slider, and it works well enough, although its a bit hard to control, but it works. But on the web interface the slider is displayed instead as up and down arrows which are both grey and and do nothing when I click on them. The numerical percentage value thats displayed next to the arrows does change when I move the slider in android

sitemap -

Slider item=officeMilightBrightness

items -

Dimmer officeMilightBrightness “Dimmer [%s %%]” {milight=“mlbLounge;1;brightness”}

One more question about brightness. Do the bulbs themselves have only a few available brightness levels?
Using my rule below it seems to make no difference whether the increment is 1 or 10, the brightness seems to increase in noticable levels that are not smooth, and do not change when I reduce the increment.

rule "Office Light On"
when
Item officeMilight received command ON
then
var i=0
while ((i=i+10)<100) {
sendCommand(officeMilightBrightCmd,i)
}
logInfo(“Lights”,“Executed ON with brightness”)
end

I’ve implemented mappings for nightLight and Warm/White. I’m not sure if this is correctly done, but it works.

            Switch item=officeMilight label="On/Off" mappings=[OFF="Off", ON="On"]
            Switch item=officeMilightNight label="Night Light" mappings=[OFF="Off", ON="Night"]
            Switch item=officeMilightWhite label="White / Warm" mappings=[OFF="White", ON="Warm"]
            Slider item=officeMilightBrightness

One thought I had about the off command. I can see that you have implemented the off state as a series of decrease commands (which go in steps of 9, which probably answers my question about the bulbs brightness levels). This is good, but when its in night mode and you turn it off, it first goes to a higher brightness level before switching off. I guess thats a feature request? Also, it would be nice to have the sendWarmer and sendCooler commands implemented individually if thats possible?

So, after all these questions and trial and error I can say this binding works really well and I thank you for this great contribution. It definitely is more reliable than the apps from the manufacturer, to which I can say that those are some of the worst pieces of software I have ever seen.

I guess now I’ll have to get some RGBW bulbs and tackle those :slight_smile:

If you are using a non Webkit browser like Internet Explorer, this is normal behaviour.

Yes, there is only a limited number of levels, so percentage will be recalculated to these “steps”

No, OFF command is implemented to send a real “OFF” to the bulbs[quote=“dontpanic, post:22, topic:8588”]
This is good, but when its in night mode and you turn it off, it first goes to a higher brightness level before switching off. I guess thats a feature request?
[/quote]

This is the normal behaviour, switching nightMode OFF sends a real OFF command as well. [quote=“dontpanic, post:22, topic:8588”]
Also, it would be nice to have the sendWarmer and sendCooler commands implemented individually if thats possible?
[/quote]

No, it is not, the API just implemented an increase or decrease.

Here are the examples according to your configuration :

Items:

Switch officeMilight "Lounge" {milight="mlbLounge;1"}
Dimmer officeMilightBright "Brightness" {milight="mlbLounge;1;brightness"}
Switch officeMilightNight "Night-Light" {milight="mlbLounge;1;nightMode"}
Dimmer officeMilightColorTemp "White Temperature" {milight="mlbLounge;1;colorTemperature"}

Sitemap

Frame {
    Switch item=officeMilight label="On/Off"
    Switch item=officeMilightBright label="Full ON / OFF" mappings=[100="ON", OFF="OFF"]
    Slider item=officeMilightBright
    Switch item=officeMilightNight label="Night Light"
    Slider item=officeMilightWhite label="Cold White / Warm White" 
	}