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

Problem to multiselect object in QA


Question

Posted

Hi Everybody,

 

Last weeks i was working in a QA that trigger the activities of the harmony logitech hubs in differents rooms. The QA was design to select the differents activities of the harmony hubs and turn ON/OFF the TV´s in differents rooms. But I have a problem when i run the QA  and test in the yubii home apps (version 1.22.1 and version 2.1.0), the select object doesn´t allow me to select more than option (image below attachment). Could someone help me? I don´t know where is the problem. Thanks so much.

 

Please login or register to see this attachment.

 

Please login or register to see this attachment.

16 answers to this question

Recommended Posts

  • 0
Posted

HI, I did a test with multi-select and in the Web GUI it works, and on the Yubii Home app not. So I see the same behaviour.

This looks like a bug in the app, you can report this to FIBARO.

  • 0
  • Inquirer
  • Posted
    On 8/19/2024 at 5:22 AM, Joep said:

    HI, I did a test with multi-select and in the Web GUI it works, and on the Yubii Home app not. So I see the same behaviour.

    This looks like a bug in the app, you can report this to FIBARO.

     

       Hi @Joep Thank you for the response. Yes, the object doesn´t permit select more than an option in the drop down list. I think that is a bug too. I´m going to report this to FIBARO. @m.roszak Could you help us with this problem? Do you think it can be a bug?. 

    Aside from that, @Joep I have seen your blog website and It´s very interesting!!! The more interesting post is the solar data azimuth calculator to use this in blind control scenes. Congrats for your work!!

    • Like 1
    • 0
    Posted

    Hello guys,

    I checked this on both 1.22.1 and 2.1, multi-select works normally:

    Please login or register to see this link.


    Please login or register to see this link.

     

    Are you using android or iOS?

    • 0
  • Inquirer
  • Posted
    3 hours ago, m.roszak said:

    Hello guys,

    I checked this on both 1.22.1 and 2.1, multi-select works normally:

    Please login or register to see this link.


    Please login or register to see this link.

     

    Are you using android or iOS?

     Hi @m.roszak Thank you for the response I have tested with 2.1 version in iOS and android too. The same issue in the two OS. I have tested with the older app "Yubii" too and the same issue. I attachment below the QA if you want to see it but i don´t think that the problem is the LUA code of the QA. Thank you!

     

     

    Please login or register to see this attachment.

    • 0
    Posted (edited)

    Did a test with the beta firmware and the Yubii Home app (iOS app version 2.1.0) and I get the right response. 

     

    Please login or register to see this code.


    Testset:

    Please login or register to see this attachment.


     

     

    So there must be a difference in the approach. 
     

     

    Edited by SmartHomeEddy
    • 0
    Posted (edited)

    For me on an iPhone with iOS 17.6.1 and HC3 with beta firmware 5.161 and Yubii app 2.10 it's not working, see the attached video I made.

     

    I created a Quick App with no options and multi-select on:

    Please login or register to see this image.

    /monthly_2024_08/image.png.3213811eb24b601bb3b8e596ac117992.png" />

     

     

     

    And at the options on initialisation with the following code:

    Please login or register to see this code.

     

     

    Edited by Joep
    Add phone oS
    • Like 1
    • 0
    Posted

    In native dialogs it does not work correctly now, reported to the team a week ago.
    In "old style" webview it's working. 

    • 0
    Posted
    16 hours ago, Herni said:

     Hi @m.roszak Thank you for the response I have tested with 2.1 version in iOS and android too. The same issue in the two OS. I have tested with the older app "Yubii" too and the same issue. I attachment below the QA if you want to see it but i don´t think that the problem is the LUA code of the QA. Thank you!

     

     

    Please login or register to see this attachment.


    Your code clears selection on every action on select by initializing this component every time :) (looks like it, I am not a programmer).

    • 0
  • Inquirer
  • Posted
    3 hours ago, m.roszak said:


    Your code clears selection on every action on select by initializing this component every time :) (looks like it, I am not a programmer).

     Hi @m.roszak Thank for your recommendation. But the "onToggled" method (called "seleccion_TV") I write to take all options selected for the user ang save in "valores" global variable (variable type table). I´m not sure where is the initializing. Could you help me with this point? (I am not programmer too i only know the basic in POO). Perhasp @SmartHomeEddy could we help us in this point. I attachmment below the image of body QA. Thank you so much. 

     

     

    Please login or register to see this attachment.

    • 0
    Posted

    You write about global variables, but your code has self:setVariable() for quickapp variables. 

     

    The "for i,j in pairs(valores) do" will loop through the valores table and each loop it will overwrite the Sel_Valores quickapp variable with the value from that loop. So you will end up with the last loop value in your quickapp variable. 

     

    If you want to write all the values to quickapp variables, you have to write the whole table to one quickapp variable. You probably have to do something with json.encode() / json.decode() to make that work.

     

    If you know how many values (TV's) you want to write, you could also create a quickapp variable for each TV. Maybe a bit more dirty, but is it works, it ain't stupid. :-) 

     

    And a bit in between the two solutions. You could create the all quickapp variables with the "for in pairs() do" loop and update each variable also with "for in pairs() do" loop. 

    • Like 1
    • 0
  • Inquirer
  • Posted
    17 hours ago, SmartHomeEddy said:

    You write about global variables, but your code has self:setVariable() for quickapp variables. 

     

    The "for i,j in pairs(valores) do" will loop through the valores table and each loop it will overwrite the Sel_Valores quickapp variable with the value from that loop. So you will end up with the last loop value in your quickapp variable. 

     

    If you want to write all the values to quickapp variables, you have to write the whole table to one quickapp variable. You probably have to do something with json.encode() / json.decode() to make that work.

     

    If you know how many values (TV's) you want to write, you could also create a quickapp variable for each TV. Maybe a bit more dirty, but is it works, it ain't stupid. :-) 

     

    And a bit in between the two solutions. You could create the all quickapp variables with the "for in pairs() do" loop and update each variable also with "for in pairs() do" loop. 

     

           Hi @SmartHomeEddy Yes, I had a problem with loop for. And I forgot use the json.encode() and json.decode() to convert a table type varible to string and vice versa. I have used this function to create home tables. Thank you for the recommendation. Yesterday, I just remember this and change the code of the QA (I attach it below):

     

    Please login or register to see this attachment.

     

    You can see that the initial error disappear in the image, and I can select multi option in the preview mode. But if I want to save the json.encode(event) string into to "Sel_Valores" QA variable (red arrow in the image), the error appear again and I cannot select more than one option. Perhaps I could resolve this error save the json.encode(event) string into to global variable instead to QA variable. But Why do you think that i cannont save the json.encode(event) into to QA variabla and appear this error?

    Also i can forget of the multioption object and used one QA for each TV in each room. But i think is good give to user one object to turn ON/OFF all TV´s at same time. 

    Thank you so much (and sorry for my level english 😕)

    • 0
  • Inquirer
  • Posted
    18 hours ago, SmartHomeEddy said:

    And a bit in between the two solutions. You could create the all quickapp variables with the "for in pairs() do" loop and update each variable also with "for in pairs() do" loop. 

     

    This is a very good idea too 🙂 . I confess that i like more save all options selected in one QA variable with json.encode(event) function (and use json.decode() function in another methods to obtain the table type variable later) But i don´t how to resolve the error that i mentioned above (in my last post)

    • 0
  • Inquirer
  • Posted
    18 hours ago, SmartHomeEddy said:

    You write about global variables, but your code has self:setVariable() for quickapp variables. 

     

    The "for i,j in pairs(valores) do" will loop through the valores table and each loop it will overwrite the Sel_Valores quickapp variable with the value from that loop. So you will end up with the last loop value in your quickapp variable. 

     

    If you want to write all the values to quickapp variables, you have to write the whole table to one quickapp variable. You probably have to do something with json.encode() / json.decode() to make that work.

     

    If you know how many values (TV's) you want to write, you could also create a quickapp variable for each TV. Maybe a bit more dirty, but is it works, it ain't stupid. :-) 

     

    And a bit in between the two solutions. You could create the all quickapp variables with the "for in pairs() do" loop and update each variable also with "for in pairs() do" loop. 

     

           Yes, sorry. I have a mistake I wanted mention the quickapp variables not global variables. But i mentioned above i could resolve the problem used the global variable too. 🤔

    • 0
  • Inquirer
  • Posted

    Hi @SmartHomeEddy I have decided use to the api.post , api.get, and api.put methods to save the all options selected in the multiselect objetc. Below attach the image of the QA LUA code:

     

    Please login or register to see this attachment.

     

    But now i have anothe problem. When i don´t know how to read each field into "nombre.value" table (the options before selected in the multiselect object) to used inside of QuickApp:ONTV() method. Perhaps you can help me with this problem. Thank you so much. 

     

    • 0
  • Inquirer
  • Posted
    On 8/24/2024 at 11:08 AM, Herni said:

    Hi @SmartHomeEddy I have decided use to the api.post , api.get, and api.put methods to save the all options selected in the multiselect objetc. Below attach the image of the QA LUA code:

     

    Please login or register to see this attachment.

     

    But now i have anothe problem. When i don´t know how to read each field into "nombre.value" table (the options before selected in the multiselect object) to used inside of QuickApp:ONTV() method. Perhaps you can help me with this problem. Thank you so much. 

     

     

             Hello guys, any suggestions? Any help would be greatly appreciated. Thank you.

     

    • 0
  • Inquirer
  • Posted

    Hi guys! @SmartHomeEddy @m.roszak @Joep, i have resolved the issue used REST API HC3 (save in global variable with api.post(), api.put() and api.get()). I attach below the LUA code of QA with the solution. Definitely It was not an bug i had thought.

     

    Please login or register to see this attachment.

     

    And the last issue that i report in my last post also was resolved. I have take off the first and last character of variable.value string to decode the correct table with json.decode function and everything work fine. Thank you very much for help me. 🙂

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