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


Tiny QuickApp Emulator (TQAE)


jgab

Recommended Posts

Thanks for your quick replies.

Do I need to reload the TQAE.lua file from your git site?

I have copied and paste your file in Zero Brane and all ok but it has recreated all 3 new children: see below the error when trying to reuse existing children:

[09.12.2023] [14:37:52] |SYS  |Using config file TQAEconfigs.lua
[09.12.2023] [14:37:52] |SYS  |Created WebAPI at http://192.168.1.39:8976/web
[09.12.2023] [14:37:52] |SYS  |sunrise 08:33, sunset 17:12
[09.12.2023] [14:37:52] |SYS  |Polling HC3 /refreshStates
[09.12.2023] [14:37:53] |SYS  |Proxy: 'TProxy Profile_MGT' found, ID:466
[09.12.2023] [14:37:53] |SYS  |Proxy: Reusing QuickApp proxy
[09.12.2023] [14:37:54] |SYS  |Proxy: Device 466 updated
[09.12.2023] [14:37:54] [DEBUG] [QUICKAPP466]: fibaroExtra v0.961, ©[email protected]
[09.12.2023] [14:37:58] [DEBUG] [QUICKAPP466]: Starting up QA : Profile_MGT - deviceId: 466
[09.12.2023] [14:38:00] [DEBUG] [QUICKAPP466]: Instantiating object  Scenes management
[09.12.2023] [14:38:03] [ERROR] [QUICKAPP466]: loadExistingChildren:modules\QuickApp.lua:76: attempt to index a nil value
[09.12.2023] [14:38:03] [DEBUG] [QUICKAPP466]: Creating device  Scenes management
[09.12.2023] [14:38:05] [DEBUG] [QUICKAPP466]: Instantiating object  Scenes management
[09.12.2023] [14:38:05] [DEBUG] [QUICKAPP466]: Creating device  Climate Zones management
[09.12.2023] [14:38:07] [DEBUG] [QUICKAPP466]: Instantiating object  Climate Zones management
[09.12.2023] [14:38:07] [DEBUG] [QUICKAPP466]: Child ID: 471 Child UID: uid2
[09.12.2023] [14:38:07] [DEBUG] [QUICKAPP466]: Creating device  Alarm Zones management
[09.12.2023] [14:38:09] [DEBUG] [QUICKAPP466]: Instantiating object  Alarm Zones management
[09.12.2023] [14:38:09] [DEBUG] [QUICKAPP466]: Child ID: 472 Child UID: uid3

