The "new" Milight IBox and milight binding

Thank you! night mode is earned!

The information took here:
https://github.com/davidgraeff/openhab2-addons/blob/milight_ibox_v6/addons/binding/org.openhab.binding.milight/README.md

For rgbwLed/rgbwwLed bulbs these channels are supported:

**nightMode           Dims your bulbs to a very low level to use them as a night light**
ledwhitemode        Disable all color (saturation is 0)
ledbrightness       Controls the brightness of your bulbs
ledsaturation       Controls the saturation of your bulbs (not for rgbwLed!)
colorTemperature    Changes from cold white to warm white and vice versa (not for rgbwLed!)
ledcolor            Changes the color and brightness of your rgb bulbs when bound to a colorpicker
                    or just the brightness if bound to a Dimmer or controls On/Off if bound to a switch.
animation_mode      Changes the animation mode. Chose between animation mode 1 to 9.
animation_mode_relative   Changes the animation mode. Use an IncreaseDecrease type of widget.
animation_speed_relative  Changes the speed of your chosen animation mode
ledlink             Sync bulb to this zone within 3 seconds of light bulb socket power on
ledunlink           Clear bulb from this zone within 3 seconds of light bulb socket power on

Well done !
When will the new binding officially be released?

David, here are some tests using rc11 with rgbww lights. All works well with the paper ui and habpanel, usually ok with the basic ui. However, the Android app accessing the same configuration setup, headless rp3 openhabian, has variable results. The logs basically show that openhab is getting the commands but not always acting on them, particularly when the app is used with “normal speed” click and drag gestures.

Hope this helps you

Paper ui and switch light on using brightness switch

15:38:57.542 [INFO ] [marthome.event.ItemStateChangedEvent] - milight_rgbwwLed_F0FE6B16A14A_2_ledcolor changed from 180,100,0 to 180,100,100
click on colour wheel
15:40:36.824 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 180,100,100 to 122,78,100

Paper ui click and drag on colour wheel

15:42:09.282 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 122,78,100 to 232,75,100
15:42:09.578 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 213,58,100
15:42:09.587 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 232,75,100 to 213,58,100
15:42:09.867 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 156,58,100
15:42:09.872 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 213,58,100 to 156,58,100

paper ui click and drag again

15:43:31.706 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 279,61,100
15:43:31.714 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 156,58,100 to 279,61,100
15:43:31.995 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 254,22,100
15:43:32.000 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 279,61,100 to 254,22,100
15:43:32.294 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 63,51,100
15:43:32.301 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 254,22,100 to 63,51,100
15:43:32.596 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 42,96,100
15:43:32.599 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 63,51,100 to 42,96,100
15:43:32.901 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 24,4,100
15:43:32.907 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 42,96,100 to 24,4,100
15:43:33.194 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 3,97,100
15:43:33.211 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 24,4,100 to 3,97,100
15:43:33.495 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 3,97,100

Start using Android app to turn light off and then back on

15:47:52.618 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'TestSwitch' received command OFF
15:47:52.632 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 3,97,100 to 3,97,0
15:47:52.638 [INFO ] [marthome.event.ItemStateChangedEvent] - TestSwitch changed from ON to OFF
15:47:52.642 [INFO ] [marthome.event.ItemStateChangedEvent] - milight_rgbwwLed_F0FE6B16A14A_2_ledcolor changed from 180,100,100 to 3,97,0
15:48:01.292 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'TestSwitch' received command ON
15:48:01.302 [INFO ] [marthome.event.ItemStateChangedEvent] - TestSwitch changed from OFF to ON
15:48:01.305 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 3,97,0 to 3,97,100
15:48:01.309 [INFO ] [marthome.event.ItemStateChangedEvent] - milight_rgbwwLed_F0FE6B16A14A_2_ledcolor changed from 3,97,0 to 3,97,100

