Struggling with setting Fibaro RGBW from Rule

Apologies… Thought I’d get that out of the way early…

This is on openHab 2.1.0 release version. Using HABmin and Paper UI’s.

I’m trying to get a Rule working to randomly set the colour of a Fibaro RGBW controller… Tried with HABmin blocky interface. But that seems to generate invalid rules. And no random numbers… Sigh… Mixed blocky and script seems to not be supported…

So created the rule by hand. But I’m struggling to understand what exactly I need to send to the colour item in order to get it to change colours…

I’ve tried a var of type HSBType after lots of digging around, but I can’t set the colours… e.g.

LEDColour.green.floatValue = random.nextFloat()

seems to generate the error

2017-12-04 23:43:00.027 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule bar_random: An error occurred during the script execution: index=0, size=0

Any ideas? The docs don’t seem to match reality at the moment with HABmin or Paper UI… And I’m struggling to understand the model of rules in openHAB2…

Maybe this could help:

Hi Sihui

I did see that. And yeah, it was very helpful. But gets me hitting against my problems t the moment where I can’t create more than 1 item of the same type on a ‘thing’. (Separate Thread). So I can’t control the light via the separate RGBW channels, I have to do it via the single Colour picker channel

The bit I seem to be struggling with is creating a new HSBType from RGB values… I’ve seen in the code there’s a fromRGB(R, G, B) call. And have triedat its simplest

LEDColour=new HSBType.fromRGB(40, 20, 255)

but that appears to get the error

2017-12-05 08:32:00.040 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule bar_random: An error occurred during the script execution: null

I think I have it… Syntax errors and a lack of understanding exactly what the parameters are… And what the difference is between postUpdate and sendCommand (The rules generated by blocky (HABmin 2) seem to use postUpdate. and are filled with errors, But the examples all use sendCommand()

hi @travellingkiwi , may you eloborate on the solution to this issue? I too have the same controller . Thanks!