Haalt het ID nummer op van een ‘virtual device’.
Deze functie werkt alleen met virtual devices en zal niet in een scene werken.
Gebruik en Argumenten
fibaro:getSelfId()
- Deze functie heeft geen argumenten
Waarden die teruggeven worden
Deze functie geeft een waarde terug die het ID nummer bevat van een ‘virtual device’.
Voorbeeld
-- Find the number of this virtual device
local thisdevice = fibaro:getSelfId()
-- Use the virtual device number to find the IP address and port specified on the device's configuration page
local ip = fibaro:getValue(thisdevice, 'IPAddress')
local port = fibaro:getValue(thisdevice, 'TCP Port')
--Open up a connection to that port and write a message there
tcpsocket = Net.FTcpSocket(ip, port)
bytes, errorCode = tcpSocket:write("this is written to the TCP port")
