WiFi LED Binding self defined colors

Hi tried the WiFi LED Binding today and it works very well!
Changing color, brightness, warm white… everything seems to work.

Things

wifiled:wifiled:testLED "test LED" @ "LED" [ ip="192.168.0.***", port=5577, pollingPeriod=5, protocol="LD382A", driver="CLASSIC", fadeDurationInMs=1000, fadeSteps=100 ]

Now I tried to define some default colors in ths sitemap, but this reacts very strange:

sitemap

Switch   item=Ledtest_color label="colors" mappings=['255,0,0'='Red', '0,0,255'='Blue', '0,255,0'='Green']

log

2018-04-04 23:08:49.108 [ome.event.ItemCommandEvent] - Item 'Ledtest_color' received command 255,0,0
2018-04-04 23:08:49.135 [vent.ItemStateChangedEvent] - Ledtest_color changed from 0,0,0 to 255,0,0
2018-04-04 23:08:53.919 [vent.ItemStateChangedEvent] - Ledtest_color changed from 255,0,0 to 0,0,0

I also defined some ‘effects’:
sitemap:

Switch   item=Ledtest_program label="crossfade" mappings=["45"='Red/Green', "46"='Red/Blue', "47"='Green/Blue']

log (first pressing Red/Blue, then Green/Blue -> leds are first only blue, afterwards only green and brightness is very low)

2018-04-04 23:09:42.055 [ome.event.ItemCommandEvent] - Item 'Ledtest_program' received command 46
2018-04-04 23:09:42.070 [vent.ItemStateChangedEvent] - Ledtest_program changed from 97 to 46
2018-04-04 23:09:45.169 [ome.event.ItemCommandEvent] - Item 'Ledtest_program' received command 47
2018-04-04 23:09:45.183 [vent.ItemStateChangedEvent] - Ledtest_program changed from 46 to 47
2018-04-04 23:09:46.574 [vent.ItemStateChangedEvent] - Ledtest_color changed from 0,0,0 to 120,100,1

Color Items in OH use Hue Saturation Brightness (HSB), not Red Blue Green (RGB) to represent colors. So a fully saturated full brightness ‘Red’ would actually be 0,100,100, ‘Blue’ would be 240,100,100, and green would be 120,100,100.

Note that the first value is a measure of degrees on the color wheel (i.e. can be between 0 and 360), and Saturation and Brightness are percents (i.e. can be between 0 and 100).

https://docs.openhab.org/concepts/items.html#hsbtype

Thanks for the info. Now the solid colors are working perfect!

Any clue regarding the ‘effects’, not so important, because I will probably never use them, but I prefer that everything just works :slight_smile:
Cheched other effect codes too, but never realy starts an effect…

// Programs
// 37 = Seven color crossfade
// 48 = Seven color strobe flash
// 56 = Seven color jumping change

// 38 = Red gradual change
// 39 = Green gradual change
// 40 = Blue gradual change
// 41 = Yellow gradual change
// 42 = Cyan gradual change
// 43 = Purple gradual change
// 44 = White gradual change

// 45 = Red/Green crossfade
// 46 = Red/Blue crossfade
// 47 = Green/Blue crossfade

// 49 = Red strobe flash
// 50 = Green strobe flash
// 51 = Blue strobe flash
// 52 = Yellow strobe flash
// 53 = Cyan strobe flash
// 54 = Pruple strobe flash
// 55 = White strobe flash

// 97 = Solid Color

I know nothing about these bulbs or this binding. The HSB part is generic OH stuff.

I would expect that there would be a separate channel for the effects though.

I can’t seem to get brightness to work. I’ve tried connecting a brightness item to the white channel, the white2 channel, and both white and white2, to no avail. How did you accomplish this?

Thanks,
Bruce

Greetings, may I have link of this equipment ?

Hi

I adjust the brightness with the Color object

Switch Ledtest_power “Power” (Light) {channel=“wifiled:wifiled:testLED:power”}
Dimmer Ledtest_white “White” (Light) {channel=“wifiled:wifiled:testLED:white”}
Color Ledtest_color “Color” (Light) {channel=“wifiled:wifiled:testLED:color”}