Running telnet commands possible?

Is it possible to run telnet commands? I am looking to be able to run commands on my PC's as part of automation for example to shutdown my computers.

SSH is more secure but from what I have read HUbitat has no intentions of implementing this secure protocol so I am hoping this is possible with Telnet.

I can install a telnet server on my PC and create a firewall rule to only allow Hubitat IP to connect on Telnet.

Is there any documentation on how to script telnet so that I can shutdown my PC's using automation>

It is possible with IFTTT but that requires internet, Dropbox and a program monitoring the dropbox account. Messy!

Yes, you can use Telnet within a Driver. This is how Hubitat has implemented bidirectional communications with the Lutron bridges.

https://docs.hubitat.com/index.php?title=Telnet_Interface

You can also use Wake On LAN (I.e. magic packet) to wake up hardwired computers, assuming you enable the WOL feature on those computers.

So I need to create a driver? Is there any documentation on this? I am just starting out so I know very little about Hubitat.

I linked the documentation above...

But it says it needs to be done from within a driver. From what I gather I cannot just enter telnet commands into Hubitate somewhere but must actually create a App and driver for the app and have said driver execute the tenet commands?

Does this mean I must create a custom app and create a driver?

I see nothing about how to actually accomplish this. Sending telnet commands as part of an automation.

You do not need to create an App, only a Driver to implement the Telnet support.

Here is an example of a user-written driver that implements the Telnet Capability.

In your simple case, you should implement the “Switch” capability in your driver. This will allow Apps, like Rule Machine, to simply “turn off” the switch in your driver. Within your driver, issue the corresponding Telnet sendMsg() call in the “off()” command. Within the “on()” command you could send a WakeOnLan magic packet.

1 Like

OK thank you. I now know this is way over my head and would probably be better off paying someone to create the driver as I have no development experience nor the time to invest in learning how to program. Is there a place that I could request this to be made for a fee?

Have you looked at eventghost? It can react to switches in hubitat and do lots of things on your windows pc...

in fact I currently have my pcs setup to turn off via this method.

So will this integrate with a solution like Hubitat? If yes how? I currently also have MSP (Managed Services Software) that allows me to shutdown the computer from my phone with an App but I am looking to automate the whole process.

Either from the Hubitat app or tell Alexa to shutdown office and have the following happen:

Turn off printer
Turn off monitors. I have 2 34 inch monitors and they suck up a lot of juice. another 3 monitors for other PC's.
Issue shutdown command to 4 PC's. Wait 5 Minutes.
Would be great to be able to ping IP of PC's and if no response then power off or just wait 5 minutes...
power off plugs that are controlling power to PC's
Shut off power plugs for the 24 port switch and 16 port POE switch.
shutdown.

If I give command to turn on office it brings up all the devices and PC's are set to turn on automatically with power in bios.

yes I believe it can accomplish most of this. It is old but very powerful. It allows you access to command line. It can control sleep and wake on the pcs.

http://www.eventghost.net/

2 Likes