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

How to use Vairable / Globals


Kage

Question

I am very new with this, if someone can explane, than thanks.

How does it works Variables and Globals,

must you make a Variable in the Panels firts, than make a scene to that variable or.....

Basic what i wanted to do is

make a scene where lights go on if its evening and go out when its day

Have read some on the Forum but i don's get it (YET)

Thanks alot

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Actually this is very simple.

For you this it what you should do:

go to variables panel and make predefined variables. Make new variable named day/night and add value1: day and value2: night.

now you have to make scenes:

scene1: At 23:00(lets say) turn variable daynight to the night status.

scene2: At 9:00 turn variable daynight to the day status.

And when turning on lights then you have to mark something like this: If light is off and daynight is night then and so on.

Also you can add there more options to the variable. You can make daynight variable with 4 options also: morning, day, evening, night.

Give it a try - it is really simple!

Please login or register to see this image.

/emoticons/default_icon_wink.gif" alt=";-)" />

Link to comment
Share on other sites

  • 0

You have 2 kinds of variables, local and global.

Global variables are defined in the variables panel. In the top section you can define numbers. In the bottom section predefined variables, kind of lists like: "on" and "off" or "open", "half open" and "closed" or make a list of numbers 0 to 10. Whatever you need. You have to define them first before you use them. When writing a scene they show up in the variables menu (Lua: Menu left top. In blocks under "Variables")

In a scene you can write a value into a global variable. This variable you can then use in other scenes. I.e. one scene checks if it is day or night and writes the value "day" or "night" into the global variable.

Another scene can then be triggered like:

if global variable is "night" then turn on the lights.

And another scene:

if global variable is "day" then turn off the lights.

See them as little containers that transport values from one house to another.

Local variables can be used only in the scene where they are created. Like:

local variable A = 1

local variable B = A + 5

Other scenes can also have a local variable A, but this is not the same variable A as in the scene above.

So local variables are like containers that stay in the same house.

Good luck

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