The "new" Milight IBox and milight binding

Changelog:

  • Turn bulb on again if brightness is greater 0 and if it has been turned off by the binding before.
  • Swap RGBW and RGBWW Types, they were each associated to the wrong thing.
  • Change the color mapping, hopefully the picked color of the colorpicker widget is the actual bulb one now

Thanks,
David

@David_Graeff.

At work so canā€™t test, but the RGBW did not come through as different things. I removed and readded the bridge and all bulbs. So, Iā€™m actually not sure how to change to another type. Iā€™ll look at your new build tonight, and it may make more sense. Iā€™ll include a full list of the things that are created, and the auto created items linked to them.

All those changes look promising. so canā€™t wait to give it another shot.

Thanks again.

Duncan

i using the rgbww lights, so far they my hub has been unresponsive with beta 8. As in it will detect but will not come online. It gives a interal server error 500, if Iā€™m read correctly. Tried removing everything and puting it back However, Ive be. I think it might be something up with my setup right. Will have a bit more time to looking into things later on tonight.

I specifically went with these bulbs because the white temp control in white mode. I beleive that bulb and the combining of the white bulb features with the RGB bulbs.

I wish I could be more helpful.

As background I have an iBox with rgbw/ww/cw controller and the following zones:

  1. rgbw/ww/cw light
  2. rgbw/ww/cw lights
  3. dualwhite ES light
  4. dualwhite ES
    I found that other dualwhite bayonet lights would not respond to the rgbw/ww/cw controller so used the Android MiLight app to select the dual white controller and now the app can control these lights. I checked with my supplier and evidently the latest wifi bridge v6 allows 4 zones per remote (yet they are different types of remotes) all wifi bridge versions since v1 have been able to do that for last 3 years. Started with rgb + dualwhite remote, then rgb+rgbw+dualwhite, and now 4 zones each; rgb+rgbw+dualwhite+rgbw/ww/cw.

I have just tried the beta11 jar and get the following in paper UI control
Color (iBox) and the brightness slider changes the light brightness, all other sliders do nothing
Rgbww Color (Zone 1) all sliders do nothing
Rgbww Color (Zone 2) all sliders do nothing
Rgbww Color (Zone 3) brightness slider changes the light brightness, all other sliders do nothing
Rgbww Color (Zone 4) brightness slider changes the light brightness, all other sliders do nothing
Rgbw Color (Zone 1) all sliders do nothing
Rgbw Color (Zone 2) all sliders do nothing
Rgbw Color (Zone 3) all sliders do nothing
Rgbw Color (Zone 3) all sliders do nothing

I am new to openHAB and did look in the logs directory and the openhab.log file has several entries as follows

2017-02-02 20:45:14.563 [INFO ] [.milight.internal.protocol.MilightV6] - Color temperature not supported by iBox led!
2017-02-02 20:45:18.014 [INFO ] [.milight.internal.protocol.MilightV6] - Saturation not supported by iBox led!

Hope this helps!

hey @Andrew_Currie,

thanks for the test report. to summerize: there exists dual white only bulbs on the market which can be partially conteolled by the rgbww thing. the color/white bulbs do not react to commands though.

the colorpicker also did not work for you for the ibox.

did you test the on/off, modes, nightmode as well?

I think of releasing the binding anyway as soon as on/off and brightness works for all bulb types. without a wireshark or tcpdump record I have no ideas which additional commands are necessary to make the color selection working.

thanks,
david

@David_Graeff,

Initial testing of B11. No real change in functionality over B9.

iBox:
Once brightness set to 0, stays off.
Colour is almost reverse on the color scale.

Lights:
I didnā€™t get any additional items discovered. I only have RBGWW lights showing.
No change in functionality.

Iā€™m just doing an upgrade now. And will continue testing some more.

Can you help me with tcpdump settings? Iā€™m not sure where the file is placed by default. Iā€™m using a raspberry pi. Iā€™ve googled, but not really confident still of the best config for tcpdump.

Thanks Duncan

Did some testing tonight. For me I didnā€™t get white mode to trigger on my Ibox, but everything else worked!

I noticed that unplugging the Ibox seems to case the whole system to hang. I have tryied removing and rediscovering, time, but evetually I had to reboot. I triggered the issue 3 between beta 8 and 11. I beleive I saw an error saying

internal server error 500

While first using, my inclination was to start with whitemode which is working well. It seems a bit like there are thresholds that need to be to change modes and values seem to fight each other. Note so far Ive only worked in paperui, Color triggers at half way the first time you trigger it. I can image it not working if you trigger from one direction and have other sliders in other diretions. I had lighting values spikes right off the bat. Nothing broke for me except Whitemode, I know someone else had a different slider go on group one that worked for me. Just a thought, Having two satuations and two brightness does make a difference. but settle to last used which is a nice.

Not using zones 2 to 4 or 1 to 4. No cross talk. Ibox does not get lumped in any group. Nightmode was the only thing not tested. it doesnā€™t have easy bindings. animations trigger and turn off with a change in color. Any particular things you wanted tested. Looking for boxes to enter 0 or do some intentional injecting.

