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

getValue function


Question

Posted

Hello, fibaro: getValue () asks the device through z-wave instantly or does it obtain the value of a variable stored in HC2?  Thanks.

4 answers to this question

Recommended Posts

  • 0
Posted (edited)
9 hours ago, Enic said:

Hello, fibaro: getValue () asks the device through z-wave instantly or does it obtain the value of a variable stored in HC2?  Thanks.

It asks the device for the current value.

If you wanna use that value, i advice to store the requested value in field of the variable panel : ( I have created a field with the name "LastWattVaatwasser" first and enter a start value of  "1"

For example :

 

Quote

 


 

-- record the value for the next test
fibaro:setGlobal("LastWattVaatwasser", fibaro:getValue(196, "power")) -- record last use of power
end
setTimeout(tempFunc, 60*1000)
end

-- rules below, make sure the scene starts automatically.
if (sourceTrigger["type"] == "autostart") then
tempFunc()
end

 
 

 

 

 

 

Edited by SpaceCompany
  • 0
Posted

I'm sorry, I have to disagree. Devices either report (aka unsolicited report) or you ask them to report by "polling" (global polling, interval polling, manual polling or Lua code to poll).

 

getValue does not poll, it simply returns the last recorded value (it is stored in a database, the database is not visible to the user)...

 

Why are you asking? Is the value returned by getValue not what you expect? That might be normal, it depends on the device and its parameters. For instance, temperature sensors only report if a certain arount of change has occured. This should be in the device's manual, though maybe not very clearly (check parameters).

  • 0
  • Inquirer
  • Posted

    Thanks for answering.
    It was to know if the getValue function could saturate the z-wave network, when programming with lua, being a much better database.

    • 0
    Posted
    3 minutes ago, Enic said:

    It was to know if the getValue function could saturate the z-wave network

    Ah, excellent question. It is safe to use. Other commands, like "turnOn" do send packets to the device, regardless of state. So it is advised to check if you really need to do a "turnOn" before calling that command. Especially in (fast) loops. The more devices you have, the more care you will have to take with "polling" and "reporting" settings.

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