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


Retrieving QuickApp variables


josjg
 Share

Recommended Posts

I have set a variable for a QuickApp in the web interface. Now I want to retrieve that variable with self:getVariable("varname")

It return nil however. How come? What am I doing wrong?

Link to comment
Share on other sites

There is an issue with QA variables.

You need at least one time to set variable using self:setVAriable("varname","value")

after that it will work

Edited by cag014
Link to comment
Share on other sites

36 minutes ago, cag014 said:

There is an issue with QA variables.

You need at least one time to set variable using self:setVAriable("varname","value")

after that it will work

 

never saw that "bug", can't replicate. Can you give me example? Empty QA, with 

Please login or register to see this code.

directly in init work. No isses as well when i use it in on button clicked.

 

Link to comment
Share on other sites

42 minutes ago, tinman said:

 

never saw that "bug", can't replicate. Can you give me example? Empty QA, with 

Please login or register to see this code.

directly in init work. No isses as well when i use it in on button clicked.

 

Create  a new QA variable using UI.

Go to QA:init and try to getVariable (the new one). You'll receive nil

it very rear, but it happened to me...

Edited by cag014
Link to comment
Share on other sites

41 minutes ago, cag014 said:

it very rear, but it happened to me...

 

it's just you, not a bug. Just wait till green box is gone ...

Link to comment
Share on other sites

3 minutes ago, tinman said:

it's just you, not a bug. Just wait till green box is gone ...

Green box? When you define and save new variable, QA executed automatically (It doesn't wait for any green box).

Edited by cag014
Link to comment
Share on other sites

1 hour ago, cag014 said:

Green box? When you define and save new variable,

 

and right here the message Comes, if not, you have another problem (or maybe we talk at cross purposes?)

 

Quote

QA executed automatically (It doesn't wait for any green box).

 

when you wrote your Code and saved it - sure, will get executed, when you have not added the variable yet, sure Nil will be there, when you go to variables and add - and click on save - and green popus confirms it - Code will get executed and variable value will get displayed.

 

Edited by tinman
Link to comment
Share on other sites

  • Topic Author
  • Strangely enough it works now! The thing that might have happened is that I had to do a reboot due to the whole system being hung. After the reboot the variables worked. Same bug that @cag014  had on occasions?

    Anyhow, thanks for your responses. I am new to Fibaro and just received my HC3 a little over a week ago...

    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
    Reply to this topic...

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