Voice/IFTTT

You can use these instructions to control your WeMo, TP Link, Philips Hue bulbs, CT 30 thermostat and other MPP devices with voice commands.

When using IFTTT, Google Home, or Alexa you can avoid Belkin and/or other manufacturer clouds for improved reliability and reduce the risks of sharing personal information.

Now works with Google Home! Google Home integration uses AutomationOnDrive and a Google Cloud hosted service to integrate your devices to Google Home anonymously. See AutomationOnDrive for details (IFTTT is not needed, do not use the instructions here).

The IFTTT support uses your IFTTT account and your google account to which only you have access.

You can use IFTTT integration using IFTTT notifications, over Google Drive, or both.

Note that you can both receive from and send to IFTTT. Events from IFTTT can be used to trigger commands, change devices (e.g. on, off, brightness) or set custom device states or values (e.g. temperature). You can use the IftttMakerEvent rule action to securely trigger your applets on IFTTT.

IFTTT can be used to integrate cloud only devices from other manufactures with AM. Use the AM "Search" menu to add "IFTTT Devices". You will need to have enabled Voice/IFTTT via notifications or Google Drive for this to work (see below).

Alexa:

If you're using an echo/dot with Amazon Alexa and the android AutomationServer you don't need to use IFTTT, nor the Wemo or TP Link skills if you only need to turn things on or off. For more advanced functions (adjust brightness, etc) you will need to enable IFTTT/Voice (see below).

    1. Enable Alexa Discovery in the advanced section of the AutomationServer preferences.

    2. Use the "Device Manager" in AutomationManager to "publish" your devices for Alexa by enabling the alexa button for each. If you've created groups, or rules triggered by actions or flags these will be available to publish, as will any devices not natively supported by Alexa, e.g. TP Link or MppDevices.

    3. Use Alexa local discovery ("alexa discover my devices" or use the Alexa app home automation discover menu) to discover and then trigger them as switches, e.g. "Alexa, turn kitchen light on".

Normally you should not republish your WeMo lightswitches, sockets (and mini), or insight switches as those are already discoverable by Alexa locally. However if your devices are on a separate part of your network from your echo/dot/firetv (e.g. 2.4GHz vs 5GHz on a dual band wifi router) you can use this AutomationServer function to bridge the network to make your devices available to Alexa (run the AutomationServer on the same part of your network as the echo/dot).

Optionally connect your AutomationServer android device to your Dot/Echo using bluetooth and use the SendTTS rule action to make voice announcements "The garage door is open".

Google Assistant (Google Home):

You can now integrate to Google Home directly using AutomationOnDrive. See there for details (do not use the IFTTT instructions here).

Setup is detailed below using IFTTT to connect.

Optionally you can use the AutomationServer rules engine to send voice messages through Google Home. Configure Google Home as the "cast" target for your AutomationServer: Cast to Google Home. Then use the "SendTTS" action to have the AM Server announce when that rule is triggered through Google Home to say.

Integration via Notifications - IFTTT or any other notifying app

This is the easiest way to integrate with IFTTT and works in most situations. If you find restrictions that prevents working this way consider using Drive integration (see below).

Requires AutomationManager 12.7 with AM Server running on Android 4.4 or later:

Requirements:

      • Google Home or Amazon Alexa (with accounts)

      • IFTTT account connected to your google and/or alexa account

        • Best practice is to dedicate an IFTTT account to IFTTT/AM Server integration

      • AutomationManager / AM Server running on an android phone or tablet, properly connected to your devices

      • IFTTT app installed on the tablet/phone running the AM Server

      • For an Alexa "IF" you always need to say "trigger ..." to trigger an IFTTT flow. The "THEN" is an IFTTT notification to the AM Server using the desired command.

      • For the Google Assistant "IF" use "Say a phrase with a text ingredient" with the text "Turn $ on" or "Turn $ off" to fill in the device name using the voice command with an ingredient. The "THEN" would be an IFTTT notification to the AM Server using: $AM ON "{{TextField}}"

