i thought it was clever and to try to use it to interface with indigo... so, this script, when saved as a standalone app and running on a computer with the notes app set to sync with a cloud account (the same acct your iphone uses), will scan your notes for specifically named ones and when it's received it will send the corresponding command to indigo, and then delete the note (vice versa actually).
it's a bit silly, but you know what, it works. i did this in bed in the middle of the night, so it's just a rudimentary start, but it could be a workable interface if you don't mind saying 'make a note' to siri every time you give a command... the lag is dependent on your internet service and apple's server health, but in the first day i've seen basically a one or two second lag between command and action.
i scripted only a few commands so far, but it's easy enough to expand, as you'll see. thought i'd post it in case anyone's interested...
this script currently will do commands* for my house/setup, but a cursory look at the code will show how it works and that it's easily mod'able in seconds to work for your setup. i made the commands start with 'tell indigo' to ensure it wouldn't misinterpret any other kind of note i might write.
*
lights on/off
party macros on/off
tv on/off
itunes on/off
bedtime
etc..
have fun.
[note: i needed to make it standalone and run via remote machining because my server doesn't have notes or my cloud accounts enabled, but it could be used as a background script if your indigo server and notes are on the same machine...fwiw.)
- Code: Select all
(*
SiriNotesListener2.0
based on Siri Listener by Steven Sande
mods by dtich 3.27.13
*)
on run
-- just here to get things started...
end run
on idle
tell application "Notes"
if exists note "What apps are running" then
delete note "What apps are running"
tell application "Finder"
set myRunningApps to name of every process whose visible is true
tell application "Notes"
if exists note "Running Apps:" then
delete note "Running Apps:"
end if
set noteTitle to "Running Apps:"
set AppleScript's text item delimiters to ", "
set appsList to myRunningApps as text
make new note at folder "Notes" with properties {name:noteTitle, body:appsList}
end tell
end tell
else if exists note "Shut down" then
delete note "Shut down"
tell application "Finder" to quit
else if exists note "Go to sleep" then
delete note "Go to sleep"
tell application "Finder" to sleep
else if exists note "Restart my mac" then
delete note "Restart my mac"
tell application "Finder" to restart
else if exists note "tell indigo lights on" then
delete note "tell indigo lights on"
tell application "indigoserver" of machine "eppc://user:pass@192.168.0.10"
execute group "lighting/living, den, guest - NORMAL (SCENE 3)"
end tell
else if exists note "tell indigo lights off" then
delete note "tell indigo lights off"
tell application "indigoserver" of machine "eppc://user:pass@192.168.0.10"
execute group "lighting/all lights OFF"
end tell
else if exists note "tell indigo watch tv" then
delete note "tell indigo watch tv"
tell application "indigoserver" of machine "eppc://user:pass@192.168.0.10"
execute group "av/watch tv"
end tell
else if exists note "tell indigo itunes" then
delete note "tell indigo itunes"
tell application "indigoserver" of machine "eppc://user:pass@192.168.0.10"
execute group "av/itunes in lr"
end tell
else if exists note "tell indigo av off" then
delete note "tell indigo av off"
tell application "indigoserver" of machine "eppc://user:pass@192.168.0.10"
execute group "av/regular OFF"
end tell
else if exists note "tell indigo party" then
delete note "tell indigo party"
tell application "indigoserver" of machine "eppc://user:pass@192.168.0.10"
execute group "lighting/living, den, guest - PARTY (SCENE 4)"
end tell
else if exists note "tell indigo all off" then
delete note "tell indigo all off"
tell application "indigoserver" of machine "eppc://user:pass@192.168.0.10"
execute group "lighting/all lights OFF"
end tell
else if exists note "tell indigo bedtime" then
delete note "tell indigo bedtime"
tell application "indigoserver" of machine "eppc://user:pass@192.168.0.10"
execute group "bedtime routine guest LOGIC"
end tell
else if exists note "tell indigo fan" then
delete note "tell indigo fan"
tell application "indigoserver" of machine "eppc://user:pass@192.168.0.10"
execute group "hvac/fan run for 10 mins"
end tell
end if
end tell
return 1
end idle