Interface Data

Posted on
Mon Jun 17, 2019 1:59 pm
Mark offline
User avatar
Posts: 126
Joined: Apr 21, 2005
Location: California

Interface Data

In AppleScript, I could get at the following for the Interface (for a emailed status report Indigo generates):

Online: Yes
Enabled: Yes
Type: PowerLinc 2413U


Can Python provide that info?

Posted on
Mon Jun 17, 2019 2:17 pm
matt (support) offline
Site Admin
User avatar
Posts: 19291
Joined: Jan 27, 2003
Location: Texas

Re: Interface Data

Almost, but not quiet. You can get the enabled+online state for all 3 native interface types like so:

Code: Select all
insteonIsWorking = indigo.insteon.isEnabled()
x10IsWorking = indigo.x10.isEnabled()
zwaveIsWorking = indigo.zwave.isEnabled()

I believe if those return true the interface is both enabled and communication with the interface is working. There isn't currently a way to get the interface name, but I've added that to my ToDo list.

Image

Posted on
Mon Jun 17, 2019 8:44 pm
Mark offline
User avatar
Posts: 126
Joined: Apr 21, 2005
Location: California

Re: Interface Data

Thanks Matt. Enabled was the main thing I was after...

I posted another Python question elsewhere, but no answer yet. Maybe you could have a look?

viewtopic.php?f=7&t=2162&p=178607#p178614

I have to admit, the AppleScript to Python conversion is not quite as bad as I was anticipating. Your documentation and examples are helping a lot. I'm not yet sure how I'm going to replicate all the inter-application communication I've come to rely on. I think if I can figure out how to send cURLs to the Indigo server, I'll be able to replicate a lot of what I've been doing (executing Action Groups from other apps). I'll ask about how to do that in another post... (I think it's something to do with "Restful" something or other, yes?)

Posted on
Mon Jun 17, 2019 11:58 pm
howartp offline
Posts: 3660
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Interface Data

Yes.

https://wiki.indigodomo.com/doku.php?id ... stful_urls


Sent from my iPhone using Tapatalk Pro

Posted on
Tue Jun 18, 2019 9:53 am
Mark offline
User avatar
Posts: 126
Joined: Apr 21, 2005
Location: California

Re: Interface Data

Thanks howartp!

I'd already been to that page, but I got stumped on the URL and port number. Using "http://127.0.0.1:8176/devices/" in a browser threw an error.

It's not the web server's address, right ('cause I know that URL)? I have "Enable remote Indigo client access" checked, but not "Override Indigo Server port number:" The port number in the associated field, though greyed-out, is 1176. I am overriding the Web server port number, but that shouldn't matter, I think. And I don't use Prism Reflector, so that's not enabled.

Is there Python I can use to return the servers's address? And the port?

Posted on
Tue Jun 18, 2019 10:10 am
Mark offline
User avatar
Posts: 126
Joined: Apr 21, 2005
Location: California

Re: Interface Data

Scratch that. I just figured it out. It is the web server address with my custom port number. Cool. All kinds of possibilities... :wink:

Posted on
Tue Jun 18, 2019 10:31 am
jay (support) offline
Site Admin
User avatar
Posts: 15676
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Interface Data

There are a lot of options for integrating AppleScript with Indigo (post direct AppleScript deprecation). I personally would go down that list in order as a preference: convert completely to Python, execute AppleScript from Python, use the RESTful API, try the Indigo Control AppleScript. The only reason why I'd do the control script last is because it's somewhat inefficient since it starts up an IPH for each command which is somewhat slow.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Jun 18, 2019 10:47 am
Mark offline
User avatar
Posts: 126
Joined: Apr 21, 2005
Location: California

Re: Interface Data

Thanks Jay.

My goal is to completely eliminate AppleScript, at least from Home Automation. I see the writing on the wall (Apple's). They've done a p-poor job of implementing and documenting AppleScript throughout the years, even in their own apps. And it really is a shame. It's one of the main things that sets Mac OS apart from others, and is something I rely on heavily throughout my workflow (personal and business).

The new Mojave security measures are really playing havoc with my scripts and AppleScript apps. It's probably just a matter of time before Apple dumps it altogether. Any company that could abandon MagSafe will abandon anything!

I figure it's prudent to start weening myself off of AppleScript, wherever possible.

And to be honest, I've used this opportunity to rid my HA of all but the essential. It was great fun implementing all I could get it to do, over the years, but the reality is, I got carried away, and should limit my system to doing what I really need it to do, not what I can get it to do. For example, do I really need thousands of lines of code to automate and run my whole-house audio, or can I get by with turning on my amps and using Apple's iPhone app "Remote" to run iTunes. Apple has broken iTunes AppleScript support so many times, I've spent more time fixing code than listening to music!! Less is more... :)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests