eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
866 stars 782 forks source link

[LIFX] Add support for MultiZone Light Control #2663

Closed wborn closed 7 years ago

wborn commented 7 years ago

The new LIFX protocol adds MultiZone Light Control functionality. This way you can change the color and color temperature per zone. The protocol allows for controlling at most 256 zones.

The LIFX Z is the first light to support this new functionality. Each strip has 8 zones consisting of 6 LEDs. At most 10 strips can be chained. Some LIFX Z lights may thus have up to 80 uniquely addressable zones.

In the current implementation the LIFX Binding always changes the color and color temperature of all zones. It would be nice if the binding also supports changing individual zones.

Creating a new colormzlight thing type for this is logical. But what would be the best way to support so many channels? Perhaps using a channel group for both color and temperature that does not show up in the UI (i.e advanced="true")? Can the channels groups be easily updated when strips are added/removed?

In the worst case, when some day a light is introduced that does have the maximum of 256 zones, there would be 256 color channels and 256 color temperature channels for a single light.

Another option could be to create an action that changes individual zones.

What are your thoughts on this matter @kaikreuzer, @kgoderis ?

kgoderis commented 7 years ago

The new LIFX protocol adds MultiZone Light Control functionality

ok, I have catch up with this during the xmas break then. In the short term I have no clue what this is all about, but cfr the question on the channels, do the LIFX lights report how many zones they operate? if so, and if reported, you could use dynamically created channels to support each color/temp combo. I presume that the number of zones on a light is not something which is user settable? e.g. it is a fixed number linked to the type of bulb?

I am not sure you would want to create a new thing type of this. Maybe just a bunch of additional channels will do. Beware that you can not combine channel groups and channels on a Thing, so grouping would be out of the window on the existing Thing Types...

wborn commented 7 years ago

I have catch up with this during the xmas break then

With the LIFX Z the number of zones is fixed depending on how many strips you have chained. After you add/remove a LED strip you press a button on the controller to do a zone count. The whole process is shown in this support video.

In the LIFX App zones function a bit like a group of lights. When you apply a theme to a LED strip, it colors each LED strip zone in a different color (like with a group of lights). Also you can drag colors to a virtual LED strip so you can "paint" each zone in a chosen color.

do the LIFX lights report how many zones they operate?

There are some messages like StateZone that can be used to determine the number of zones. So in the support video it would initially return 8 (only one strip) and after the zone count with 2 strips it would start returning 16. The color (HSBK) of each zone can be changed independently. This makes sense when you have 10 meter of LED strip. It also allows for nice animated lighting effects. :-)

Beware that you can not combine channel groups and channels on a Thing, so grouping would be out of the window on the existing Thing Types.

OK so that would mean either regular channels when reusing colorlight or a new thing type when using groups. Introducing groups on the existing thing types would not be backwards compatible.

My only concern still is if channels are the way to go. When there are hundreds, people will not use them in a UI. I will most likely only be using them with presets or lighting effect rules. Some kind of action might also suffice.

kaikreuzer commented 7 years ago

You are thinking about channel groups as we would need color and color temperature channels, right? If we'd assume that color temperature does not make much sense, we could go for dynamic advanced color channels for each zone. I don't mind the huge number of channels - after all, such a light strip has so many individual parts to control, so the complexity is in the device, not in our code.

I don't think it would be bad to introduce a new thing type nonetheless. We could offer "special fx" channels on such types, where we could offer what @wborn actions are supposed to do.

wborn commented 7 years ago

You are thinking about channel groups as we would need color and color temperature channels, right?

The reason I thought about groups is because the documentation immediately mentions lots of channels. :-)

Channel Groups Some devices might have a lot of channels.

When groupless channels can also be dynamic and advanced, I think it would be more consistent to use groupless channels for all LIFX thing types.

We could offer "special fx" channels on such types

Do you mean like what the Hue binding has? Are there also other bindings that have these including user customization of the effects? An effect could also have a separate channel with a user customizable channel configuration. That would allow for the same kind of effect customization as the LIFX app has.

Are there any conventions for channel naming? Most bindings seem to use camel casing but Hue does not. There are really a lot of options to choose from for naming these zone channels. Something short would be nice, because there will be a lot. E.g. colorZ0 , colorZ1 ... .

wborn commented 7 years ago

Obviously this issue can now be closed since #2953 got merged.