• Professional advice
  • Order before 16.30 uur shipped today
  • Almost always available (+31 73 762 0 762)
  • Monday open late

Fibaro:getSourceTrigger command

fibaro:getSourceTrigger()

 

Action :

Recieves the information about a trigger who has started a scene.
 

Usage and parameters :

fibaro:getSourceTrigger() 

  • There are no parameters transferred.

 

Returned value :

An array with information about what has started the scene. The array will always contain a field name type, depending on the triggerafhankelijk van de trigger een van de volgende waarden heeft.

(property)           : if the scene is started by a scene
(Global)              : If the scene is started by a global variable
(other)                : In other cases (ie when started direct from the app)

Depending on what starts the scene you will recieve an answer

 Property Global Other

 DeviceId which started the scene.

 Property of the DeviceID starting the scene

 Variabele naam.

Name of the variable starting the scene

No extra fields.

 

 

 

 

 

 

Deze functie kan gebruikt worden om te controleren waarom de scene is gestart. In het onderstaande voorbeeld zijn de volgende triggers ingesteld, ieder van de trigger zorgt ervoor dat de scene zal starten:

Programming example :

--[[
%%properties
13 value
15 value

%%globals
isitdarkoutside
--]] 

local trigger = fibaro:getSourceTrigger()
if ( trigger['type'] == 'property')  then
   fibaro:debug(' scene started by device  '..trigger['deviceID'] )
elseif ( trigger['type'] == 'global') then
   fibaro:debug(' scene started by variable  '..trigger['varName'] ) 
elseif ( trigger['type'] == 'other') then 
   fibaro:debug(' scene started by other. ')
end 

 
Customer Service Phone

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

 
Adress

Gerstakker 16 5236 VG Empel Netherlands

Google maps