The Notify Me Alexa Skill allows anything (like Indigo) to send notifications to your Alexa devices using a fairly simple HTTP call. To use with Indigo, execute this script (either as a standalone script file or from an embedded script action):
- Code: Select all
import json, requests
# Get the access code from an Indigo variable - you could also just
# paste in the string, but this is much more reusable. Just create
# a new Indigo variable (name doesn't matter) and paste in the
# access code you got in the email from notifymyecho.com and
# use that varible's ID here
access_code = indigo.variables[1191967004].value # ID of variable with access code
# This example shows how to insert a device state into the message.
current_temp = int(indigo.devices[1250026703].states["temperature_F"])
notification_string = "The current temperature is {} degrees".format(current_temp)
body = json.dumps({
"notification": notification_string,
"accessCode": access_code,
})
requests.post(url="https://api.notifymyecho.com/v1/NotifyMe", data=body)
For instance, in an Execute Script action:
This script illustrates how to use a device state in the message that's read to you, but of course you can also insert variable values, etc. The script above also expects the access code to be stored in an Indigo variable. We did that for a couple of reasons: first, it's easier to change it in just one place in case it ever changes and second if you have multiple Amazon accounts with Alexa devices attached you can have multiple variables with each access code.
This could have been made into a plugin, but the script is so simple I thought it probably wasn't worth the effort. Someone else may do it however...
Have fun!