fibaro:getSelfId()
-- 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,
'TCPPort'
)
-- 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."
)