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

Get a devices default parameter value with LUA code


Question

Posted

Hello guys

 

I am qurios about those parameters that i used to get by reading a parameter default value..

So when a  device doesnt have a template and we used to use the read device parameter default value to get what value is actually stored at that parameter...

Can we somehow pull that default value in LUA?

4 answers to this question

Recommended Posts

  • 0
Posted

@Neo Andersson

Hello,

I know it's probably not what you want to hear (clean).

I can think of running an HTTP REST API query on HC3 immediately after including the device and using the GET method in /api/devices/xxxx to retrieve its properties and values.

Or is that the wrong way?

 

eM.

 

  • 0
  • Inquirer
  • Posted

    You dont need to run api request right after the inclusion..it doesn matter when you run it. The problem is that the retrieved JSON object doesnt contain any parameter values if the device is not supported with template. This is my experience.

    When I go and manually set some paramater in WEB UI (using the device's manual) after that this particular parameter shows up in api request, but only after I manually set the parameter.

    Devices parameter table can not be get back if there is no parameter template. At least i could not find any possibility.

    • 0
    Posted

    Ah,.. I never noticed that. I thought that after turning on the device, it would dump everything into the controller. That's why I lived in the idea that then it was enough to extract the json through the api.
    So sorry, wrong way.

    • 0
    Posted

    I also got curious about how to read para values of a device that didnt show the values (no template) 

     

    it seems like if you call this: 

    hub.call(Smartimplant,"setConfiguration",20,1,-1)

     

    You ask atucally get the default value responding on a smartimplant.

    the 20 is not shown in the templae since you can choose the function on paramter 20 in the advanced tab. (and is not shown if the shown template is unchecked either) 

     

    So after 10 sec or more, you can ask the get parameter api call :D and get the default value. 
     

    And i think this will work for most devices since i have never seen any1 support negative value on parms. (if they have negative in templates the number is often actually a high value range like 200-250 that is -1 too -50 or somthing)

     

     

     

     

     

     

     

     

     

     

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