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


HC3 QuickApps coding - tips and tricks


jgab

Recommended Posts

Hi JGAB,

I have finished to modify your QA SVGTest2.fqa with my 4 floors, Temperatures displayed in each room with update every 1.5mn, each lights status On (enlarge red indicator) or Off (small green indicator) for each room with update every 1s.

I want to have the first row of buttons beeing hidden or visible by changing a quickAppVar "Grid"=false or true.

The question is there an attribute in the line

--%%u={{button='raster',text='Grille',onReleased='raster'},{button="sensors", text="Couleurs", onReleased="indicLamp"}}

which can make the buttons visible or hidden (I think the QA needs to restart)?

Do I have to change it with a QA property change?

if it is the case, will code be the same in vscode and HC3 QA?

The reason is that the raster is not needed in a normal running QA but for any change in the number of devices, raster is mandatory to place then on the picture (I spend a full day for doing it with 9+15+16+9 lights and 6+9+12+4 temp sensors) 

Again these changes will have not been possible without fibemu ( Thanks🤩)

Link to comment
Share on other sites

 

23 hours ago, Christb said:

I  want to have the first row of buttons beeing hidden or visible by changing a quickAppVar "Grid"=false or true.

The question is there an attribute in the line

--%%u={{button='raster',text='Grille',onReleased='raster'},{button="sensors", text="Couleurs", onReleased="indicLamp"}}

which can make the buttons visible or hidden (I think the QA needs to restar)

I have found a way to display or not the raster at startup and for each floor change by adding a QuickVar "NoGrid" with value "true" or "false" and launch the "raster" function conditionnaly of "NoGrid" value. Not fair code but it works👍 - for that I have also changed the "self.raster" value to "false" in SVG.lua file.

If you have a better way to do the above I will be happy to learn.

 

Also putting the "--%%u=..."  buttons and slider lines between --[[ ]]-- suppress the buttons and slider lines in the vscode web UI.

 

For the HC3 QA which is now working correctly as well:

I have use the attribute called "visible" but then QA displays blank lines where they were located so I have moved them below the image and suppress "select" line as it is not possible for the slider to hide it.

What is strange is that I have a line in the QuickApp debug window which I think is linked to "self.temps={}":

[06.03.2024] [13:40:01] [TRACE] [QUICKAPP525]: UIEvent: {"values":[2],"deviceId":525,"elementName":"sltc7","eventType":"onToggled"}
[06.03.2024] [13:40:01] [DEBUG] [QUICKAPP525]: Selected floor: 2
[06.03.2024] [13:40:01] [DEBUG] [QUICKAPP525]: createMap indx: 2
[06.03.2024] [13:40:01] [DEBUG] [QUICKAPP525]: createMap indx: 2, curr: 9
[06.03.2024] [13:40:01] [DEBUG] [QUICKAPP525]: custom [luabind::detail::null_type] object: (nil)
[06.03.2024] [13:40:01] [DEBUG] [QUICKAPP525]: No grid

What does mean that line?

Nothing similar in fibemu.

Attached the QA file

 

 

 

 

Please login or register to see this attachment.

Edited by Christb
Change the fqa files due to wrong size of temp values in Yubii applications - now OK
Link to comment
Share on other sites

I have another non expected issue: in the QuickApp variable table I cannot modify the variables the "pen" for opening modification is not displayed

What I need to declare in the code to prevent this? 

 

 

Link to comment
Share on other sites

14 minutes ago, Christb said:

I have another non expected issue: in the QuickApp variable table I cannot modify the variables the "pen" for opening modification is not displayed

What I need to declare in the code to prevent this? 

I have found that if I am creating the QuickVar from the onInit function, then it is impossible to modify it in the QA variable pannel

So I suppressed in the code the 2 lines for the 2 variables that are static and now I can modify them manualy. 😁

I have update the attached fqa file in my previous post

Link to comment
Share on other sites

As I started with your SVGtest.fqa which has been created as a binary switch the Fibaron ON/OFF buttons are there but of no use.

I tried to change its type using the Swagger but all new data are accepted except the type change.

Is this forbiden by Fibaro?

if it is the case then I will have to create a new QA with the type "com.fibaro.deviceController" and reinject all files main, SVG and images.

 

Edited by Christb
Link to comment
Share on other sites

  • Topic Author
  • Posted (edited)
    12 hours ago, Christb said:

    As I started with your SVGtest.fqa which has been created as a binary switch the Fibaron ON/OFF buttons are there but of no use.

    I tried to change its type using the Swagger but all new data are accepted except the type change.

    Is this forbiden by Fibaro?

    if it is the case then I will have to create a new QA with the type "com.fibaro.deviceController" and reinject all files main, SVG and images.

     

    No, you can't change the type of an existing QA. You need to create a new (in fibemu?) with your choice of type...

    Edited by jgab
    • Thanks 1
    Link to comment
    Share on other sites

  • Topic Author
  • 12 hours ago, Christb said:

    I have found that if I am creating the QuickVar from the onInit function, then it is impossible to modify it in the QA variable pannel

    So I suppressed in the code the 2 lines for the 2 variables that are static and now I can modify them manualy. 😁

    I have update the attached fqa file in my previous post

    The short answer is that if you store a value that is not a string you can't edit it.

    • Thanks 2
    Link to comment
    Share on other sites

    4 hours ago, jgab said:

    The short answer is that if you store a value that is not a string you can't edit it.

    It is not the first time I am asking: "Where I can find such specification?"

    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.

    ×
    ×
    • Create New...