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

Store and read from variable


TANE
 Share

Question

Store the value of a device in a variable en set it back again.

When running a RGBW program for alerting the previews settings will be lost.

I'm looking for a method to set this back after the program is finished.

Settings for device 296 W are stored earlier in a global variable.

Running the program en trying to restore the W back…

The script is not doing what i want….

fibaro:call(296, "startProgram", "6")

fibaro:sleep(10*1000);

fibaro:call(296, "turnOff")

fibaro:call(296, "setW", "StatusBuro")

To optimize a bit more

Store all the settings of the device in a variable

run the program.

set them back...

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

TANE, sorry but your code got 2 bugs and is totally not understood for me

Please login or register to see this code.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Andrew,

    Before staring the Program 6 I need to store the Color W status.

    This can be any value from 0-255

    After the program is finished set the value back.

    Link to comment
    Share on other sites

    • 0

    Please login or register to see this code.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Almost there..

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    White is doing nothing at the end..

    looks like the sore white is not working...

    this will display 99

    Please login or register to see this code.

    ??

    Main ID is 296

    Meter is 297

    R=298

    G=299

    B=300

    W=301

    Link to comment
    Share on other sites

    • 0

    mistake in last line (code written from memory)

    Please login or register to see this image.

    /emoticons/default_tongue.png" alt=":P" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20">

    Please login or register to see this code.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Andrew,

    thanks

    White will always set to 99

    even when it's off or the value is 255

    debug is always displaying 99

    Link to comment
    Share on other sites

    • 0

    TANE, brithness is from 0-99

    color is fom 0-255

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • okay...bit it's always 99 even when it's off

    I can multiplay that wit 2.54..this will set to max.

    [ Added: 2013-08-15, 23:15 ]

    Andrew,

    Status of the device 301 is not updated. no matter what done.

    It will be great to have direct access to child the devices in the interfaces..

    The option show child devices is welcome

    I use the RGBW for white led strips..you can connect 4 of the to one device. I like to have direct access to all of them from scenes.

    What i have done to let it work.

    Set the status of the device in a variable when turned on/off

    From the Lua just use the status to set it back.

    Please login or register to see this code.

    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.

     Share

    ×
    ×
    • Create New...