running a script

85 views
Skip to first unread message

Alberto Stabile

unread,
Dec 4, 2018, 3:38:47 AM12/4/18
to insteon-terminal
Dears, 
  there is a way to running a script via insteon-terminal? I just install terminal and it works very well but I can just only running in interactive mode. There is a way to run a csh or sh or python script directly from the linux shell?

Thanks, 

Daniel Pfrommer

unread,
Dec 4, 2018, 11:40:49 PM12/4/18
to insteon-terminal
At the moment there is no such feature in the main branch, as that was never intended to be used outside of an interactive context.

A while back I started work on a python-only version of the insteon terminal which would allow you to use the terminal utilities as a python library that you can import the standard way.


It's not complete yet, but does have all the send/receive functionality of the old terminal, and allows you to modify the modem link database (it doesn't let you modify the device link database yet though). I hope to have some free time around Christmas to finish this up and get it to feature parity with the old insteon-terminal, so hopefully I will finish this up soon (fingers crossed).

Daniel

Alberto Stabile

unread,
Dec 5, 2018, 3:17:09 AM12/5/18
to Daniel Pfrommer, insteon-terminal
Oh wow, Thank you Daniel for your work. Really yesterday with some tricks. So I have changed your code and using shell env.  I runned some script connecting my insteon device to ha-bridge. Unfortunately, ha-bridge cannot anymore connected to the google home. Hence, I have decided to buy the new version of the hub 2245... :(  Finally, your work is very precious 'cause i can still used it to run some debug and configuration on my domotic network instead of using the stupid insteon gui ;)

--
You received this message because you are subscribed to the Google Groups "insteon-terminal" group.
To unsubscribe from this group and stop receiving emails from it, send an email to insteon-termin...@googlegroups.com.
To post to this group, send email to insteon-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/insteon-terminal/7de83758-2eb2-4294-802b-a45bbc1817e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alberto Stabile

unread,
Dec 5, 2018, 3:17:53 AM12/5/18
to Daniel Pfrommer, insteon-terminal
A curiosity: Do you get this job for free? 

Jay Simons

unread,
Dec 29, 2020, 12:11:37 AM12/29/20
to insteon-terminal
Try this:

#!/usr/bin/expect -f

set timeout 10

set cmd [lindex $argv 0]

spawn bash

expect "*#"
send "cd /usr/src/insteon-terminal\r"
expect "*#"
send "./insteon-terminal\r"
expect ">>>*"
send "$cmd\r"
expect ">>>*" {
        after 1000
        send "\r"
}
send "\r"
expect ">>>*"
puts "CMD_OK\r"
send "quit()\r"
expect "*#"
send "exit\r"
expect eof


Reply all
Reply to author
Forward
0 new messages