The "new" Milight IBox and milight binding

Thanks for the hard work @David_Graeff!

I deleted the old milight bindings, then first installed the new alpha, ran some tests, then the second.

On both, I got the device discovery fine. It found the iBox fine. Tried to send commands using both alphas (with no result to iBox) and this is the result on the openhab log. I have copy and pasted some relevant info. Seems to be throwing quite a few errors, not sure if it has something to do with my install, or if it is the Alpha.

Any ways, let me know if there is any thing else I can do to help. As you saw, I tried to decrypt the wireless signals the other day, but did not get very far. Could not fully break through the 802.11 encryption to decode the signals.

I did play around with PacketSender though, based on the limitless dev page. I was getting some responses from the iBox, but couldn’t get the commands to work on it. second-alpha.txt.pdf (7.3 KB)
first-alpha.txt.pdf (7.1 KB)

Thank you for your testing. I fixed the particular exception and appended a new version.

Please again have a look at the logs for exceptions.

Hey David,

Thanks for the quick response!

No exceptions this time! However, the log did give some kind of other error.

Saying that the commands were not “confirmed”

Attaching log.

Johnalpha3.txt.pdf (5.2 KB)

To understand your logs better, what is your setup at the moment? Do you use “old” and “new” milights at the same time? Because I see the line:

“ONLINE: V2 compatibility mode” which definitely is not good if you are only using the iBox and no older brigdes.

Thanks,
David

Hey David,

I have the iBox and 2 of the RGBWW bulbs. That is it.

This is the link for the bulbs: https://www.amazon.com/gp/product/B01LPRQ4BK/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1

Thanks,
John

Changelog:

  • Fixed wrong V2 compatibility mode message
  • Fixed handling with the iBox bulb itself

If you set the message level of OH2 to debug, there might be a lot more information about what is going on. Most of the addon messages are printed with the debug level only actually.

Hey David,

Sorry for the delay
 Was struggling to set the Debug level, but I finally got it. Could not get karaf started based on the instructions. Finally figured it out because I was using SSH into my Pi from my main Mac. Turns out it has to be local.

Now that we have that out of the way, here is the latest. Tried to send on/off command to iBox. Here is the result.

alpha5.txt.pdf (9.0 KB)

Thanks for your continued work!

John

Changelog:

  • Check for a valid session before issuing any commands to the bridge
  • Receive session only after the receive thread has been started
  • Fix missing byte for the command byte sequence
  • Use the session register bytes from the examples instead of documentation (they differ, no idea which is correct)

The produced bytes are now exactly like in the documentation/examples. Hopefully this works now.

Thanks,
David

Hey David,

The Openhab log is a lot more active with this build. It appears that it is getting some responses that it is not expecting.

Once again, tried brightness on/off, adjusting brightness and changing color of iBox.

alpha6.txt.pdf (12.7 KB)

If I can do anything more specifically, let me know!

Thanks again,
John

Changelog:

  • Implement all missing functionality (disco mode, speed change, brightness change, white color temperature)
  • Fix receiving the session response packet.

If anybody could also please test if this version still works with older milight bridges, that would be much appreciated.

Thanks,
David

Hi @David_Graeff,

Thanks so much for keeping on at this.

I’m about to test this now. Restarting OH2 and will soon have an update.

Duncan
Update1: MiBox works!! Brightness can be adjusted. Nightmode good.
Not the main yet
 little more testing required to be sure.

Update2: MiBox has stopped responding. No other lights (Zones), nor “All Color” are responding. About to reboot and check.
Logs: https://drive.google.com/open?id=0B0r7CYNTNqQIQUU3ODQzTUpCVzg

Update3: (M)iBox only going to max of about 75% brightness. Unable to adjust color.
Reboot restored control of iBox. Other zones/lights still no change at all for all actions.

David and Duncan,

Finally getting around to testing latest version. We have some action! Like Duncan, it was able to turn on the iBox, adjust brightness and enable NightMode. However, it would not do it consistently. And then I could not get it out of NightMode despite trying to turn off/on NightMode, changing other settings like On/Off, Brightness, color, etc.

After enabling NightMode, it would not respond at all.

As a side note, I also updated OH2 during testing. With the older version, Alpha7 did nothing. After upgrading is when it responded.

I am attaching 3 logs - 1 from before upgrading OH2 (notice there was some kind of exception), 1 from after upgrading OH2 and 1 from after a reboot after the OH2 upgrade.

To make my logs a little easier to read, I also got rid of the NTP binding


Thanks for testing Duncan!

Thanks for your continued hard work David!

John

Edit 1: Forgot to mention that I tried adjusting the RGBWW bulbs using the All Color Zone to no effect. I think that is not the correct zone for these bulbs, but I could be wrong.
alpha7.txt.pdf (16.6 KB)
alpha7-postupdate.txt.pdf (9.6 KB)
alpha7-postupdateandreboot.txt.pdf (12.0 KB)

Thanks for the logs. I could find some problems and made a new version.