several clicks on Android colour wheel (going slowly to be able to see and collect log info

15:49:35.167 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 67.01613,97.254906,100.0
15:49:35.181 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 3,97,100 to 67.01613,97.254906,100.0
15:49:35.167 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 67.01613,97.254906,100.0
15:49:35.181 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 3,97,100 to 67.01613,97.254906,100.0
15:50:42.975 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 207.82257,97.254906,100.0
15:50:42.987 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 145.8871,97.254906,100.0 to 207.82257,97.254906,100.0
15:50:44.796 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 207.58064,48.627453,100.0
15:50:44.802 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 207.82257,97.254906,100.0 to 207.58064,48.627453,100.0
15:50:45.970 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 207.90698,48.314606,34.901962
15:50:45.984 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 207.58064,48.627453,100.0 to 207.90698,48.314606,34.901962
15:50:45.988 [INFO ] [marthome.event.ItemStateChangedEvent] - Brightness changed from 100 to 34
15:50:45.992 [INFO ] [marthome.event.ItemStateChangedEvent] - milight_rgbwwLed_F0FE6B16A14A_2_ledbrightness changed from 100 to 34
15:50:47.844 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 207.90698,48.314606,34.901962
15:50:51.507 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 207.90698,48.314606,34.901962
15:50:53.201 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 313.9535,48.314606,34.901962

Click on Android colour ring, no colour change to light

15:54:06.155 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 313.9535,48.314606,34.901962

Click on Android saturation bar inside colour ring

15:55:41.032 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 314.5946,83.146065,34.901962
15:55:41.041 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 313.9535,48.314606,34.901962 to 314.5946,83.146065,34.901962

Click on Android brightness bar inside colour ring

15:56:49.525 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 315.0,82.97873,73.725494
15:56:49.544 [INFO ] [marthome.event.ItemStateChangedEvent] - Brightness changed from 34 to 73
15:56:49.555 [INFO ] [marthome.event.ItemStateChangedEvent] - RGBWWLight changed from 314.5946,83.146065,34.901962 to 315.0,82.97873,73.725494

3 separate clicks on Android colour ring and each bar at realistic user speed, no changes to light

15:57:59.330 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 315.0,82.97873,73.725494
15:58:03.509 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 315.0,82.97873,73.725494
15:58:05.775 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'RGBWWLight' received command 315.0,82.97873,73.725494

After restarting my VM with debian and openhab2, one of my milight lights is always ON in paper UI. But the light is not really on. Probably a bug?

You mean it is even on after trying to change its state?

Before restarting the vm, everything is off. Light and switch.
After restart, light is off but switch shows on.

Because I can’t really request the states of the bulbs from the bridge, it is just a cached last state that is returned to OH. There is either a bug in the framework or that cached value gets updated to on for some reason. Are there any debug outputs after the VM restart?

How can i provide you these information?

Upload to gdrive and link here or pastebin.com etc ^^ there is an openhab.log and events.log in the user directory of your oh installation.

https://drive.google.com/drive/folders/0B6OIshlK92GRaENmbGpiUHNDdTQ?usp=sharing

Rebooted the vm close to log upload.

EDIT(17.03.2017): Probably i found another issue. After rebooting my vm, i have to manually switch on my bulb over paper ui before i’m able to use it via alexa.

Is this binding already officially out? Cannot find any update someware.

Thanks for al the hard work!!

This version is part of the current snapshot release.

RC11 gives me these ERROR Messages all the time.

2017-03-27 19:17:43.548 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:17:53.549 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:18:03.460 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:18:03.550 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:18:13.552 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:18:23.567 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:18:33.563 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:18:43.565 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:18:53.576 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:19:03.546 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:19:13.565 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:19:23.566 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:19:33.567 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:19:43.568 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:19:53.549 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:20:03.554 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:20:13.566 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:20:23.566 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:20:33.566 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok
2017-03-27 19:20:43.563 [ERROR] [ht.internal.protocol.MilightDiscover] - Unexpected data received +ok

Everything seems to work correctly though


The addon is quite fault tolerant to the bridge responses, but reports any unexpected. Maybe you are using a newer firmware which sends messages, that older versions didn’t. I don’t have time atm to look into this unfortunately.

Cheers, David

Thanks David for your great work.
My v6 bridge works perfectly.
The connection breaks are still there:

==> /opt/openhab2/userdata/logs/openhab.log <==
2017-03-30 05:13:14.662 [ERROR] [nal.protocol.MilightV6SessionManager] - Command not confirmed: 15
2017-03-30 05:13:14.662 [ERROR] [nal.protocol.MilightV6SessionManager] - Command not confirmed: 16
2017-03-30 05:13:17.682 [ERROR] [nal.protocol.MilightV6SessionManager] - Session registration aborted by timeout timer!

2017-03-27 17:58:27.973 [hingStatusInfoChangedEvent] - ‘milight:bridgeV3:ACCF236D3F2C’ changed from ONLINE to OFFLINE
2017-03-27 17:58:27.973 [hingStatusInfoChangedEvent] - ‘milight:whiteLed:ACCF236D3F2C:0’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2017-03-27 17:58:27.973 [hingStatusInfoChangedEvent] - ‘milight:whiteLed:ACCF236D3F2C:1’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2017-03-27 17:58:27.974 [hingStatusInfoChangedEvent] - ‘milight:whiteLed:ACCF236D3F2C:4’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2017-03-27 17:58:27.974 [hingStatusInfoChangedEvent] - ‘milight:whiteLed:ACCF236D3F2C:2’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2017-03-27 17:58:27.974 [hingStatusInfoChangedEvent] - ‘milight:whiteLed:ACCF236D3F2C:3’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2017-03-27 17:58:27.974 [hingStatusInfoChangedEvent] - ‘milight:rgbLed:ACCF236D3F2C:0’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2017-03-27 17:58:27.974 [hingStatusInfoChangedEvent] - ‘milight:rgbLed:ACCF236D3F2C:1’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2017-03-27 17:58:27.975 [hingStatusInfoChangedEvent] - ‘milight:rgbLed:ACCF236D3F2C:4’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2017-03-27 17:58:27.975 [hingStatusInfoChangedEvent] - ‘milight:rgbLed:ACCF236D3F2C:2’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2017-03-27 17:58:27.975 [hingStatusInfoChangedEvent] - ‘milight:rgbLed:ACCF236D3F2C:3’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2017-03-27 17:58:28.979 [ItemStateChangedEvent ] - D25_ke_Pir changed from 1 to 0
2017-03-27 17:58:29.022 [ItemStateChangedEvent ] - D25_ku_DS_Temp1 changed from 25.50 to 25.44
2017-03-27 17:58:29.368 [ItemStateChangedEvent ] - ESP_32_DS_Temp changed from 28.56 to 28.62
2017-03-27 17:58:29.626 [hingStatusInfoChangedEvent] - ‘milight:whiteLed:ACCF236D3F2C:0’ changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2017-03-27 17:58:29.626 [hingStatusInfoChangedEvent] - ‘milight:whiteLed:ACCF236D3F2C:1’ changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2017-03-27 17:58:29.627 [hingStatusInfoChangedEvent] - ‘milight:bridgeV3:ACCF236D3F2C’ changed from OFFLINE to ONLINE
2017-03-27 17:58:29.627 [hingStatusInfoChangedEvent] - ‘milight:whiteLed:ACCF236D3F2C:4’ changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2017-03-27 17:58:29.627 [hingStatusInfoChangedEvent] - ‘milight:whiteLed:ACCF236D3F2C:2’ changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2017-03-27 17:58:29.628 [hingStatusInfoChangedEvent] - ‘milight:whiteLed:ACCF236D3F2C:3’ changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2017-03-27 17:58:29.628 [hingStatusInfoChangedEvent] - ‘milight:rgbLed:ACCF236D3F2C:0’ changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2017-03-27 17:58:29.628 [hingStatusInfoChangedEvent] - ‘milight:rgbLed:ACCF236D3F2C:1’ changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2017-03-27 17:58:29.629 [hingStatusInfoChangedEvent] - ‘milight:rgbLed:ACCF236D3F2C:4’ changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2017-03-27 17:58:29.629 [hingStatusInfoChangedEvent] - ‘milight:rgbLed:ACCF236D3F2C:2’ changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2017-03-27 17:58:29.629 [hingStatusInfoChangedEvent] - ‘milight:rgbLed:ACCF236D3F2C:3’ changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

@hexakopter: Yes, somebody pointed this out in the initial merge request as well. How it works is basically, I establish a session with the bridge and use this session for all commands. A periodic keep alive is send and the bridge confirms this.

  • If two confirmations in a row are missed (bad network), a new session is established.
  • If the session becomes invalid, maybe because a session invalidates after a time, a new session is established as well.

The device goes offline during the session handshake. It would be helpful to know if the session becomes invalid periodically.

Two solutions I can think of:

  • Wait for more then just two missed confirmations.
  • Reestablish a new session every 24 hours or similar.

Thanks, David

Hello David,

This happens every 2 to 3 minutes. If the milight box is offline, you can not turn on lamps at this time.
I switch many milight lamps over a Pir. They now work quite unreliably.

I had previously only v3 bridges with the old v1.8 binding. They always worked.
Then i got a v6 bridge and I installed the v2.0 binding.

Now I often stand in the dark. :slight_smile:

Greetings Peter

I make the keep alive interval adjustable, at the moment it should be every 5 sec. Maybe a value of 2 sec works better for you.

Cheers, David

Thank you David.

I’m still waiting for the Jenkins build. Nothing is going on at the moment.
Greeting Peter

Hi,

So this build is the one that i would get when installing via PaperUI or do i need to add the JAR to the addons folder in my openhab installation?

Also. Does this binding work with a ibox and the old RGBW lights? Its not listed that it does in the Readme on the github page.