Twilio  

Developer: FlyingDiver     Like this plugin? Show your appreciation!
Category: Notification & Messaging
Github: Github Repo
Assistance: Get help!   
Plugin ID: com.flyingdiver.indigoplugin.twilio
Latest release: v7.1.1 released on Feb. 23, 2018
Requires: Indigo v7.0.2 or higher
(Check the Releases tab below for older releases that may have different requirements)
  Download latest release

Twilio

Plugin for the Indigo Home Automation system.

This plugin uses the Twilio service to send and receive SMS messages.

The twilio Python library is now included with the plugin and does not need to be installed separately. If you have previously installed the library and want to remove it, enter the following command. You will need to enter your administrator password. This is totally optional.

sudo pip uninstall twilio

Immediate Notifications

I've figured out how to process incoming SMS messages via Twilio without polling. In my testing, Indigo was getting the SMS content about 3 seconds after the SMS was sent to the Twilio number.

This method requires that your Indigo installation is accessible via HTTP. I did my testing using the Indigo Reflector. You may be able to get this to work with direct connections using port mapping, but I don't do that so I might not be able to help. This also requires that you have your Indigo remote login credentials (username and password) stored on the Twilio servers. I deemed this acceptable since I can use HTTPS to connect from Twilio to the reflector, and the reflector uses an encrypted connection to Indigo.

First, you need to install a Indigo Web Server (IWS) plugin. The Twilio plugin includes a simple IWS plugin. After downloading the new plugin, copy the "twilio" folder to your /Library/Application Support/Perceptive Automation/Indigo X/IndigoWebServer/plugins directory.

See http://wiki.indigodomo.com/doku.php?id=indigo_6_documentation:iws_plugin_guide for more information. You will need to restart the Indigo server to enable the plugin.

Create a variable called "twilio_ping", set it to "False". Then set up a trigger for that variable changing to "True". In the actions for the trigger, execute the Twilio "Check for Messages" action, and then set the twilio_ping variable to False (or anything other than True, really).

Next, go to your Twilo phone number dashboard: https://www.twilio.com/console/phone-numbers/dashboard. Click on the Twilio number you want notifications for. Under Messaging, make sure it's configured for Webhooks/TwiML. For inbound messages, put something like

https://\<user>:\<password>@\<reflector>.goprism.com/twilio/ping

in the URL field with "HTTP GET" selected. Put in your Indigo remote access username and password, and your reflector subdomain name.

Now, anytime an inbound SMS is received by the Twilio servers, that URL will be fetched. That will cause the ping method in the twilio IWS plugin to be called. Which will set the twilio_ping variable to true. Trigger on change for that variable. Done.

Broadcast Messages

MessageType: messageReceived 
Returns dictionary:
{
    'messageFrom':      <text string>,
    'messageTo':        <text string>,
    'messageText':      <text string>
}

MessageType: messageSent 
Returns dictionary:
{
    'messageFrom':      <text string>,
    'messageTo':        <text string>,
    'messageText':      <text string>
}

PluginID: com.flyingdiver.indigoplugin.twilio

Release details
Released on: Feb. 23, 2018
Requires: Indigo v7.0.2+
Changes in this release

GHPU Fix

Release details
Released on: Oct. 25, 2017
Requires: Indigo v7.0.2+
Changes in this release

This is a minor update. This release embeds the Twilo library in the plugin so it doesn't need to be installed separately. This release also enables multiple files to be sent in one MMS message. Just list multiple source URLs, comma separated, in the action. Twilio has a max of 10 items per MMS, but this is not enforced by the plugin.

Release details
Released on: Nov. 15, 2016
Requires: Indigo v7.0.2+
Changes in this release

This version uses the new Indigo 7 logging system, and also implements broadcast messages for the new publish and subscribe system. See the Readme for more information.

The plugin major version number now matches required Indigo version number.

Release details
Released on: June 25, 2016
Requires: Indigo v6.1.0+
Changes in this release

Bug fixes, Twilio Webhook

Release details
Released on: June 24, 2016
Requires: Indigo v6.1.0+
Changes in this release

Removed some extraneous debug log messages Added state icons changed some trigger handling code

Release details
Released on: June 14, 2016
Requires: Indigo v6.1.0+
Changes in this release

Fixed initial startup issue

Release details
Released on: June 14, 2016
Requires: Indigo v6.1.0+
Changes in this release

Mcall release - place voice calls

Release details
Released on: June 13, 2016
Requires: Indigo v6.1.0+
Changes in this release

First test release