Author Topic: RGB Hex Code  (Read 360 times)

Offline sbham

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
RGB Hex Code
« on: October 29, 2016, 01:19:56 pm »
I am new to the Lau language and I am having some problems getting my RGBW light to work the way I want it. Originally, I used the following lines using the RGB controll plug in:

local device = 38
local color = "##F000000000
luup.call_action("urn:upnp-org:serviceId:RGBController1", "SetColorTarget", {newColorTargetValue = colors}, device)
luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = 1}, device)
luup.call_action("urn:upnp-org:serviceId:RGBController1", "SetColorTarget", {newColorTargetValue = "#FFFF000000", transitionDuration = 100, transitionNbSteps = 30}, device)
 
And this code works, except it goes around counter clockwise around the color wheel as it goes thru the transition step. But what I want is for the transition steps it to go clockwise.

I tried a negative number in the transitionNbSteps part of the last line, but it doesn't seem that it likes that. Am I missing something simple here?

I have also tried to create the Hex code in the program without much luck. I post here as well in case someone sees something I am doing wrong.

local device  = 38
local color = 0xF000000000
local colors = string.format('#', '%X', color)


luup.call_action("urn:upnp-org:serviceId:RGBController1", "SetColorTarget", {newColorTargetValue = colors}, device)
luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = 1}, device)

luup.call_delay( 'add', 100)

while color < FFFF000000 do
   color=color+0x400
   local colors = string.format('#', '%X', color)
   luup.call_action("urn:upnp-org:serviceId:RGBController1", "SetColorTarget", {newColorTargetValue = color}, device)
   luup.call_delay( 'add', 100)
end


Any help would be greatly appreciated!

Offline thistle2015

  • Newbie
  • *
  • Posts: 7
  • Karma: +1/-0
Re: RGB Hex Code
« Reply #1 on: December 31, 2016, 10:12:57 pm »
Hi SBham,
Just wondered if you've had any luck getting your Fibaro RGBW to fade between colours and then repeating. I want to create an "ocean colour scene" for an aquarium which slowly fades between blues and greens. I'm using a Vera Edge Plus and a Fibaro FGRGBWM-441 RGBW Controller.
I've created a scene that kinda works, but it doesn't crossfade between the colours. I'm sure it's got something to do with setrampup times or similar parameters, but I can't find any info on how to configure the options.
I tried your hex code settings but to no avail. I found that the colour only worked with decimal numbers. eg newColorRGBTarget: 0,0,255 for Blue.
I used a schedule trigger of 1 minute which did loop the scene, so I'm nearly there.
I've attached a screen capture from my advanced editor option.
I hope you may be able to help me on this one.
Cheers, Paul

Offline MLabuda

  • Sr. Newbie
  • *
  • Posts: 36
  • Karma: +0/-2
Re: RGB Hex Code
« Reply #2 on: January 02, 2017, 11:20:21 pm »
Take a look at the Fibaro manual for how to configure the parameters:

manuals.fibaro.com/content/manuals/en/FGRGBWM-441/FGRGBWM-441-EN-A-v1.01.pdf

Offline Quixote

  • Full Member
  • ***
  • Posts: 223
  • Karma: +8/-31
Re: RGB Hex Code
« Reply #3 on: February 09, 2017, 10:41:21 pm »
Just wondered if you've had any luck getting your Fibaro RGBW to fade between colours and then repeating. I want to create an "ocean colour scene" for an aquarium which slowly fades between blues and greens.

Hey Paul,
Why don't you save yourself the trouble and just use the built-in "Aurora" animation? I've built an aquarium hood using RGB strips and I find the animation works quite well. The only thing that will not match your specifications is that it uses some purple-ish colors as well. If you install the RGBW plugin, you can run the animation using a script in a scene as well. I think that you may run into trouble with your Zwave network if you use the method you are currently pursuing because each instruction would need to be send over the network, whereas the animation with the plugin is built in to the controller so it won't cause any extra traffic.
« Last Edit: February 09, 2017, 11:28:53 pm by Quixote »
My "Karma" has been modified by 2 or 3 douchebags that didn't like that I criticized the plugin that they worship. I'm not actually a bad person.