fibaro:getGlobal
fibaro:getGlobalValue
fibaro:getGlobalModificationTime
fibaro:getGlobal(varName)
This function returns two values:
Please note that these return values are of type string. When comparing them with a variable of type number, use tonumber
to convert them first.
-- Get the value and last modification time
-- of the 'isNight' global variable
local
value, modificationTime =
fibaro:getGlobal
(
'isNight'
)
-- In Lua the second return value can be omitted
-- so this also works:
local
value2 =
fibaro:getGlobal
(
'isNight'
)
-- The obtained value can be used to do other things in the scene
if
(value ==
'1'
)
then
fibaro:debug
(
"It's night!"
)
end
fibaro:getGlobalValue
fibaro:getGlobalModificationTime