Changelog:

  • Implemented keep alive messages according to the protocol documentation. Should fix broken sessions
  • Fixed messages responsible for changing color
  • Be more relaxed with incoming packets and their length

Thanks,
David

Changelog:

  • Change maximum value for brightness. This violates the specification, but the documentation isn’t correct in many places, so I’ll give it a try.

Would be nice if you guys could also test with one of the 1-4 zones. The all color/all white bulbs zone is kind of a special case only.

Thanks,
David

Hey David,

Thanks for the new versions. Skipped 8 and went straight to 9.

We have some control! I added Color Zone 1, which is what my bulbs are linked too. Color Zone 1 and iBox were able to turn off and on very consistently. Color picker did not seem to work whatsoever for either zones. Keep in mind these are RGBWW bulbs, not sure if that means these are technically separate zones than Color 1, or if there are specific RGBWW zones.

On both the iBox and the Zone 1 Color, they reached max brightness around ~38%. From about 40-95%, there is no change. After about 95 and up to 100%, it was almost like they were in NightMode, very low brightness. Speaking of NightMode, could not disable NightMode once it was enabled on either Zone 1 Color or the iBox. The only way I found to disable NightMode, is to turn first toggle NightMode off and then toggle the main on/off via the switcher.

I am attaching logs from some of my testing.

This is serious progress!!! Thanks again David.

John
alpha9.txt.pdf (80.3 KB)

EDIT 1 - I realized just a moment ago, that after I upgraded my OH2 pkg earlier, I forgot to reset DEBUG. So here is new log with debug enabled.

Summary (and some more info post EDIT) - On both Color Zone 1 (RGBWW bulbs) and iBox, color picker does nothing, but Brightness slider in color picker works.
On both, brightness slider works from 0 to ~38%. From ~38-96%, no effect. From 97-100%, dims bulb to same as 0%, practically to NightMode.
Brightness On/Off works pretty darn consistent. It does toggle it back to 100% brightness, but this 100% is like the 35% max bright. Going to a different %, then back to 100, results in same 0% brightness.
NightMode will not disable via switch. Must toggle to Off, then toggle Brightness Off, then On to reset.
Animation seems to work. However, “Idle” does not stop animation (not sure if that is intended result or not)
alpha9-debugset.txt.pdf (30.6 KB)

Thank your for all your work on this. Im still learning this system and working with linux so I am not im not sure how to get useful logs, but I hope I can give some useful information.
Using your alpha version 9. I’m not seeing any change in light over 35 as opposed to 38. I am using RGBwwcw bulbs that I don’t believe are support however. I also notice that some bulbs do not turn off all the way, however they are on at a level under the nightlight setting.

everything is much more stable now. Things do not become unresponsive like they previously did. It’s wonderful how quickly you have been iterating on everythng!

Kassie

Thank you all for the testing reports.

The night mode and white mode is indeed misunderstood by most people. It is not really something you can bind to a on/off switch, it is more like a stateless action that be be performed on the bulbs, but in OH2 we have no widgets for this in the UIs and apps and only recently got support for this in the OH2 core (called “trigger”).

I changed those two functions to be stateful now, but I can only guess what to do, when those modes are switched “off”. With this version I’m doing a simple “set on”. But if I understand @JMacIV correctly, then a “set off”, “set brightness to 0”, “set on” is required to return from this mode?

Changelog:

  • Support saturation
  • Commented and refactored the code for release preparation
  • Try to be even more relaxed regarding to the incoming packets from the iBox.
  • Change maximum brightness back to documented maximum value
  • Turn bulbs off when brightness is set to minimum

Hi @David_Graeff,

Thanks again for another iteration.
I have mixed news

My ibox is doing the following:
Brightness ok
On/off ok
Color - not working
Party - works, but unable to be cancelled

RGB Bulbs:
No responding to any commands at all.
Tried:
Nightmode
On/Off
Colors
Color brightness
Color saturation
Party mode

Not sure what to make of this. Is it just my setup?
Logs: https://drive.google.com/open?id=0B0r7CYNTNqQIQUU3ODQzTUpCVzg

Thanks Again,

Duncan

EDIT: iBox stays responsive for a short period then stops responding to commands. Very intermittent.

Without an actual device and seeing the traffic of the commercial app via wireshark I may not be able to implement that correctly. I have no idea if it is a timing issue, because for sending the color I actually have to send three commands in a row or if the documentation is wrong about the actual commands for colors. I will provide another iteration with a changed timing later.

Cheers, David

Hey David,

I think that we may have gone in reverse with this build. The whole system is less stable.

The On/Off on Color Zone 1 is finicky. It does not work consistently. Sometimes on/off works, others it does not. Sometimes the brightness slider and NightMode are working. On some instances, in order to get control back for one/off, you must enable and disable NightMode before the main ON/Off will work again.

I seemed to have lost all control of the iBox.

On a positive note, the brightness %s seem to be much more accurate!

I will try again with WireShark to see if I can make some headway.

John
alpha10.txt.pdf (71.9 KB)