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

Fibaro:get command

fibaro:get()

 

Action :

This command recieves the status of a property from a device. In particular 'value' and 'time last modified'. This function is part of a group of functions.
 these functions only differ in the values they return.

 

Usage and parameters :

fibaro:get(DeviceID, propertyname)

  • DeviceID: The ID of the device of which we need to now the values.
  • propertyname: The name of the property that needs to be questioned.

 

Returned value :

This function returns to values.

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

The values are returned in string format, when u want to convert it to a number you need to use the  tonumber() command.

 

Programming example :

-- Ask the value of 'brighness' of device 11 and tel me when it was last changed.
local value, lastchange = fibaro:get(11, 'brightness');

-- In lua you can also leave out the 2nd variable
-- so this will also work
local value2 = fibaro:get(11, 'brightness');


-- The returned value kan be used to start a task
-- for example, turn of the the device when brightness comes above 50.
if (tonumber(value) > 50) then
   fibaro:call(11,'turnOff')
end 

 

See also

fibaro:getValue()
fibaro:getModificationTime()

 

 
Customer Service Phone

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

 
Adress

Gerstakker 16 5236 VG Empel Netherlands

Google maps