How do you create a telnet based plugin with username/password?

Hi, I’m new to home remote and have not been able to communicate/control with av matrix that uses telnet based protocol. I’ve seen the lutron integration protocol device source, but have not been able to add it to my project so as to see the code. I would really appreciate if someone could post this plugin or some other examples I could use to start off.

You will need to add a TCPClient to your Plugin in order to communicate with your device over a Telnet session. There is a very simple Telnet example in the docs but that doesn’t have username/password support. What I’d recommend doing is looking over the TCPClient examples shared in the Plugins section of the forum. The Lutron Telnet device is not a plugin. That is an official integration which is compiled with native code, not JavaScript. So you won’t be able to review that code. What you’ll likely have to do is connect, wait for the user prompt message, send your username, wait for the password prompt message, send your password. That’s how the Lutron login works anyway. If you are interested, I’d be happy to write the plugin for you. I generally can finish in a day or 2 but I do ask that you pay me for my time. In most cases it is a couple hundred dollars. When I say wait for user prompt, I mean use the “receive()” method to wait for the message.

Here are a few examples you can review.

…here are a few more TCPClient based plugins.

Your connect code will probably look something like this.

You may want to add some conditions to check the data to confirm that it is the user prompt message. In most cases, for Lutron anyway, the 1st message I get from them is usually the login prompt.

function onConnect() {
    tcp.connect("192.168.1.219", 23);
	var data = tcp.receive();
	tcp.send("your_username\r");
	data = tcp.receive();
	tcp.send("your_password\r");
}