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 controller and Lua


ggoetz56

Question

Hi 

could some explain to me what kind of variable or syntax this command needs

fibaro:call(ID_RGB_CONTROLLER, "setColor", "0", "255", "0", "0") 

 

If i define 

local R_value = 255

fibaro:call(ID_RGB_CONTROLLER, "setColor", R_value, "255", "0", "0") 

 

"R_value" is not defined. The command fails.

I tried character and single numeric, global and local etc. or do i have to use a table for all of the 4 values?

I didn't find an example.

 

Thanks 

Gerhard

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

fibaro:call(1159, "setColor", "0", "0", "0", "0") =off

fibaro:call(1159, "setColor", "255", "0", "0", "0") =R on

fibaro:call(1159, "setColor", "0", "255", "0", "0") =G on

fibaro:call(1159, "setColor", "0", "0", "255", "0") =B on

fibaro:call(1159, "setColor", "0", "0", "0", "255") =W on

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Hi jaras,

    this gives you a hundred lines of programmcode 

    for example

    fibaro:call(1159, "setColor", "255", "255", "0", "0") =Y mens yellow

    fibaro:call(1159, "setColor", "255", "0", "125", "0") = P means pink

     

    so you better store your Data for R,G,B in variables and use

    fibaro:call(1159, "setColor", R, G, B, W)

     

    R= "255"

    B= "125"

    fibaro:call(1159, "setColor", R, G, B, W)

    so the same codeline gives you different colour.

     

    There are different type of variable like string, numeric, tables and so on. I tried every known and failed. So fibaro:call() is a lua-Function created by fibaro you have to know what kind of variable and how formatet the function expects.

     

    Is somebody out there who knows

    Edited by ggoetz56
    Link to comment
    Share on other sites

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