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

Virtual Device to change Global Variables


LBB
 Share

Question

Hi all,

 

I'm a newbie at this and stuck on something which should probably be simple. I have created a Global Variable "HomeAway" with three values (home), (Away) and (Workweek).

 

I have then created a virtual device so that i can make a button to set this variable. Once done I will use this to manage a range of things in the house like hot water, heating, blinds and lighting. But I just cant get the virtual device to change the variable. I have found plenty about this online but all solutions i read don't work.

 

It seems i need to add code into the virtual device. but what code. The LUA manual says this line should work "fibaro:setGlobal(‘HomeAway’, ‘Home’);" but nothing happens.

Any help greatly appreciated.

 

Please login or register to see this image.

/monthly_2020_02/image.png.7f4ca6814b2d0a3cbdb7a2f4a95ec384.png" />     image.png.d5aae9b1514a9770fdc1835648b18b73.pngimage.png.34468e222c3755db2d8b4bf7f26158e8.png

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

What do you mean by nothing happens? Where you're using this global that you can see nothing happens?

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Hi

    I click on the (Home) button and I do two things to test if the value changes.

    I check in the variables panel if it has changed and i have a scene that should turn on a light if the value changes to "Home") but the value is not changing.

     

    Edited by LBB
    Link to comment
    Share on other sites

    • 0

    Your command looks very weird, I mean what apostrophes you've used for HomeAway variable?

    Please login or register to see this spoiler.

    May I ask you to replace your line by

    Please login or register to see this code.

    Using double-quotes less confusing...

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • You are a legend. Although i had tried this before. I noticed you had no semicolon on the end of the line and that made all of the difference.

    Thank you so much - this has been driving me crazy for a week!! 

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