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

[HC3] QA options in select


Question

Posted

Hi,

 

i saw the new select in th QA and in the options you can set the name and its value

how can i know the value from the select bar.

 

thx

7 answers to this question

Recommended Posts

  • 0
Posted (edited)

 I think the name to the left and value are locked toghter and the value is used to refer to that selection. corect me if I am wrong! :D 

I got this somewhere on the forum to get to know how it works: 

image.png.b5f2c5bdebf16e3ae81b8ed41a1aa355.png

 

function QuickApp:myDropdownHandler(args, ON)
  self:debug("My selected item is: " .. args["values"][1])
if (args["values"][1] == "ON") then
self:debug("ON!!")
 
elseif (args["values"][1] == "OFF") then
self:debug("OFF!!")
 
else
self:debug("error!!")
end
end

 

Hope it helps :) It helped me to understand how it works

 

 

 

 

 

 

 

 

Edited by Brors94
  • Like 1
  • 0
  • Inquirer
  • Posted

    thx!

    args was the thing i seek.

     

     

    • Like 1
    • 0
  • Inquirer
  • Posted

    Works great when pressed. Then you get values. But is there a way to get standard de values of de select option you pick lick variables in the tab infront of the QA.

    self:getValiable("var")

     

    i want to set lightvalues that comes from the option.

     

    thx

    • 0
    Posted
    2 hours ago, Kage said:

    Works great when pressed. Then you get values. But is there a way to get standard de values of de select option you pick lick variables in the tab infront of the QA.

    self:getValiable("var")

     

    i want to set lightvalues that comes from the option.

     

    thx

    You want to map select options to your quickAppVariables?  I'm not sure I understand your question - can you elaborate a bit?

    • 0
  • Inquirer
  • Posted

     

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    • 0
    Posted

    So you want to read the selected value without the user having selected (when you get a callback with args[]) ?

    No, there seems to be no way to get the selected item like that.

    I recommend that when the QA starts it sets the initial select value and also stores it in a quickAppVariable or global variable.

    Then whenever the user selects something you update the stored value.

    This way you can anytime read the current selected item.

    • 0
  • Inquirer
  • Posted

    Oke thx for feedback. Thats what i also thought. 

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