Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

RGB LUA CALLS setting colours and brightness


Question

Posted

When setting the value for a RGB strip, how is the colour number represented in the call?

i.e fibaro:setValue("122","?")

example colour number shown on RGB colour  properties #0000FF .

 

Also is the brightness and colour represented in this number or are they set separately?

Thanks

6 answers to this question

Recommended Posts

  • 0
Posted

The format is :     

 

fibaro:call(rgbwModul, "setColor", red, green, blue, white); 

fibaro:call(rgbwModul, "turnOn"); 

 

where rgbwModul is your modules ID and the four colours can have a value from 0 to 255. If you only have a RGB led strip, then white should be changed to "0". That is " + 0 + ".

 

  • Like 2
  • Thanks 1
  • 0
Guest winiu
Posted

Please login or register to see this code.

HC2

 

fibaro:call(rgbwModul, "setColor", red, green, blue, white); 

fibaro:call(rgbwModul, "turnOn"); 

HC3 ??? 

 

 

  • 0
Posted

Hi,
the call works fine with numbers, but do we have a chance to "GET", "SAVE", "CALL" the settings?

With fibaro.get i will receive a STRING (ex. 255,40,71,0) this string cannot be used directly to call this colors.

 

Any idea how I can do that?

  • 0
Posted
On 7/17/2020 at 10:48 AM, moltos said:

Hi,
the call works fine with numbers, but do we have a chance to "GET", "SAVE", "CALL" the settings?

With fibaro.get i will receive a STRING (ex. 255,40,71,0) this string cannot be used directly to call this colors.

 

Any idea how I can do that?

I need the same.

Somebody?

  • 0
Posted
function TurnOnLights(GroupName,SetLightOnLevel,rgbColor)
    if SetLightOnLevel == nil then SetLightOnLevel = 99 end
    if rgbColor == nil then rgbColor = '255,255,255,0' end
    for k,i in ipairs(GroupName) do
        if fibaro.getType(i) == "com.fibaro.FGD212" then
            if fibaro.getValue(i, "value") ~= SetLightOnLevel then
                fibaro.call(i, "setValue",SetLightOnLevel)
                --fibaro.sleep(1000)
            end
        elseif fibaro.getType(i) == "com.fibaro.multilevelSwitch" then
            if SetLightOnLevel == 99 then SetLightOnLevel = 100 end
            if fibaro.getValue(i, "value") ~= SetLightOnLevel then
                fibaro.call(i, "setValue",SetLightOnLevel)
                fibaro.call(i, "turnOn")
                --fibaro.sleep(1000)
            end
        elseif fibaro.getType(i) == "com.fibaro.FGRGBW442CC" then
            if SetLightOnLevel == 99 then SetLightOnLevel = 100 end
            if fibaro.getValue(i, "value") ~= SetLightOnLevel then
                fibaro.call(i, "setColor",rgbColor)
                fibaro.call(i, "setValue",SetLightOnLevel)
                print(rgbColor)
                fibaro.call(i, "turnOn")
                --fibaro.sleep(1000)
            end
        else
        --com.fibaro.colorController
            if fibaro.getValue(i, "state") == false then
                fibaro.call(i, "turnOn")
            end
        end
    end
end
 
trying to run this on a zigbee rgb bulb and it does not change the color any idea why?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...