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

RGBW - Lua call


Question

Posted

Hi,

i try to use the RGBW Module in a Lua Script but i cannot set the Color. i have try it now often but it should not work. Here are my code:

fibaro:call(16, "setColor", "1", "1", "1", "1");

fibaro:sleep(1*1000);

test2 = fibaro:getValue(16, "color")

fibaro:debug(test2);

fibaro:sleep(1*1000);

fibaro:call(16, "turnOff")

if i send this code, the color jumps to 1,1,1,1 --- thats ok

if i send

fibaro:call(16, "setColor", "50", "1", "1", "1");

i get the Color 255,5,5,5 instead of expected 50,1,1,1

whats wrong there? same if i use setW, setR, setG, setB Everthing above 2 let the level of the color jump to 255.

5 answers to this question

Recommended Posts

  • 0
Posted

set brightness lv first later set color because from 0 it's first set color and later turn on on max brightness so it change you color

  • 0
  • Inquirer
  • Posted

    i did not catch it.

    i like to set a color with a specific birgthness.

    fibaro:call(16, "setValue", "35");

    fibaro:sleep(300);

    fibaro:call(16, "setColor", "80", "40", "20", "0");

    with that, my rgb brithness jumps to 100%

    or

    only the white LED have to glow with 10 percent of brightness.

    fibaro:call(16, "setW", "25");

    The only what happens is that the white string jumps to 100%

    could you please give me an example code how to set on the rgb_driver the right color with the brigthness that lower as 100% ?

    I get the same problem if i controll the driver with the webinterface. i can set a value and at first, the value jumps to 100% after that, i can move it to 20%. But if i like to move it now to 30% it jumps again to 100%

    • 0
    Posted

    I am sure there is a better way, but I managed to get around the problem you are having by inserting a sleep:

    Please login or register to see this code.

    • 0
  • Inquirer
  • Posted

    hi amilanov and Fibaro Team

    your solution seems for me like a workaround, i have test it... sometimes it works pretty well, but only sometimes in my cases.

    I have test a little bit more.

    My device in the Fibaro System should have the id16. If i send now a set value to id 17, it also glowing. Then i have try a little bit more. Set Value on id18 was only red, 19 are green and 20... you know it... Blue. I can set all colors from 0-100. 255 should not work. At this way, the devices will be glowing like i want. if i set id 10 to value 10, its only glowing low and dosent jump to 100 %. Are there any more information from Fibaro Team of the real configuration from the Fibaro RGBW device? the shown device looks for me like a virtual device.

    • 0
    Posted

    Agree. It is just a workaround, but it does work every time for me. Did you reduce the wait time to less than 1 second?

    I'd also like to know how to do it properly. Fibaro?

    [ Added: 2014-11-06, 14:25 ]

    I believe the solution is to change the value for each of R, G and B by the percentage dim level you want it to be....

    For example, this sets the colour to white at 100% dim

    Please login or register to see this code.

    To set it to white at 10% dim level, just multiple each value in R, G and B by 10%

    Please login or register to see this code.

    The only thing to consider is that you cannot enter a decimal place, so this would not work:

    Please login or register to see this code.

    To sort this out you should use a round function like this along with variables to store the value of R, G and B

    Please login or register to see this code.

    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...