• Professional advice
  • Order before 23.59 uur shipped today (choose Trunkrs)
  • Almost always available (+31 73 762 0 762)
  • Monday open late (odd weeks)

Fibaro:getSelfID command



Action :

Recieves the number of the virtual device from which it has been called.
This function works only from within a virtual device and therefor it will not work with scenes


Usage and parameters :


  • No arguments are beiing past.


Returned value :

A number with the number of the virtual device.


Programming example :

-- Request the number of the virtual device.
local thisdevice = fibaro:getSelfId();

-- Use the variabel to get the IP-adres and port from the device

local ip = fibaro:getValue(ditapparaat, 'IPAdress');
local poort = fibaro:getValue(ditapparaat, 'TCPPort'); 
-- open a connection to the TCP port
tcpSocket = Net.FTcpSocket(ip, poort)
bytes,errorCode =tcpSocket:write("This will be writen to the TCP port")

Customer Service Phone

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


Gerstakker 16 5236 VG Empel Netherlands

Google maps