Developer Information

All of this goes in a driver for a device that will connect to telnet. You open the connection this way:

telnetConnect(String ip, int port, String username, String password)

or

telnetConnect(Map options, String ip, int port, String username, String password)

Only option is "termChars" which changes what the termination character is.

Then, to send/receive messages:

def sendMsg(String msg) {
	return new hubitat.device.HubAction(msg, hubitat.device.Protocol.TELNET)
}

and

def parse(String msg) {
// process incoming telnet messages
}

And, finally,

telnetClose()

Enjoy, and remember, always use telnet responsibly! :sunglasses:

5 Likes