fibaro:get
fibaro:getValue
fibaro:getModificationTime
fibaro:get(deviceID, propertyName)
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 'brightness' property of device 11
local
value, modificationTime =
fibaro:get
(11,
'brightness'
)
-- In Lua the second return value can be omitted
-- for this also works:
local
value2 =
fibaro:get
(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
fibaro:getValue
fibaro:getModificationTime