More testing.

Upgrade saw some improvement:

I have the following things:
iBox Bridge
iBox Light
RGBWW All Col
RGBW All Col
RGBWW Zone 1-4
RGBW Zone 1-4
No functionality for any sliders or switchese

iBox:
Brightness ok
Colour ok
I could take to 0 brightness and then resume to higher brightneses.

Next step some tcpdump.

Also of note: All devices are regularly showing a state of offline. Despite this, I can still change the color on my iBox.

EDIT: TCP and UDP seem to both give the same response.
Logs are uploaded: https://drive.google.com/open?id=0B0r7CYNTNqQIOTZyQlFDbmVKX1U

Thanks Duncan

Did some testing tonight. For me I didnā€™t get white mode to trigger on my Ibox, but everything else worked!

I noticed that unplugging the Ibox seems to case the whole system to hang. I have tryied removing and rediscovering, time, but evetually I had to reboot. I triggered the issue 3 between beta 8 and 11.

While first using, stared with whitemode which is working well. Moving on it seems like there are thresholds that need to be to change modes and values seem to fight each other I had lighting values spike. Note so far Ive only worked in paperui, I can image it not working if you trigger from one direction and have other sliders in other diretions.Creating impossible condition somehow. Dont think it create my whitemode issue.

Not using zones 2 to 4 or 1 to 4. No cross talk. Ibox does not get lumped in any group. Nightmode was the only thing not tested. it doesnā€™t have easy bindings, animations trigger and turn off with a change in color. Any particular things you wanted tested. Looking for boxes to enter 0.

there should appear 11 items in the inbox as of beta11. did you doublecheck that beta11 has been loaded by oh2?

thanks for your effort, i will post a ready to use commandline later

Hi,

i bought the Milight iBox2
There are 11 items in the inbox, i can ad the Box but it doesent work (beta an stock addon).
Im using openhab2

Hi David,

Start of the day here and I looked to see if you have an update but get
"site canā€™t be reached" for community.openhab.org

I did some more tests on rgbww zones and could not find any on/off
controls. Also there are nightmode and whitemode channels but they are
grayed out.

If I use the remote control or App first then lights become "unlocked"
and then openHAB controls do the following for all 4 zones and the iBox:

dimmer slider 1 controls yellow/white colour or Kelvin temp

dimmer slider 2 controls brightness

dimmer slider 3 does nothing

brightness slider does the same as dimmer slider 2

Perhaps if I can unlock white mode we can get colour? Any ideas?

Thanks

Andrew

this is what i thought already.

the app is sending a command that i do not know and that is not documented but necessary to ā€œunlockā€.

i think we are stuck for the moment until i have a communication dump. thanks for your testings.

Hey all,

I thought about how to best intercept the communication between the official milight app and the iBox. I wrote a small java application that pretends to be an iBox and proxies all traffic to a real milight bridge.

The source code can be found here:

A ready to use jar file:
milightproxy.jar.pdf (12.6 KB)

Execute it like this: "java -jar milightproxy.jar 192.168.0.20 af d3 a9 5b aa 77 ab"
with the milight iBox IP address as first argument and 2nd to 7th argument being the mac address parts of the iBox.

I have not tested this, because I do not have the app nor the iBox.

The output will be written out to the command window, not to a file. On linux/mac you can redirect the output to a file by appending > filename.txt to the command line arguments.

With the help of the recorded communication, it might be finally possible to finish the binding.

Thanks,
David

Hey David,

Thanks for this and your hard work!

I havenā€™t been able to get on the OpenHab community site for a few days now unfortunately. Not sure why. But I have also been busy, so havenā€™t had much time to test.

I was able to get your jar file working and it picked up commands as evidenced by the output file. However, I then tried to open the file and then re run the file and basically broke the app.

This is the error I am getting "java -jar milightproxy.jar 192.168.1.250 f0 fe 6b 16 8d 2a >milight.txt
java.net.BindException: Address already in use (Bind failed)
at java.net.PlainDatagramSocketImpl.bind0(Native Method)
at java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:93)
at java.net.DatagramSocket.bind(DatagramSocket.java:392)
at java.net.DatagramSocket.(DatagramSocket.java:242)
at java.net.DatagramSocket.(DatagramSocket.java:299)
at java.net.DatagramSocket.(DatagramSocket.java:271)
at testing_delete.Main.(Main.java:101)
at testing_delete.Main.main(Main.java:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)ā€

Any thoughts on how to get it back running so I can send you some results?

Thanks,
John

reboot :smiley: i forgot to set the reuse flag on the socket so it appears the app basically only runs once atm. maybe it helps to kill all java processes already

Ha! Yeah, I ended up googling how to kill a java process in Linux and then rebooted. Got it working before you replied.

Here is the first try. It was a lot shorter than I thoughtā€¦. I had the process running for at least 10 minutes or so and sent about 50-60 commands. So I think it stopped recording or something.

Anyways, here is what I sent and the log back.

