1. Follow directions earlier in this thread to get node.js and the alexa-remote code and the send-alexa-command.js
2. modify send-alexa-command.js file to change the sendCommand line to:
- Code: Select all
sendCommand("speak", "SAYANCHOR", ["Kitchen", "Master", "Front Room"]);
In my example I am just using "speech" only and only sending it to three of my Echo devices, change to aliases of your devices of course.
3. copy or rename that file to send-alexa-base.js
4. Make action group "say alexa variable" with #1 a python script:
- Code: Select all
saythis=str(indigo.variables['alexatextforspeech'].value)
import codecs
def process(lines):
for line in lines:
yield line.replace('SAYANCHOR',saythis)
base = '///Users/Indigo/Desktop/AlexaRemote/send-alexa-base.js'
new= '///Users/Indigo/Desktop/AlexaRemote/send-alexa-newcmd.js'
with codecs.open(base, 'r', 'utf-8') as infile:
with codecs.open(new, 'w', 'utf-8') as outfile:
for line in process(infile):
outfile.write(line)
infile.close()
outfile.close()
And then step #2 is an applescript with a :01sec delay:
tell application "Terminal"
set currentTab to do script "cd ~/Desktop/AlexaRemote && node ./send-alexa-newcmd.js"
end tell
delay 8
tell application "Terminal" to close (get window 1)
Voila! Now I write scripts or functions to update the variable and then follow with this action group to push it out. Can link some Alexa-Hue devices as functions such as "Alexa, check house status" and the like and can then get feedback with low latency. I'm sure there is a prettier way to do this, but (again) amateur coder here!