Sitemap and configuration for Milight

Hi, I’ve just got my first Milight installed with the wifi receiver, and working with the android app. I’ve followed the instructions in the binding doco, but the doco doesn’t appear to give a sitemap config for the white/warm bulbs. I’ve taken my best guess but no luck so far; in particular I’m not sure what the mappings should be.

For my first step I just want to be able to create a simple switch that turns them on or off, but I’ve tried the nightliight mode and no luck with that either. I’ve read some of the other posts here where people have managed to get the binding to work, but the configs that have been posted use virtual switches and other tricks, and seem more complex than what should be required.

My configs are below, if anyone can point out what I need to chnage, or post some examples, or let me know where there are examples or further documentation that would be very helpful.


sitemap :-

Frame {
    Text label="Lights" icon="bulb" {
        Text label="Office" {
            Switch item=officeMilight mappings=[OFF="Off", ON="On"]
            Switch item=officeMilightNight

items :-

Switch officeMilight {milight=“mlbLounge;0”}
Switch officeMilightNight {milight=“mlbLounge;0;nightMode”}

openhab.cfg :-

For switching on/off, no mappings are needed at all.
Pleas post your debug log to see what commands are send to the bridge.

Hi, thanks for the reply.

I did actually try first with no mappings, when I had no luck I changed it to what it is now.

Events debug (with mappings still included) -

2016-10-12 14:09:18 - officeMilight received command OFF
2016-10-12 14:09:21 - officeMilight received command ON

removed the mappings and no change -

2016-10-12 14:12:33 - officeMilight received command OFF
2016-10-12 14:12:38 - officeMilight received command ON

sitemap is now -

Frame {
    Text label="Lights" icon="bulb" {
        Text label="Office" {
            Switch item=officeMilight
            Switch item=officeMilightNight

The only thing I noticed is that since I added the configs in openhab.cfg for milight I’m getting the duplicate resource error. From what I have read those warnings are not relevant.

This does not look lige debug log entries.
Please add logger name=“org.openhab.binding.milight” level=“DEBUG” to logback_debug and use start_debug(.sh/.bat)
Then please post all milight relevant lines completely.

BTW, are you shure to have the binding added to your addons folder ???


I’ve added that debug entry in the logger and started in debug mode. When I activate the Milight switches from the web interface I can see in the events log the commands are being sent, as per the previous post. However nothing appears in openhab.log for the debug, except the initial startup -

08:19:07.153 [DEBUG] [.b.m.internal.MilightActivator:34 ] - Milight binding has been started.

Nothing appears after this. The debug is being constantly updated by networkhealth so I know its running -

08:24:10.413 [DEBUG] [o.o.b.n.i.NetworkHealthBinding:85 ] - established connection [host ‘’ port ‘0’ timeout ‘5000’]

restarted again and this time I also saw these log items -

10:45:30.851 [DEBUG] [i.internal.GenericItemProvider:341 ] - Start processing binding configuration of Item ‘officeMilight (Type=SwitchItem, State=Uninitialized)’ with ‘MilightGenericBindingProvider’ reader.
10:45:30.857 [DEBUG] [i.internal.GenericItemProvider:341 ] - Start processing binding configuration of Item ‘officeMilightNight (Type=SwitchItem, State=Uninitialized)’ with ‘MilightGenericBindingProvider’ reader.

What is your Java version ??

java -version
java version "1.8.0_65"
Java™ SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot™ Client VM (build 25.65-b01, mixed mode)

Ok, should not be the real issue, but might cause problems with your future experience. Please upgrade your java version to at least 1.8.0_101.

Could you please attach your openhab.cfg, .items and .sitemap file to check if there are any typos or not removed hashtags.

willshome.sitemap.xml (3.3 KB)
willshome.items.xml (5.3 KB)
openhab.cfg.xml (82.6 KB)

I wasnt sure how to attach files, I had to rename them so they were an allowed type.

Also, I ran a packet sniffer from the router on the IP address of the milight, there didnt seem to be any packets sent to it, even though I still got the event “officeMilight received command ON”

Wiered, I can’t find any mistake in your files, so I am running out of ideas.

Ah, thats no good!

I’ve seen some other posts for getting Milight working and people have done it very differently, virtual switches with rules and such. I’ll see what I can find. One of those things that theoretically should be very simple but…

Thanks for the help, if anything springs to mind drop me another post :slight_smile:

I got it working! After reading a few other postings I tried port 8899 instead of 50000 and all good.

The thing that was misleading me, and I still have to work out, was that I have no messages in the debug log when I activate the switches. I put the same log entries in logback.xml and i can see the debug messages.

one other thing thats confusing about this product, other than the multitude of really badly written and non-functional android apps, is that the product advertising states that you can use any number of bulbs with a single bridge.Is this true? The apps that I have seen only allow for 4 bulbs per device, as does the binding.

In this case, you did not use start_debug.(sh/bat), right ???

Anyway, glad it is working now.

No, this is a misunderstanding. You can have quite more than 4 bulbs per group, but they are only controlable in 4 Groups for the white ones, one group for the RGB and 4 groups for the RGBW.

Ok, I understand, thanks for the clarification.