LIFX Binding, problem with multiple items linked to single channel

I have two items linked to the color channel of a LIFX bulb. One is a Switch item and the other a Color item.

Both work correctly, but when I switch the bulb on with the Switch item two seconds later the Color items value is updated, at this moment the switch toggle in the sitemap turns to the “off” position.

19:48:24.510 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Entry_Light' received command ON
19:48:24.519 [INFO ] [marthome.event.ItemStateChangedEvent] - Entry_Light changed from OFF to ON
19:48:26.736 [INFO ] [marthome.event.ItemStateChangedEvent] - Entry_Light_Colour changed from 47.659420013427734375,17,0 to 47.659420013427734375,17,38

Could there be a solution to this or do I have to live with only using one item, either a switch or a colorpicker?

Or is there plans to implement a State channel into the binding? As I could see this rectifying the issue.

I assume this is because the binding sends an HSB value and thus the Switch item is set to UNDEF (und hence the toggle shows OFF).
The framework currently does not support items being linked, which are not exactly corresponding to the channel type; I would consider this a bug, so feel free to create an issue at https://github.com/eclipse/smarthome/issues for it.

I think we have a very similar problem with the hue binding. The workaround for hue binding is to define only one color item. Then in the sitemap, I can use this item as a switch and a color picker.

Thanks for the reply Kai, this is how I understood the problem too.

Lolodomo, I had a feeling this may have been an issue with the Hue binding also, although I do not have any Hue hardware.
Am i understanding correctly that you have a colorpicker and a switch in the sitemap controlling the single color item? I’ll try linking only one item to the color channel and multiple controls in the sitemap. Thanks.

Thanks Lolodomo but your fix didn’t work for me. I had to resort to using a virtual switch item and a rule to relay it’s commands to the switch item linked to the color channel. The problem with this is that the virtual switch state it is not updated if the lamp is turned on via the colorpicker item, or the LIFX app. Not ideal but much better.

rule "Entry Virutal Switch ON"
when
    Item Entry_Light_Virtual_Switch changed to ON
then
    sendCommand("Entry_Light", "ON")
end

rule "Entry Virutal Switch OFF"
when
    Item Entry_Light_Virtual_Switch changed to OFF
then
    sendCommand("Entry_Light", "OFF")
end

FTR: I have entered https://github.com/eclipse/smarthome/issues/1688 to address this issue.

Thanks Kai, I also raised the issue a few weeks ago https://github.com/eclipse/smarthome/issues/1593

I have also noticed similar behaviour with a switch item on a dimmer channel.

Ah, thanks, I had missed that! Always useful to add a link here for associated issues :slight_smile:

Yeah, sorry, I’m not sure why it didn’t occur to me. I’ll keep that in mind in future, Kai.

Cheers.