Email rule to automate Indigo applescript- but I need SPEED!

Posted on
Wed May 15, 2013 10:00 am
T-Power offline
User avatar
Posts: 220
Joined: May 10, 2010

Email rule to automate Indigo applescript- but I need SPEED!

Hello Everyone,

I have setup an rule from within the Apple Mail.app.
When an email is received with certain subject it triggers an applescript like turn off lights.
I have set the Apple Mail.app. to check mail every 1 minute which is working fine, but you still have to wait up to a minute.

Is there a faster approach of sending a command to Indigo from a smartphone?
or
Is there a faster approach of sending a command to the Mac to activate an applescript from a smartphone?


T.I.A.

MacMini 2.3 GHz Intel Core i7 16GB DDR3
Indigo Pro 2022.1 macOS Mojave 10.14.6

Posted on
Wed May 15, 2013 11:17 am
jay (support) offline
Site Admin
User avatar
Posts: 18225
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Email rule to automate Indigo applescript- but I need SP

How about the Indigo web server pages?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed May 15, 2013 11:26 am
T-Power offline
User avatar
Posts: 220
Joined: May 10, 2010

Re: Email rule to automate Indigo applescript- but I need SP

Hello Jay, and thanks for the reply.
I was hoping to create a few voice commands on my Android device that would send an email to the Apple Mail.app.
I have used the web server pages to tap on icon to turn on/off device, but I cannot trigger an auto command from there.

Wasn’t sure if I could send a remote shell script to the Mac to trigger an applescript.
I just need a little brain juice to get me up to speed:)

T.I.A.

MacMini 2.3 GHz Intel Core i7 16GB DDR3
Indigo Pro 2022.1 macOS Mojave 10.14.6

Posted on
Wed May 15, 2013 11:36 am
jay (support) offline
Site Admin
User avatar
Posts: 18225
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Email rule to automate Indigo applescript- but I need SP

T-Power wrote:
I have used the web server pages to tap on icon to turn on/off device, but I cannot trigger an auto command from there.


You can execute any action from the IWS web pages - just create an action group that has the actions in it. Then tap the action group in the Actions section of the IWS pages.

T-Power wrote:
Wasn’t sure if I could send a remote shell script to the Mac to trigger an applescript.
I just need a little brain juice to get me up to speed:)


Not sure what you're using on Android to map the voice command to something else, but another option is to use the RESTful API to send the command once you've interpreted the voice command.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed May 15, 2013 11:49 am
T-Power offline
User avatar
Posts: 220
Joined: May 10, 2010

Re: Email rule to automate Indigo applescript- but I need SP

Thanks Jay.

The Indigo RESTful Overview may serve useful!

I'm using these two Android apps.
For the voice control: Utter
[url]https://play.google.com/store/apps/details?id=com.brandall.nutter&feature=nav_result#?t=W251bGwsMSwyLDNd
[/url]

For the task: Tasker
https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm&feature=search_result#?t=W251bGwsMSwxLDEsIm5ldC5kaW5nbGlzY2guYW5kcm9pZC50YXNrZXJtIl0.

MacMini 2.3 GHz Intel Core i7 16GB DDR3
Indigo Pro 2022.1 macOS Mojave 10.14.6

Posted on
Wed May 15, 2013 7:26 pm
T-Power offline
User avatar
Posts: 220
Joined: May 10, 2010

Re: Email rule to automate Indigo applescript- but I need SP

1. Taking Indigo RESTful for a spin. How would I set this in motion:
Code: Select all
curl -X PUT -d isOn=1 http://192.168.2.15:8176/devices/Coffee-Table-Light

Where would I put the above code for testing

2. How would I send a command to Indigo via javascript to turn on/off device?

T.I.A.

MacMini 2.3 GHz Intel Core i7 16GB DDR3
Indigo Pro 2022.1 macOS Mojave 10.14.6

Posted on
Thu May 16, 2013 9:06 am
jay (support) offline
Site Admin
User avatar
Posts: 18225
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Email rule to automate Indigo applescript- but I need SP

T-Power wrote:
1. Taking Indigo RESTful for a spin. How would I set this in motion:
Code: Select all
curl -X PUT -d isOn=1 http://192.168.2.15:8176/devices/Coffee-Table-Light

Where would I put the above code for testing


In a Terminal window. Or you can use the URL form (see below) in a browser - probably easier. The doc I pointed to above has examples for both using the curl command line tool and the URL to use from anything that will open a URL (browser, etc).

T-Power wrote:
2. How would I send a command to Indigo via javascript to turn on/off device?


The example above turns on/off a device. Most likely you'll want to use the URL form:

http://127.0.0.1:8176/devices/office-lamp?isOn=1&_method=put

I don't know how to open a URL in javascript but I'm sure a quick search will tell you.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu May 16, 2013 9:10 am
T-Power offline
User avatar
Posts: 220
Joined: May 10, 2010

Re: Email rule to automate Indigo applescript- but I need SP

Thanks again Jay,

Always a pleasure!
:)

MacMini 2.3 GHz Intel Core i7 16GB DDR3
Indigo Pro 2022.1 macOS Mojave 10.14.6

Posted on
Thu May 16, 2013 2:11 pm
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: Email rule to automate Indigo applescript- but I need SP

T-Power wrote:
1. Taking Indigo RESTful for a spin. How would I set this in motion:
Code: Select all
curl -X PUT -d isOn=1 http://192.168.2.15:8176/devices/Coffee-Table-Light

Where would I put the above code for testing

2. How would I send a command to Indigo via javascript to turn on/off device?

T.I.A.


Take a look at cujo, very easy to use: http://cujojs.com

Posted on
Thu May 16, 2013 2:13 pm
T-Power offline
User avatar
Posts: 220
Joined: May 10, 2010

Re: Email rule to automate Indigo applescript- but I need SP

Thank you roussell!

MacMini 2.3 GHz Intel Core i7 16GB DDR3
Indigo Pro 2022.1 macOS Mojave 10.14.6

Posted on
Thu May 16, 2013 2:16 pm
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: Email rule to automate Indigo applescript- but I need SP

T-Power wrote:
Thank you roussell!


Sure, forgot to mention that cujo is modular, so you can use just rest.js from the package if you only need that functionality.

Posted on
Thu May 16, 2013 2:19 pm
T-Power offline
User avatar
Posts: 220
Joined: May 10, 2010

Re: Email rule to automate Indigo applescript- but I need SP

Nice

MacMini 2.3 GHz Intel Core i7 16GB DDR3
Indigo Pro 2022.1 macOS Mojave 10.14.6

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 15 guests