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

Hi, I am hoping for some help. I have tried to find somthing to update the device  Category when starting the quickapp the first time.

 

I had a hope for somthing like this commands "userdescription" and "log" and "DeviceRole" :

self:updateProperty("userDescription","Relay for Heatingcable" ) 
self:updateProperty("log", "QA Started")
self:updateProperty("deviceRole", "Other")

 

any1 got a tips for a solution?

 

I have tried things like :

 

self:updateProperty("Category", "Other")
self:updateProperty("devicecategory", "Other")

 

And I do not understand the api post/get/put in the swagger just yet. 
 

but i find this in the swagger: 

Please login or register to see this image.

/monthly_2024_01/image.png.1d3b051115d3e55422d704f408d8eaba.png" />

 

Any 1 got some tips? :D

 

 

 

 

 

 

 

Posted

function setPropertyParam(id, prop, action)

    local data = {
      deviceId = id,
      propertyName = prop,
      value = action      
    }
    api.post("/plugins/updateProperty", data)
end

 

setPropertyParam(dev.id, "categories", "other")

 

something like this i think

  • Topic Author
  • Posted
    55 minutes ago, Kage said:

    function setPropertyParam(id, prop, action)

        local data = {
          deviceId = id,
          propertyName = prop,
          value = action      
        }
        api.post("/plugins/updateProperty", data)
    end

     

    setPropertyParam(dev.id, "categories", "other")

     

    something like this i think

     

     

     

    Thanks for trying to help. But I cant get it to work 😅 

    Posted (edited)

    Hi @Brors94 ,

     

    try with:

    Please login or register to see this code.

     

    Since there can be more than one category set for the device, you need to use curly brackets {}. You can replace "other" with any of the available categories. If you send category that does not exist then nothing will happen. Also you can set more than one category at once just add them inside curly brackets separated by comma. Hope this helps. This solution can also be found in my shared Quick Apps :-) 

    Edited by Sankotronic
    corrected text :-)
    • Thanks 1
  • Topic Author
  • Posted

    Nice :D Thank you @Sankotronic! The solution I was looking for :)  

    I will check them out, It is just that they are to advanced for me to understand 😅

     

     

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