Library of Functions


Description


Retrieves the ‘value’ of a global variable registered in the Variables Panel.
 
This is one of a group of functions:
  • fibaro:getGlobal
  • fibaro:getGlobalValue
  • fibaro:getGlobalModificationTime
 
These functions differ only in their return value.

Usage and Arguments


fibaro:getGlobalValue(varName)

  • varName: the name of the global variable

Returned Values


A string containing the current value of the global variable.

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 value of the 'isNight' global variable
local value = fibaro:getGlobalValue('isNight')
 
-- The obtained value can be used to do other things in the scene
if (value == '1') then
  fibaro:debug("It's night!")
end

See Also


fibaro:getGlobal

fibaro:getGlobalModificationTime