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


Recommended Posts

Posted

Hello, i have a HC3 question about variables,

1) Is it possible to get a list of all QA variable's (and global variables / in lua by an api post)?

2) Can i delete variables within a QA (global and QA) by lua commands? 

Posted (edited)
44 minutes ago, Casa Domotica said:

Hello, i have a HC3 question about variables,

1) Is it possible to get a list of all QA variable's (and global variables / in lua by an api post)?

2) Can i delete variables within a QA (global and QA) by lua commands? 

Please login or register to see this code.

The way to delete is to set the value to nil

Edited by jgab
  • Like 2
  • Topic Author
  • Posted (edited)

    Hey Jgab, thanks for the functions, that helps a lot!

    But after using the setQAVariable function with an empty or nil value the variable is stil visible in the list (with blank value).
    I want to remove the variable by lua code (like clicking on the trashcan in the variable list) 

    Edited by Casa Domotica
    • 2 weeks later...
  • Topic Author
  • Posted

    I'm confused, i have tried a lot of different methods for deleting QA variables from LUA (like the trashcan button) but nothing works.

     

    What is wrong with this?
     

        local info = api.delete("/devices/59/properties/quickAppVariables")
        self:trace("info = "..json.encode(info))

    The response is:

    "type":"ERROR","reason":"MISSING_PARAMETER","message":"id: missing required parameter"
    Posted
    7 hours ago, Casa Domotica said:

    I'm confused, i have tried a lot of different methods for deleting QA variables from LUA (like the trashcan button) but nothing works.

     

    What is wrong with this?
     

        local info = api.delete("/devices/59/properties/quickAppVariables")
        self:trace("info = "..json.encode(info))

    The response is:

    "type":"ERROR","reason":"MISSING_PARAMETER","message":"id: missing required parameter"

     

    It's a bit more complicated - including the problem if you try to set the quickAppVariables list to the empty table...

    Please login or register to see this code.

     

    Exactly why api.delete doesn't work we can only speculate.

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