iMessage/Messages/Siri Indigo Control Script

Posted on
Sun Dec 23, 2012 11:45 am
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

iMessage/Messages/Siri Indigo Control Script

Hi all,

A few days ago I added a script to the User Contribution library called iMessage/Messages/Siri Indigo Control Script. This is actually a script for the Messages application that provides a link from Siri to Indigo. This allows Siri to send a text message (SMS or iMessage) to control Indigo in a very flexible way.

The script is working amazing well for me. I love being able, while driving home, to have Siri "Tell Indigo to raise the temperature". Or, when I get up in the morning to "Tell Indigo to turn on the Christmas Tree." The response is almost instantaneous; the script is executed by the time Siri announces that the message was sent. There is also no impact on CPU utilization that I can see.

It's very easy to modify the script and the changes take effect immediately. Commands can be generic actions to control devices and execute action scripts. Or the script can specify specific actions triggered by custom phrases. It's easy to add customize the commands for your setup simply by copying and changing the existing Applescript statements. I keep an alias of the file on my desktop and click on it whenever I think of something else I would like Siri to do.

Anyway, I'm curious whether anyone is interested in using this simple method to control Indigo from SMS/iMessages and Siri. If so, please let me know what does or doesn't work for you and I could modify the sample script and instructions as necessary to make it easier for others. I'm also curious if anyone has tried it with Indigo 6.

Thanks and happy holidays!

--Dave

Posted on
Sun Dec 23, 2012 11:49 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: iMessage/Messages/Siri Indigo Control Script

Brilliant.. i was thinking of doing something like this.. you’ve just saved me hours of headaches and hair pulling :D

Computer says no.

Posted on
Sun Dec 23, 2012 5:07 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: iMessage/Messages/Siri Indigo Control Script

Love to try it. Looked thru the library but don't see it. Might you have a link?

Thanks,

Carl

Posted on
Sun Dec 23, 2012 5:14 pm
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: iMessage/Messages/Siri Indigo Control Script


Computer says no.

Posted on
Sun Dec 23, 2012 9:19 pm
davvi offline
User avatar
Posts: 110
Joined: Sep 27, 2011
Location: Austin, TX

Re: iMessage/Messages/Siri Indigo Control Script

This is fantastic! I have on issue though. I name all my devices with the name of the room before the name of the device so a bookshelf lamp in the office is "Office: Bookshelf Lamp". I don't want to rename all my devices as there are too many dependancies tied to the names. How can I get the script to recognize the devices?

Posted on
Sun Dec 23, 2012 10:08 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: iMessage/Messages/Siri Indigo Control Script

I assume this will not work using 10.5.8? I don't see a Messages folder anywhere
in the Library.

Thanks,

Carl

Posted on
Sun Dec 23, 2012 10:50 pm
davvi offline
User avatar
Posts: 110
Joined: Sep 27, 2011
Location: Austin, TX

Re: iMessage/Messages/Siri Indigo Control Script


Posted on
Wed Jan 02, 2013 9:08 pm
dmeeker@mac.com offline
Posts: 85
Joined: Aug 26, 2011

Re: iMessage/Messages/Siri Indigo Control Script

Hey guys,

The functionality seems great, but I just can't get it to fire off when a message is received by imessage. I checked the console also, but see no errors.

Quick recap:

1) moved your script into the /Library/Scripts/Messages/ folder on my root.
2) Created an iMessage account
3) Told iMessage to fire that script when a message comes in

I can send messages from my iPhone to the account, and they show up correctly in iMessage. But nothing happens.

If I run the script manually, It runs, but when I typed "turn off kitchen lights" (which is the name of the kitchen lights in my Indigo database, I got a return "error turning off kitchen lights".

Do I need to edit the AppleScript's actions so that they match with what I want to do? I looked at your post, and reviewed the script quickly and it didn't appear so.

I'd love to get this working, so please let me know if you experienced any issues getting it running or if there is something simple I am simply not doing.

Thanks for the help in advance.

Posted on
Thu Jan 03, 2013 10:30 am
dmeeker@mac.com offline
Posts: 85
Joined: Aug 26, 2011

Re: iMessage/Messages/Siri Indigo Control Script

Quick Update, as I made a touch of progress.

I accidentally didn't have the script set to fire off when an incoming message was received. Instead I had it on login.
That seems to have fixed the first issue - of nothing happening with the script (... captain obvious!).

Now that that has been changed, I am seeing something else I am unsure about. When the message is sent to iMessage, the script pops up and I see the applescript dialog box pop up that reads "send a command to Indigo Remote Control". "status" is pre-populated.

Please let me know your thoughts.

Posted on
Thu Jan 03, 2013 7:48 pm
bbruck offline
Posts: 343
Joined: Oct 05, 2008

Re: iMessage/Messages/Siri Indigo Control Script

What a fantastic script! I've been telling my Christmas tree to turn on and off with delight!

Unfortunately, my devices also have prefixes - B-Office Lights for Basement, so I'll have to find a way around that as well, but for now, success!

Posted on
Thu Jan 03, 2013 8:07 pm
davvi offline
User avatar
Posts: 110
Joined: Sep 27, 2011
Location: Austin, TX

Re: iMessage/Messages/Siri Indigo Control Script

Any ideas on modifying the script to work without renaming devices?

Posted on
Thu Jan 03, 2013 8:09 pm
bbruck offline
Posts: 343
Joined: Oct 05, 2008

Re: iMessage/Messages/Siri Indigo Control Script

In my case all my devices have a two character prefix - B- or M- or S- etc so I can prolly strip off two characters, but I may just rename the devices

Posted on
Fri Jan 04, 2013 1:03 pm
dmeeker@mac.com offline
Posts: 85
Joined: Aug 26, 2011

Re: iMessage/Messages/Siri Indigo Control Script

After more experimenting, I can get the script to run properly using "Late Night Software's Script Debugger".
It works like a champ if I just run it from the script debugger/editor.

I can't get it to run at all from iMessage though.

Stupid question - I am assuming that I message passes the value of the message to the script. And I assume that I should fire the script from i message "when a new message is received". Right?


Thanks!

dave

Posted on
Mon Jan 21, 2013 5:56 pm
Randaulf offline
Posts: 12
Joined: Jan 31, 2012

Re: iMessage/Messages/Siri Indigo Control Script

I am also having an issue running this script from iMessage. I can run it in script form (a box comes up and I type in what command) and everything works fine. When I run it i iMessage I again get the pop up message asking for my command and I also get another pop up box that says:

An error occurred while executing an AppleScript event handler.
Event: Message Received in Active Chat
File: Messages Indigio Control Script sample.scpt
Error: Error-1708


This could be user error, but like I said it seemed as if the script was working without the interjection of iMessage. Please let me know if there is anything that I should be trying in order to get this up and running.

Thanks!

Posted on
Fri Feb 01, 2013 8:04 pm
midd offline
Posts: 372
Joined: Apr 18, 2010

Re: iMessage/Messages/Siri Indigo Control Script

where in the script do you list your devices?


I'm getting error 1708 also.

Thanks

Indigo 7, Monterey (12.1) on a 2009 Mac Pro..

Who is online

Users browsing this forum: No registered users and 3 guests