Hope this helps! I am going to go back through my emails, so I can download the latest beta since I havenā€™t been able to access the site.

John

milight-command-list.txt.pdf (819 Bytes)

milight.txt.pdf (3.27 KB)

I also ran your test and issued a few commands from the Paper Ui and then several from the Android app to change the iBox light colour and turn it off. Was not able to upload the file (new user) so here it is

EmulatedV6Bridge discover thread ready
Read from bridge thread ready
Read from app thread ready
Received from App: 10 00 00 00 0A 02 C7 C9 11 F0 FE 6B 16 A1 4A
Received from Bridge: 18 00 00 00 40 02 AC CF 23 F5 7A D4 00 20 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64 01 00 01 17 63 00 00 05 00 09 78 6C 69 6E 6B 5F 64 65 76 07 5B CD 15
Received from App: 10 00 00 00 0A 02 C7 C9 11 F0 FE 6B 16 A1 4A
Received from Bridge: 18 00 00 00 40 02 AC CF 23 F5 7A D4 00 20 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64 01 00 01 17 63 00 00 05 00 09 78 6C 69 6E 6B 5F 64 65 76 07 5B CD 15
Received from App: 10 00 00 00 0A 02 C7 C9 11 F0 FE 6B 16 A1 4A
Received from Bridge: 18 00 00 00 40 02 AC CF 23 F5 7A D4 00 20 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64 01 00 01 17 63 00 00 05 00 09 78 6C 69 6E 6B 5F 64 65 76 07 5B CD 15
Received from App: 10 00 00 00 0A 02 C7 C9 11 F0 FE 6B 16 A1 4A
Received from Bridge: 18 00 00 00 40 02 AC CF 23 F5 7A D4 00 20 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64 01 00 01 17 63 00 00 05 00 09 78 6C 69 6E 6B 5F 64 65 76 07 5B CD 15
Received from App: 10 00 00 00 0A 02 C7 C9 11 F0 FE 6B 16 A1 4A
Received from Bridge: 18 00 00 00 40 02 AC CF 23 F5 7A D4 00 20 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64 01 00 01 17 63 00 00 05 00 09 78 6C 69 6E 6B 5F 64 65 76 07 5B CD 15
Received from App: 10 00 00 00 0A 02 C7 C9 11 F0 FE 6B 16 A1 4A
Received from Bridge: 18 00 00 00 40 02 AC CF 23 F5 7A D4 00 20 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64 01 00 01 17 63 00 00 05 00 09 78 6C 69 6E 6B 5F 64 65 76 07 5B CD 15
Received from App: 10 00 00 00 0A 02 C7 C9 11 F0 FE 6B 16 A1 4A
Received from Bridge: 18 00 00 00 40 02 AC CF 23 F5 7A D4 00 20 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64 01 00 01 17 63 00 00 05 00 09 78 6C 69 6E 6B 5F 64 65 76 07 5B CD 15
Received from App: 10 00 00 00 0A 02 C7 C9 11 F0 FE 6B 16 A1 4A
Received from Bridge: 18 00 00 00 40 02 AC CF 23 F5 7A D4 00 20 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64 01 00 01 17 63 00 00 05 00 09 78 6C 69 6E 6B 5F 64 65 76 07 5B CD 15
Received from App: 10 00 00 00 0A 02 C7 C9 11 F0 FE 6B 16 A1 4A
Received from Bridge: 18 00 00 00 40 02 AC CF 23 F5 7A D4 00 20 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64 01 00 01 17 63 00 00 05 00 09 78 6C 69 6E 6B 5F 64 65 76 07 5B CD 15
Received from App: 10 00 00 00 0A 02 C7 C9 11 F0 FE 6B 16 A1 4A
Received from Bridge: 18 00 00 00 40 02 AC CF 23 F5 7A D4 00 20 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64 01 00 01 17 63 00 00 05 00 09 78 6C 69 6E 6B 5F 64 65 76 07 5B CD 15
Received from App: 10 00 00 00 0A 02 C7 C9 11 F0 FE 6B 16 A1 4A
Received from Bridge: 18 00 00 00 40 02 AC CF 23 F5 7A D4 00 20 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64 01 00 01 17 63 00 00 05 00 09 78 6C 69 6E 6B 5F 64 65 76 07 5B CD 15
Received from App: 10 00 00 00 0A 02 C7 C9 11 F0 FE 6B 16 A1 4A
Received from Bridge: 18 00 00 00 40 02 AC CF 23 F5 7A D4 00 20 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64 01 00 01 17 63 00 00 05 00 09 78 6C 69 6E 6B 5F 64 65 76 07 5B CD 15

Hi all,
Hereā€™s my log file. I mainly adjusted the colour of my lights. iBox was working. My RBGW lights were not.

milog.txt.pdf (11.9 KB)

Thanks again.
Duncan

Thank you guys. As I said the tool was untested and indeed it only recorded one type of packets (broadcasts). I will improve and test it locally and post a new variant here soon.

Cheers,
David

1 Like