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

Variabel list


Question

Posted

Is there any way to get a list of all variables from a scene? (Lua)

3 answers to this question

Recommended Posts

  • 0
Posted

I'm not sure I understand you question... What are you trying to accomplish?

  • 0
  • Inquirer
  • Posted

    I have multiple sensor countdowns (a sensor sets a variable to for instance 300 when motion is detected), I then have a scene that for each of theese variables counts down the value for each second and when it comes to 0 another variable is set to 1 to be able to trigger scenes on it.

    for instance, i have

    timerGarageLamp

    timerGarageLampTriggered

    timerEntranceLamp

    timerEntranceLampTriggered

    Currently I have to expand my countdown-scene for each new "scene".

    I would like to do this automatically.

    Get a list of all variables, filter out all that starts with timer and not ends with Triggered, and for each variable, count it down. If at 0, set the variable name (+"Triggered" to 1.

    That way I never have to touch that scene.

    -------------------------------

    A quick and dirty example.

    What if I would like to loop through all variables in a scene in order to debug-output their values. Is it possible?

    • 0
    Posted

    I only know of debug.getlocal to enumerate the variables - but "debug" is not available in scenes. Sorry... But for the first part of your question, I think lua tables cleverly used can do the trick.

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