...
...
[30m[09.12.2023] [14:38:19] [[31;1mDEBUG[0m[30m] [QUICKAPP466]: ----- end fun ClimateZoneChild:GetProfileTable -----
[30m[09.12.2023] [14:38:19] [[31;1mDEBUG[0m[30m] [QUICKAPP466]: ----- End fun ClimatezoneChild:updateUI -----
[30m[09.12.2023] [14:38:19] [[31;1mDEBUG[0m[30m] [QUICKAPP466]: ----- Start fun partitionsChild:updateUI -----
[30m[09.12.2023] [14:38:19] [[31;1mDEBUG[0m[30m] [QUICKAPP466]: partitions Profile: PRESENT, ID: 1
[30m[09.12.2023] [14:38:19] [[31;1mDEBUG[0m[30m] [QUICKAPP466]: ----- End fun partitionsChild:updateUI -----
[30m[09.12.2023] [14:38:19] [[31;1mDEBUG[0m[30m] [QUICKAPP466]: --------fun onInit end -----------

This is not a big deal but I am curious to know why.

Link to comment
Share on other sites

  • Topic Author
  • Maybe you got a new version of QwikAppChild?

    Link to comment
    Share on other sites

    Not I didn't change anything except pasting yor file. 

    In addition to this creation of 3 new children, when I have made some changes and save/run it it has created a forth child, copy of the Partition child using the next HC3 device Id and both are working: I hope that every time I will change a line code it will not create again a new child.

     

    Please login or register to see this image.

    /monthly_2023_12/image.png.f0478104a489046bb058c119b381e066.png" />

     

    In fact I have made some changes into the PartitionChildUI declaration in adding translation variable for Child5:

    local partitionsChildUI =
    {
        {label="Child4",text=Langg[lg].Child4..version},
        {label="Child5",text="===== "..Langg[lg].Child5..", ID ====="},
        {button='Cb14', text=Langg[lg].Cb14txt, onReleased='getProfileTable'},
        {{button='Cb15', text=Langg[lg].Cb15txt, onReleased='ScrollPartitions'}, {button='Cb16', text=Langg[lg].C16txt, onReleased='ScrollActn'}},
        {button='Cb17', text=Langg[lg].Cb17txt, onReleased='valActn'},  
        {button='Cb18', text=Langg[lg].Cb18txt, onReleased='uppHC3'}  
      --{slider='s1', text="...", onChanged='test'}
    }

     

    Is this comming from this change?

     

    Link to comment
    Share on other sites

    I am comming back to the Slider change diffrences between Emulator UI and Proxy UI.

    To have the changes used in another function, I had to write a if condition as below:

    function ClimateZoneChild:slider_changed1(event) --Heat
    print("Slider S1 modified")
    print("Event: "..json.encode(event)) --json.encode(value))
    if type(event)=="table" then
      NewS1value=event.values[1]
    else NewS1value=event
    end

    print("New S1 value: "..NewS1value)
    return NewS1value
    end

    Link to comment
    Share on other sites

    About the creation of duplicated child, I presume that it was comming from the fact that before using your file version I did change some properties of the children: power, one label of each child and also  add min and max values for sliders using the HC3 swagger.

    Now I have found a way to suppress the power properties in the onInit() child declaration.

    I have supressed in HC3 all the previouly created children with the mother QA and launching again the emulator gave with new IDs the mother QA and its 3 children working as expected.

    I was not yet be successful to have the min and max values working in the webUI or Proxy with min/max updateView in the onInit(); I moved the declartions in the function ClimateZonesChild:updateUI(Nom,Index) and it is now taken in account BUT this change as again greated duplicated children:

    Please login or register to see this image.

    /monthly_2023_12/image.png.1d7b820586f666f5c25261fb0553e443.png" />

    the  ZeroBrane Out put is as below:

    [10.12.2023] [10:11:05] |SYS  |Using config file TQAEconfigs.lua
    [10.12.2023] [10:11:05] |SYS  |Created WebAPI at http://192.168.1.39:8976/web
    [10.12.2023] [10:11:05] |SYS  |sunrise 08:34, sunset 17:12
    [10.12.2023] [10:11:05] |SYS  |Polling HC3 /refreshStates
    [10.12.2023] [10:11:06] |SYS  |Proxy: 'TProxy Profile_MGT' found, ID:475
    [10.12.2023] [10:11:06] |SYS  |Proxy: Reusing QuickApp proxy
    [10.12.2023] [10:11:07] |SYS  |Proxy: Device 475 updated[0m
    [10.12.2023] [10:11:07] [DEBUG] [QUICKAPP475]: fibaroExtra v0.961, ©[email protected]
    [10.12.2023] [10:11:09] [DEBUG] [QUICKAPP475]: Starting up QA : Profile_MGT - deviceId: 475
    [10.12.2023] [10:11:16] [DEBUG] [QUICKAPP475]: Instantiating object  Scenes management[0m
    [10.12.2023] [10:11:18] [ERROR] [QUICKAPP475]: loadExistingChildren:modules\QuickApp.lua:76: attempt to index a nil value
    [10.12.2023] [10:11:18] [DEBUG] [QUICKAPP475]: Creating device  Scenes management
    [10.12.2023] [10:11:21] [DEBUG] [QUICKAPP475]: Instantiating object  Scenes management
    [10.12.2023] [10:11:21] [DEBUG] [QUICKAPP475]: Creating device  Climate Zones management
    [10.12.2023] [10:11:24] [DEBUG] [QUICKAPP475]: Instantiating object  Climate Zones management
    [10.12.2023] [10:11:24] [DEBUG] [QUICKAPP475]: Child ID: 480 Child UID: uid2
    [10.12.2023] [10:11:25] [DEBUG] [QUICKAPP475]: Creating device  Alarm Zones management
    [10.12.2023] [10:11:26] [DEBUG] [QUICKAPP475]: Instantiating object  Alarm Zones management
    [10.12.2023] [10:11:26] [DEBUG] [QUICKAPP475]: Child ID: 481 Child UID: uid3

     

    Is ther a way to prevent this?

    Link to comment
    Share on other sites

    Again, I have made minor changes of some texts in the translation table and I got the following in the web/main page:

    Please login or register to see this image.

    /monthly_2023_12/image.png.a9810046fd53985c75bbd831f7d42a18.png" />

    but only 479, 480 and 481 children are working accordingly to the new code. All other work but with different behavior ( maybe using the previous code)

     

    Link to comment
    Share on other sites

  • Topic Author
  • 3 minutes ago, Christb said:

    Again, I have made minor changes of some texts in the translation table and I got the following in the web/main page:

    Please login or register to see this link.

    but only 479, 480 and 481 children are working accordingly to the new code. All other work but with different behavior ( maybe using the previous code)

     

    Are you running with a proxy QA?

    If so, the children are created on the HC3 too? right?

    The QwickApp code should remove all children that are not in the child definition table.

     

    Can you post your code again and I can see if I can reproduce it.

    Link to comment
    Share on other sites

    Yes, %%proxy=true is in the code. Attached the latest code

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • I think I have fixed the slider event error. It's a new version of modules/api.lua

     

    I can't reproduce

    [09.12.2023] [14:38:03] [ERROR] [QUICKAPP466]: loadExistingChildren:modules\QuickApp.lua:76: attempt to index a nil value

     

    but if course, if that happens it will probably create duplicate children.

    The error and code line doesn't really make a lot of sense - but I added an error catch and a log if there is an error. It's

    an updated modules/QuickApp.lua

     

    So, is this a problem on the HC3 (you get the error when you run real on the HC3?) or only the emulator?

     

    Link to comment
    Share on other sites

    Your question: So, is this a problem on the HC3 (you get the error when you run real on the HC3?) or only the emulator?

     

    In HC3 all QA are proxy, I have not yet upload the lua file into the HC3. I am waiting to have corrected all cosmetic issues. So the errors are all coming from the emulator running. 

    I will download your new files and see what happen and let you know.

    Link to comment
    Share on other sites

    • 3 weeks later...

    I am sorry to come back to you so late but I was busy making some changes in the QA Backup Manager developped by Neo Andersson.

    Doing this I think I have found why in using --%%proxy=true, that I have a change in the ID of of the QA: parent or a child: it is when I change UI language from "en" to "fr" or reverse.

    With my QA BAckup Manager, I have now 2 different Ids : one 488 when I Programm in French Language and the secong 493 when English is programmed. 

    Do you have an idea of how for prevent this?

    Attached  files:Main: "Backup_Manager_BC.lua" and "helpers.lua', that need to be loaded to get right functions.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • Well, the way it recognise if there already is a proxy is if there exist an QA with name "TProxy "..device.name

    Try to avoid to set the id explicitly (do you need to set the id?)

    Please login or register to see this code.

    because I think that may confuse it...

     

    There is another undocumented "mode"

    Please login or register to see this code.

    It assumes that you have a fully functional QA installed in the HC3 with id 488.

    TQAE at startup will inject a file into the QA that (when TQAE runs) intercepts all UI calls and onAction calls and some other APIs and redirect them to the QA running in TQAE.

    When TQAE stops it will disable the "interception code" so the QA works as normal.

     

    This "mode" was provided because someone wanted to edit the UI on the HC3 and only debug the code in TQAE.

    Of course when finished one has to move the code from TQAE to the real QA on the HC3.

     

     

     

     

    Link to comment
    Share on other sites

    Thanks, supressing the --%%id=488 line makes TQAE uisng only ID 493 even if  i am doing changes in the language or any self:updateView line.

     

    What is the best way to upload my TQAE files into my HC3: saving it as a fqa file and load it in normal way  or use the button Upload of the web UI?

    Link to comment
    Share on other sites

  • Topic Author
  • 13 hours ago, Christb said:

    Thanks, supressing the --%%id=488 line makes TQAE uisng only ID 493 even if  i am doing changes in the language or any self:updateView line.

    It will use the ID that the proxy on the HC3 has.

     

    13 hours ago, Christb said:

    What is the best way to upload my TQAE files into my HC3: saving it as a fqa file and load it in normal way  or use the button Upload of the web UI?

    Just what is more convenient. There is also a zerobrane plugin, that adds menus to zerobrane. 

    Please login or register to see this link.

    put it in the zerobrane plugin directory.

     

    Link to comment
    Share on other sites

    Sorry, I have not found any plugin directory in Zerobrane but found this file in C:\Users\ASUS\Documents\TQAE-main.tar\TQAE-main\setup and also in C:\.zbstudio\packages.

    How this file is loaded and what are the added menu?

     

    Edited by Christb
    Link to comment
    Share on other sites

  • Topic Author
  • The files are in the TQAE/setup/ directory.

    Put TQAEplugin.lua . HOME/.zbstudio/packages/

    Put codeTemplates.lua and fileDownloads.lua in HOME/.zbstudio/tqae/

    Restart zbstudio.

     

    Unfortnately it doesn't give you the upload command as I thought (it was removed due to various reasons)

    However, there are some file download and template menus.

    A View -> TQAE Emulator that opens the browser UI

    and some help files linked under help...

     

    ...and some editor helps for fibaro functions as you type...

    Link to comment
    Share on other sites

    I have been able to upload into my HC3 my TQAE versions of the backup Manager with no issue: all my tests are positive.

    It has been a little different with my Profile_Mgt v7.0.lua; uploaded did not show any issue with all UIs even for the child Climate Zone which has 2 sliders on the same row.

    1.      What I did not understand is that in the proxy version, the min/max values for the 2 sliders have been taken in account but not in the uploaded QA: I had to add the 4 values using the Swagger.
    (min/max values are not also used in the TQAE webUI but not a big deal).

    2.      Also, in the webUI the values of the sliders are displayed but not in the UI of the uploaded QA child

    TQAE                  HC3 QA

    It is only a problem in the YUBII application as it does not help to know which new value is selected.

    3.      Then I discovered 2 major issues with my code in the uploaded QA:

    3.1   Parent: Module Mgt:

     

    In the TQAE lua file, the function tableExtract (see line 1343) was doing the job in selecting only devices with action giving the following information per module:

     

    ---Index 107

    {"id":448}

    --Index 108

    {"action":{"args":["b4"],"isUIAction":true,"name":"onReleased"},"id":450}

    ---giving the following actionT table structure:

    [{"cle108":{"action":{"isUIAction":true,"args":["b4"],"name":"onReleased"},"id":450}}]

    --#actionT =

    Number of elements in table actionT: 1

     

    But, in the HC3 QA, I am getting all the existing and visible modules with following structure:

    My condition:

                                            if Key[CLE].action then

                          table.insert(actionT,Key)

                          end

    does not work

    module information:

    ---Index 107

    {"action":function: 0xaaaaf6122da0,"id":448}

    ---Index 108

    [{"action":{"args":["b4"],"isUIAction":true,"name":"onReleased"},"id":450}

    --giving the following for the actionT table:

    [{"cle1":{"action":null,"id":29}},{"cle2":{"action":null,"id":30}},{"cle3":{"action":null,"id":31}},{"cle4":{"action":null,"id":32}},{"cle5":{"action":null,"id":34}},{"cle6":{"action":null,"id":35}},{"cle7":{"action":null,"id":36}},{"cle8":{"action":null,"id":37}},{"cle9":{"action":null,"id":47}},

    {"cle101":{"action":null,"id":430}},{"cle102":{"action":null,"id":431}},{"cle103":{"action":null,"id":433}},{"cle104":{"action":null,"id":434}},{"cle105":{"action":null,"id":435}},{"cle106":{"action":null,"id":436}},{"cle107":{"action":null,"id":448}},{"cle108":{"action":{"args":["b4"],"isUIAction":true,"name":"onReleased"},"id":450}},{"cle109":{"action":null,"id":461}},{"cle110":{"action":null,"id":462}},{"cle111":{"action":null,"id":464}},{"cle112":{"action":null,"id":465}}]

    --#actionT =

    Number of elements in table actionT: 112

     

    I have been able to fix this in changing the if condition by

      if type(Key[CLE].action) == “table” then

                          table.insert(actionT,Key)

                          end

    and it is working in both TQAE and uploaded QA.

    Question: why the results in TQAE and HC3 responses are different? It seems that the TQAE is more compliant with the Swagger response. HC3 bug?

     

    3.2   Child: Scene Mgt:

    All OK – working the same way in TQAE and Uploaded QA

    3.3  Child: ClimateZones Mgt:

    I don’t’ think that this last issue is related to uploading the QA in HC3 as it is now present in both TQAE and uploaded QA: see line 689 to 758 function ClimateZoneChild:valProg():

    Only one case does not work anymore: the handMode “Auto” (all others are accepted by HC3):

    For each ClimateZone, there are 2 Modes: “Schedule” and “Manual”

                   For “Manual” Mode, there are 4 types of possible “handModes”               :

    -        “Off” with nothing else,

    -        “Heat” with properties “handSetPointHeating” value,

    -        “Cool” with properties “handSetPointCooling” value,

    -        “Auto” with properties “handSetPointCooling” value and “handSetPointHeating” value

    In the swagger, the structure of the table for a given ClimateZone Id with handMode programmed as “Auto” is:

    {"id":6,"mode":"Manual","properties":{"handSetPointCooling":21,"handSetPointHeating":19,"handMode":"Auto"}}

    When I read from HC3 and update QuickVarr, I thave the following:

    {"id":6,"mode":"Manual","properties":{"handSetPointHeating":19,"handSetPointCooling":21,"handMode":"Auto"}}

    The Swagger is giving:

    {"id":1,"mode":"Manual","properties":{"handMode":"Auto","handSetPointHeating":22,"handSetPointCooling":24}}

    As you can see, only orders in the tables are different but all elements are similar: unfortunately, HC3 using ClimateZoneChild:upLoadHC3() – see lines 760 to 772 - refuses to take it and I get an API error with no more details than below:

    | ERROR|Bad HC3 call: /profiles/1/climateZones/ (501)

    This error is not shown in the debug window of the uploaded QA.

    What is strange is that I have seen it was working few weeks ago, reason why I decided to upload the QA in HC3.

    Could you help me in finding what is wrong?

     

    3.4   Child: Partitions Mgt:

     All OK – working the same way in TQAE and Uploaded QA

    4)  TQAE only Issue, relatively frequent but not related to above issues:

     When a QA is running and I do not activate it for  one hour or more, I have this type of error [26.12.2023][11:41:23]|ERROR|BadAPIcall:modules\api.lua:160:attempttoconcatenateatablevalue(local'id')

    [26.12.2023][11:42:15]|ERROR|BadAPIcall:modules\api.lua:160:attempttoconcatenateatablevalue(local'id')

    [26.12.2023][11:42:45]|ERROR|BadAPIcall:modules\api.lua:160:attempttoconcatenateatablevalue(local'id')

    [26.12.2023][11:57:45]|ERROR|BadAPIcall:modules\api.lua:160:attempttoconcatenateatablevalue(local'id')

    [26.12.2023][11:57:54]|ERROR|BadAPIcall:modules\api.lua:160:attempttoconcatenateatablevalue(local'id')

    If I press any button of the TQAE WebUI, the reaction is OK and I am getting the right result.

    Please login or register to see this image.

    /monthly_2024_01/image.png.11592cc5191efd7ba2effbb4dfd2131e.png" />

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • 3 hours ago, Christb said:

    I have been able to upload into my HC3 my TQAE versions of the backup Manager with no issue: all my tests are positive.

     

    It has been a little different with my Profile_Mgt v7.0.lua; uploaded did not show any issue with all UIs even for the child Climate Zone which has 2 sliders on the same row.

     

    1.      What I did not understand is that in the proxy version, the min/max values for the 2 sliders have been taken in account but not in the uploaded QA: I had to add the 4 values using the Swagger.
    (min/max values are not also used in the TQAE webUI but not a big deal).

     

    2.      Also, in the webUI the values of the sliders are displayed but not in the UI of the uploaded QA child

     

    TQAE                  HC3 QA

     

    It is only a problem in the YUBII application as it does not help to know which new value is selected.

     

    3.      Then I discovered 2 major issues with my code in the uploaded QA:

     

    3.1   Parent: Module Mgt:

     

     

     

    In the TQAE lua file, the function tableExtract (see line 1343) was doing the job in selecting only devices with action giving the following information per module:

     

     

    ---Index 107

    {"id":448}

     

    --Index 108

    {"action":{"args":["b4"],"isUIAction":true,"name":"onReleased"},"id":450}

     

    ---giving the following actionT table structure:

     

    [{"cle108":{"action":{"isUIAction":true,"args":["b4"],"name":"onReleased"},"id":450}}]

     

    --#actionT =

     

    Number of elements in table actionT: 1

     

     

     

    But, in the HC3 QA, I am getting all the existing and visible modules with following structure:

     

    My condition:

     

                                            if Key[CLE].action then

     

                          table.insert(actionT,Key)

     

                          end

     

    does not work

     

    module information:

     

    ---Index 107

    {"action":function: 0xaaaaf6122da0,"id":448}

     

    ---Index 108

    [{"action":{"args":["b4"],"isUIAction":true,"name":"onReleased"},"id":450}

     

    --giving the following for the actionT table:

    [{"cle1":{"action":null,"id":29}},{"cle2":{"action":null,"id":30}},{"cle3":{"action":null,"id":31}},{"cle4":{"action":null,"id":32}},{"cle5":{"action":null,"id":34}},{"cle6":{"action":null,"id":35}},{"cle7":{"action":null,"id":36}},{"cle8":{"action":null,"id":37}},{"cle9":{"action":null,"id":47}},

     

     

    {"cle101":{"action":null,"id":430}},{"cle102":{"action":null,"id":431}},{"cle103":{"action":null,"id":433}},{"cle104":{"action":null,"id":434}},{"cle105":{"action":null,"id":435}},{"cle106":{"action":null,"id":436}},{"cle107":{"action":null,"id":448}},{"cle108":{"action":{"args":["b4"],"isUIAction":true,"name":"onReleased"},"id":450}},{"cle109":{"action":null,"id":461}},{"cle110":{"action":null,"id":462}},{"cle111":{"action":null,"id":464}},{"cle112":{"action":null,"id":465}}]

     

    --#actionT =

     

    Number of elements in table actionT: 112

     

     

     

    I have been able to fix this in changing the if condition by

     

      if type(Key[CLE].action) == “table” then

     

                          table.insert(actionT,Key)

     

                          end

     

    and it is working in both TQAE and uploaded QA.

     

    Question: why the results in TQAE and HC3 responses are different? It seems that the TQAE is more compliant with the Swagger response. HC3 bug?

     

     

     

    3.2   Child: Scene Mgt:

     

    All OK – working the same way in TQAE and Uploaded QA
     

     

    3.3  Child: ClimateZones Mgt:

     

    I don’t’ think that this last issue is related to uploading the QA in HC3 as it is now present in both TQAE and uploaded QA: see line 689 to 758 function ClimateZoneChild:valProg():

     

    Only one case does not work anymore: the handMode “Auto” (all others are accepted by HC3):

     

    For each ClimateZone, there are 2 Modes: “Schedule” and “Manual”

     

                   For “Manual” Mode, there are 4 types of possible “handModes”               :

     

    -        “Off” with nothing else,

     

    -        “Heat” with properties “handSetPointHeating” value,

     

    -        “Cool” with properties “handSetPointCooling” value,

     

    -        “Auto” with properties “handSetPointCooling” value and “handSetPointHeating” value

     

    In the swagger, the structure of the table for a given ClimateZone Id with handMode programmed as “Auto” is:

     

    {"id":6,"mode":"Manual","properties":{"handSetPointCooling":21,"handSetPointHeating":19,"handMode":"Auto"}}

     

    When I read from HC3 and update QuickVarr, I thave the following:

     

    {"id":6,"mode":"Manual","properties":{"handSetPointHeating":19,"handSetPointCooling":21,"handMode":"Auto"}}

     

    The Swagger is giving:

     

    {"id":1,"mode":"Manual","properties":{"handMode":"Auto","handSetPointHeating":22,"handSetPointCooling":24}}

     

    As you can see, only orders in the tables are different but all elements are similar: unfortunately, HC3 using ClimateZoneChild:upLoadHC3() – see lines 760 to 772 - refuses to take it and I get an API error with no more details than below:

     

    | ERROR|Bad HC3 call: /profiles/1/climateZones/ (501)

     

    This error is not shown in the debug window of the uploaded QA.

     

    What is strange is that I have seen it was working few weeks ago, reason why I decided to upload the QA in HC3.

     

    Could you help me in finding what is wrong?

     

     

     

    3.4   Child: Partitions Mgt:

     

     All OK – working the same way in TQAE and Uploaded QA
     

     

    4)  TQAE only Issue, relatively frequent but not related to above issues:

     

     When a QA is running and I do not activate it for  one hour or more, I have this type of error [26.12.2023][11:41:23]|ERROR|BadAPIcall:modules\api.lua:160:attempttoconcatenateatablevalue(local'id')

     

    [26.12.2023][11:42:15]|ERROR|BadAPIcall:modules\api.lua:160:attempttoconcatenateatablevalue(local'id')

     

    [26.12.2023][11:42:45]|ERROR|BadAPIcall:modules\api.lua:160:attempttoconcatenateatablevalue(local'id')

     

    [26.12.2023][11:57:45]|ERROR|BadAPIcall:modules\api.lua:160:attempttoconcatenateatablevalue(local'id')

     

    [26.12.2023][11:57:54]|ERROR|BadAPIcall:modules\api.lua:160:attempttoconcatenateatablevalue(local'id')

     

     

     

    If I press any button of the TQAE WebUI, the reaction is OK and I am getting the right result.

     

    3.1 how do you get the table? Which api are you calling?

     

    3.3 The TQAE "emulations" of climate zone can be faulty.

    Have you looked at fibaroExtra and the fibaro.climateZone functions?

     

    4. Yes I guess there are some time out in the webUI and there are faulty requests. 

     

    Thanks for the report.

    Link to comment
    Share on other sites

    3.1 how do you get the table? Which api are you calling?

    In the onInit() I am reading from HC3 the device tables for each existing profile using:

    api.get("/profiles")).profiles’

    Then it creates a quickVarr called 'tableN="table"..id' for each profile id

    This QuickVarr tableN is read in the function tableExtract()  which has the role of getting device information for which an "action" has been programmed in the "https://hc3-00006080/app/settings/profiles" html page. this function is calle by pressing "b3" button of the parent UI. below the structure of my QuickVarr table for id=1

    table1 = [{"id":29},{"id":30},{"id":31},{"id":32},{"id":34},{"id":35},{"id":36},{"id":37},{"id":47},{"id":48},{"id":49},{"id":50},{"id":52},{"id":53},{"id":54},{"id":55},{"id":57},{"id":58},{"id":59},{"id":60},{"id":72},{"id":73},{"id":74},{"id":75},{"id":77},{"id":78},{"id":79},{"id":80},{"id":94},{"id":116},{"id":178},{"id":179},{"id":181},{"id":182},{"id":184},{"id":185},{"id":187},{"id":188},{"id":192},{"id":193},{"id":195},{"id":196},{"id":198},{"id":199},{"id":201},{"id":202},{"id":303},{"id":304},{"id":305},{"id":306},{"id":308},{"id":309},{"id":310},{"id":311},{"id":313},{"id":314},{"id":315},{"id":316},{"id":317},{"id":318},{"id":319},{"id":320},{"id":322},{"id":324},{"id":326},{"id":327},{"id":329},{"id":330},{"id":338},{"id":339},{"id":340},{"id":341},{"id":343},{"id":344},{"id":346},{"id":347},{"id":353},{"id":360},{"id":361},{"id":363},{"id":364},{"id":368},{"id":369},{"id":370},{"id":371},{"id":372},{"id":373},{"id":374},{"id":375},{"id":378},{"id":386},{"id":388},{"id":389},{"id":410},{"id":411},{"id":413},{"id":414},{"id":416},{"id":427},{"id":428},{"id":430},{"id":431},{"id":433},{"id":434},{"id":435},{"id":436},{"id":448},{"action":{"isUIAction":true,"name":"onReleased","args":["b4"]},"id":450},{"id":461},{"id":462},{"id":464},{"id":465}]

    The HC3 QA corresponding variable is not readable

     

     

    3.3 The TQAE "emulations" of climate zone can be faulty.

    Have you looked at fibaroExtra and the fibaro.climateZone functions?

    - I dont know how to look at fibaroExtra, could you give me more information about the method to do so?

    - Same fo fibaro.climateZone function and is it in HC3 or in TQAE?

     

    I have made additional tests using the Swagger and discoveredthe following:

    A) Using the following data:
    {"id":1,"mode":"Manual","properties":{"handMode":"Auto","handSetPointHeating":23,"handSetPointCooling":20}}
    I am gettin error 400 with following explanation:
    {
      "type": "ERROR",
      "reason": "Parsing error",
      "message": "incorrect distance between handSetPointCooling and handSetPointHeating"
    }
    In fact handSetPointHeating needs to be strictly lower than handSetPointCooling by a minimum of 1°C

    I will add a test in the validation process to insure this condition.


    B) Using the following data that I have copied from the debug window of the TQAE:
    {"id":1,"mode":"Manual","properties":{"handMode":"Auto","handSetPointHeating":20,"handSetPointCooling":23}}
    the Swagger accept this table and change accordingly the HC3 profile web page so the issue is not in the structure of the data I use but in the command api.put
    I have the following error: [15.01.2024] [14:55:13] |ERROR|Bad HC3 call: /profiles/1/climateZones/ (501)

     

    I changed the api.put line with the initial one i.e.:
    api.put("/profiles/"..curr.."/climateZones/"..ZoneId,currClimateZones[dBut])  --V1.8  Normally ZoneId == dBut
    The "Schedule" and "Off", "Heat", "Coll" "manual" modes are still working every time.

     

     Making another test with ClimateZone id 4, it as worked even if the TQAE API error log gave: |ERROR|HC3 call: /plugins/updateView (400)
    data are :{"id":4,"mode":"Manual","properties":{"handMode":"Auto","handSetPointCooling":23,"handSetPointHeating":21}}
    Doing the same with Climate Zone id 6 : {"id":6,"mode":"Manual","properties":{"handMode":"Auto","handSetPointHeating":21,"handSetPointCooling":23}},{"id":7,"mode":"Schedule"}
    update the HC3 Profile page correctly but I still get an api log: ERROR|Bad HC3 call: /plugins/updateView (400)
    Strange...

    Copying the TQAE the lua code into the HC3 QA main window, all climateZones modes are accepted by HC3 if the handSetPointHeating value is lower than handSetPointCooling value by 1.

     

    So I am comming back to my point 2 about slider view:

    Below missing images in my previous post:

    TQAE web view:

    Please login or register to see this image.

    /monthly_2024_01/image.png.b86fb9b9cecea4792b16ef7434d4d3e4.png" />

    HC3 UI view: image.png.ec85523ad3744d2680672abbed8eb789.pngHow I get displayed the value of HC3 slider when cursor is moved like in TQAE?

    Link to comment
    Share on other sites

  • Topic Author
  • fibaroExtra.lua is in the TQAE/lib/fibaroExtra.lua

     

    Can you give me a minimal example the fails?

    Please login or register to see this code.

    works. What is different for you?

    (You are aware that QA variables set in code don't survive a restart of the emulator?)

     

    The slider value is visible when dragging the slider (at least in Safari and Chrome - haven't tried the Yubii app)

    Please login or register to see this image.

    /monthly_2024_01/image.png.b0c15f9537f9ab493c95b5c6acc1e3c1.png" />

    -here the small "27" above the slider handle.

    The normal way to code this things is that you reflect the value in a label too. Sometimes the value you want to display is not 1:1 with the sliders value and can't be expressed by min, max,step...

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