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

Fill a variable with scene block


Question

Posted

Hi all

I would like to fill a variable (with text) using scene blocks !!!!

I would like to fill the last green block on my screen shot but I can't enter any text !!!

Is it possible ?

Second problem... I trigger the scene with a variable.... My condition is to have my variable equal to 1 to launch the scene... but my scene is launched whatever the value of my variable (set to 1 or 0 in an other scene and it works)

What's wrong with comparing variable with integer values !!!

Thanks for your help

David

Please login or register to see this attachment.

4 answers to this question

Recommended Posts

  • 0
Posted

Change the block scene to lua scene and edit from the codes there. If you do not know how, please show us the lua code.

Thanks.

  • 0
Posted

1. To fill variable with text you need to use LUA. But you can also create predefined variable and use block scene to change its value between given states.

2. Scene triggers on every change of triggering variable, then the first condition is checked. So scene triggers always but will be execued only when condition is met.

  • 0
  • Inquirer
  • Posted

    Thanks for your replies

    Too bad for text into variable using blocks

    Please login or register to see this image.

    /emoticons/default_icon_sad.gif" alt=":-(" /> Maybe this could be an improvement in 4.0

    Regarding the condition, my scene is always run whatever the value of my variable (which can be equal to 0 or 1 only)

    Just for information, if in the other scene that fill the variable, I set the variable to 1 without using tonumber function, does it consider the variable as an integer or as a string ??

    Because if in block, it run a comparison to integer whereas the variable contains a string, this could explain why my scene is always ran !!!

    Thanks

    David

    • 0
    Posted

    Global variables are strings, but if you compare them to some value in block they are converted to numbers. Unless they are predefined variables, if it is a case, two strings are compared.

    If you have HC2 i suggest you to convert your block scene to LUA code and check the way it is executed. You can always go back to blocks if you don't hit "Turn on" button.

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