openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.58k forks source link

[milight] iBox2 integration doesn't work in 8 channel mode #5277

Closed mirkoschubert closed 2 years ago

mirkoschubert commented 5 years ago

It's kind of a bug and a feature request...

Expected Behavior

The Milight iBox2 (API v6) has usually 3 modes: 4, 8 or 99 channels.

I have the 8 channel remote, so I can control up to 8 channels with the app and the remote. For now I have assigned the first 4 channels to the Milight binding like in the documentation. I should be able to control those 4 channels (and more) just as well as in the 4 channel mode.

Current Behavior

But I'm not. Channel 1 and 3 work perfectly. Channel 2 and 4 don't react to my commands in openHAB. The app and remote are working just fine.

The openhab.log reports turning the light on:

[ome.event.ItemCommandEvent] - Item 'Light_CR_Ceiling' received command ON
[nt.ItemStatePredictedEvent] - Light_CR_Ceiling predicted to become ON
[INFO ] [nal.protocol.MilightV6SessionManager] - Confirmation received for unsend command. Sequence number: 1
[INFO ] [nal.protocol.MilightV6SessionManager] - Confirmation received for unsend command. Sequence number: 1

...but the light doesn't turn on. I didn't check yet, but I suspect, that channel 1, 3, 5 and 7 should work, but 2, 4, 6 and 8 will not.

Possible Solution

Before I bought the 8 channel remote, I wrote a node.js command line application to control the lights and simulate a sunset. So I tried it with the remote and got the same problem. Back then I used the node-milight-promises library, so I looked in the code and found out, that there were different functions particularly for the 8 channel mode, because apparently the 8 channel mode uses slightly different byte codes that the 4 channel mode.

So I fixed it in my node app and looked in the Milight binding code if there is anything similar. I don't know Java well, but I think it's not.

Here you can look up the codes for the 8 channel remote, if you want to fix it yourself. I obviously can't.

Steps to Reproduce (for Bugs)

  1. Buy a Milight iBox2, some lightbulbs and a 8 channel remote.
  2. Connect the lightbulbs to the controller on the remote (and the app if you like).
  3. Install the Milight binding and configure it as usual
  4. Switch on one of the lights at a zone with an even number on the remote and openHAB ans see the difference.

Context

See unter Expected behavior!

Your Environment

davidgraeff commented 5 years ago

You want to increase the "zones", I guess? I'll make a PR for this, but I do not have all the required hardware here to test it, so we might need some iterations for it to work.

Caveat: There is a chance that OH 2.4 is too old for .jar file drop ins as we recently changed the buildsystem and openHAB core renamed some classes.

ghost commented 3 years ago

I have tried to integrate my iBox2 v6 into OH3. The bridge and an installed RGBww are online. However, with no feedback on operation. Operation via the Milight app and with a homebridge works fine. A second bridge can also be installed in OH.

After a few days of testing, I replaced the existing 8 channel remote FUT089 with the 4 channel remote FUT092 in the Milight app.

After that, all the functions of 4 channels were given. Does anyone have a solution for the 8 channel control?

Unfortunately, I do not know how to program. Maybe it is possible to integrate the https://github.com/mwittig/node-milight-promise in OH3?

The node works fine with homebridge.

Thanks in advance

openhab-bot commented 3 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/oh3-milight-binding/124602/5

hmerk commented 2 years ago

Closed due to inactivity