• Professional advice
  • Order before 16.30 uur shipped today
  • Always reachable (+31 73 762 0 762)
  • Monday open late

Fibaro:getGlobal command

fibaro:getGlobal()

 

Action :

Recieves the value and the last time modified from a global variable which are defined in the variable panel.
This function is part of a group of functions:
 The functions only differ in there returned value.

 

Usage and parameters :

fibaro:getGlobal(variabelename)

  • variabelename : The name of the global variable.

 

Returned Value :

This function returns 2 values.

  1. A string with the actual value of the variable and,
  2. a timestamp when the variable was last changed.

De waarden worden teruggeven in tekst-string formaat. wanneer u er een getal van wilt maken dient u het tonumber() commando te gebruiken.

 

Programming example :

-- Request the value of variabable isNight and also get the last modification time
local value, lastchange = fibaro:getGlobal('isNight');

-- in lua you can skip the second value
local value2 = fibaro:getGlobal('isNight');


-- The returned value can be used to perform other tasks

if value == '1'  then
   fibaro:debug('It's night');
end 

 

See also

fibaro:getValue()
fibaro:getGlobalModificationTime()

 

 
Customer Service Phone

+31737620762
mon-fri: 10am-5pm and sat 10am-3pm

 
Adress

Gerstakker 16 5236 VG Empel Netherlands

Google maps