Library of Functions


Description


Retrieves the status of a property of a device.  Specifically, the ‘time last modified’.
 
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:getModificationTime(deviceID, propertyName)

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

Returned Values


A timestamp of when the property was last modified.
 
Please note that this return value is of type string.  When comparing it with a variable of type number, use tonumber to convert it first.

Examples


-- Get the last modification time of the 'value' property of device 11
local lastModified = fibaro:getModificationTime(11, 'value')
 
-- If it's been at least 10 seconds since the value was last modified
if ((os.time() - lastModified) >= 10) then
  fibaro:debug('It has been 10 seconds or more')
else
  fibaro:debug('It has been less than 10 seconds')
end

See Also


fibaro:get

fibaro:getValue