Setup:

The AM Server monitors the text of android notifications for the string $AM followed by Automation Commands.

When a $AM command is found by the AM Server the notification is removed once processed. Check the AM Server log for execution results. If you have any doubt that the notification is being received you can send an non-$AM notification (try using an IFTTT button for the THIS).

      1. Touch the AM Server widget to open AM Manager on your server device

      2. Touch Preferences > AM Server

      3. Touch the text under "Notifications" and enable AM_NotificationListener to access android notifications

      4. Create an applet in IFTTT where the "THAT" action is to send a notification. The text of the notification should be $AM followed by one of the Automation Commands.

IMPORTANT: On many android systems every IFTTT or AutomationManager app install or update requires the android device to be restarted to re-enable notification processing. Restart the device and open both apps to enable notification processing.

Troubleshooting:

Confirm each step before continuing.

      1. Create an IFTTT applet using a button widget for the THIS. Send a text notification for the THAT using any text.

      2. Add an IFTTT button widget to a separate device/phone to trigger the applet.

      3. Trigger the applet and observe the AM Server device for a few seconds. If the IFTTT notification does not appear in the notification bar, consult the IFTTT instructions used to setup the IFTTT app. This step must be working before continuing.

      4. Edit the applet on IFTTT and change the text in the notification to an AM Command and save.

      5. Trigger the applet. If the notification appears and remains in the notification bar, AM is not running or has not been authorized to process notifications.

      6. Open AM to "View Log" and again trigger the applet. If you do not see the applet command recheck using the steps above. If the command is not handled the error messages should indicate the cause of the problem.

Once the command is handled properly in AM you should be all set.

IFTTT Integration via Google Drive

Google Drive can be used for integration with IFTTT or other similar services; anything that can add a row to a google Drive sheet on your account. Generally notifications are easier to integrate but some situations require using Google Drive (e.g. multiple IFTTT accounts).

Requirements:

    • Google Home or Amazon Alexa (with accounts)

    • IFTTT account connected to your google and/or amazon account

    • AutomationServer running on an android phone or tablet, properly connected to your devices

    • AutomationOnDrive installed and running on the same android phone/tablet, properly connected to your Google Drive account

Getting Started

    1. Install and configure AutomationOnDrive. You MUST use the same google account for the AutomationOnDrive as you used for Google Home.

    2. Confirm AutomationOnDrive is enabled and working - look for a file in your drive account with the name you used for the AoD location location.

    3. Continue on with the appropriate trigger type below. Any will work, only Google Home (Google Assistant) and Alexa are described here. If you use a different trigger type set it up and jump to the Google Drive Actions.

Google Home setup

    1. Open IFTTT and log into your account if necessary.

    2. Select "My Applets" then "New Applet".

    3. In the "If" section search services for Google and select "Google Assistant"

    4. Select the desired option, for example use "Say a phrase with a text ingredient" to the system

    5. Configure the phrase, e.g. "Turn $ on". The $ is your device name so assign pronounceable names. Alternatively you can used dedicated phrases like "open the garage door" or OnEvent trigger names.

    6. Configure a response, e.g. "Ok turning $ on"

    7. Jump to "Google Sheet Actions" below.

Alexa setup

    1. Open IFTTT and log into your account if necessary.

    2. Select "My Applets" then "New Applet".

    3. In the "If" section search services for Alexa and select "Trigger by voice command"

    4. Configure the phrase, e.g. "Turn Kitchen on".

    5. Jump to "Google Sheet Actions" below.

Google Sheet Actions

Create a new IFTTT applet on for your voice command as described above, or any other IFTTT trigger you wish to use.

In the IFTTT "That" services section search for Google and select "Google Sheets".

If necessary, link the Google Sheets service using the same Google account you're using with AutomationOnDrive and grant the necessary permissions. Occasionally it will be necessary to relink to the Sheets service - find the Google Sheets service in your IFTTT account and choose "Settings" and edit (at time of writing) and follow the instructions.

