Library of Functions


Description


Retrieves the status of a property of a device.  Specifically, the ‘value’.
 
This is one of a group of functions:
  • fibaro:get
  • fibaro:getValue
  • fibaro:getModificationTime
 
These functions differ only in their return value.

Usage and Arguments


fibaro:getValue(deviceID, propertyName)

  • deviceID: the ID of the device being retrieved from
  • propertyName: the name of the property being retrieved

Returned Values


A string containing the current value of the property.
 

Please note that the return value is of type string.  When comparing it with a variable of type number, use tonumber to convert it first.

Examples


-- Get the value of the 'brightness' property of device 11
local value = fibaro:getValue(11, 'brightness')
 
-- The obtained value can be used to do other things in the scene
-- For example, turn off a device when the brightness is above 50
if (tonumber(value) > 50) then
  fibaro:call(142, 'turnOff')
end

See Also


fibaro:get

fibaro:getModificationTime