Use "Append row to spreadsheet".

Name the spreadsheet to match your AutomationOnDrive location name (the default is "home"). You must be using the same google account! Google/IFTTT must create it's own file, do not reuse an existing file.

In the formatted row enter the command you wish to have executed (see below). You might use 2 separate applets with the actions.

If you're using Google Home, the row might look like:

{{TextField}}|||on where TextField is the device name from the voice command

{{TextField}}|||off

If you're using Alexa, the row will look something like:

"DeviceName|||on" (without the quotes)

"udn|||off"

Device and events names can be specified using voice and the $ parameter or they can be hard coded with a device name, event name, or device UDN (from AutomationManager).

See: Automation Commands for the full command set that is available.

Use any drive folder path you wish (use the same one for all applets!)

Test (and create the spreadsheet) by issuing the command to your voice device.

Open Google Drive in a web browser (log in with the same Google account!).

Find the spreadsheet created by IFTTT and double click to open it. You should see your first command in the sheet, delete it if you don't want it to be applied or leave it for testing.

Under "tools" open the script editor, replace the entire contents of code.gs with:

function onChangeTrigger(e) {

AutomationOnDrive.onChangeTrigger(e);

}

function setup() {

ScriptApp.newTrigger('onChangeTrigger')

.forSpreadsheet(SpreadsheetApp.getActive())

.onChange()

.create();

}

function test() {

onChangeTrigger({source: SpreadsheetApp.getActive()});

}

and SAVE. You may want to name this script project to match your location name.

In the script page under "Resources" pick "Libraries". In "Find a Library" enter (via copy/paste!):

1bQvIj622HYBR70NZ95WhkOmUzJpmDem_HTjANdbTRB79utN3SnVkHIeR

then touch "Add".

You should see the "AutomationOnDrive" as an added library (WemoOnDrive was the old name). Select the latest version from the dropdown (don't enable Development Mode), save, and accept any permission requests.

Touch "Resources", select "Advanced Google Services...". Scroll to the "Drive API" and slide the API button to "ON" (green). Click OK.

Back on the script page, select the "setup" function from the dropdown, and then the run (triangular) button.

Accept any requested permissions. You're the owner of the app so "show advanced" then go to the app to accept the permissions.

If you left your first command in place you can test it by selecting "test" from the function drop down and then "run". Test your IFTTT command by executing the voice command on your voice device (or whatever trigger you used for the "IF").

If you have problems: when viewing the script page use "View", then "logs" or "execution transcript" to see if there are any errors. Feel free to email me for support if you get stuck.

AutomationOnDrive Commands

For the set of automation commands you can use see: Automation Commands

Troubleshooting

Open Google Drive to find the spreadsheet created by your IFTTT applet.

Observe the the spreadsheet. If all is working properly when you issue a voice command you'll see the command appear and then disappear when processed.

Commands will be shown in the AutomationOnDrive (spreadsheeet) log on Google Drive.

If the command is executed you'll see it in the AutomationOnDrive log viewer on your AutomationServer phone after a few seconds. You should then see AutomationServer act on it.

To check your script:

Confirm the folder and name of the spreadsheet in that applet.

Use the "tools" menu to launch the "script editor".

When viewing the script use "View", then "logs" or "execution transcript" to see if there are any errors.

To test the script you can run the test function if the added data is not disappearing from your spreadsheet. It will show output in the execution transcript and logs which may shed light on any problems.

Feel free to email me for support if you get stuck.

Common Problems

      • Incorrect spreadsheet name (must match your AutomationOnDrive location name)

      • Script or onChange event trigger not defined for spreadsheet.

      • Incorrect folder (point your action at the folder with your spreadsheet)

      • Incorrect switch name or udn (google home may have trouble hearing unusual names)

      • Incorrect google id

      • Downlevel AutomationOnDrive library version (update as per the above)