Announcement

Collapse
No announcement yet.

IFTTT Plug-in - User Guide

Collapse
This topic is closed.
X
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • IFTTT Plug-in - User Guide

    INSTALLATION / CONFIGURATION

    System Requirements:

    This plugin is for HS3 or HS3PRO. It works with both Windows and Linux versions.

    Prerequisites:
    You need:
    - an IFTTT account: https://ifttt.com
    - and a Dropbox account: https://www.dropbox.com because the plugin use Dropbox channel to communicate with IFTTT


    Plugin Installation:
    Download and install from the updater or download package from the Beta Testing thread and follow instructions to install.

    Plugin Configuration
    - Log into your Dropbox account.
    - Start the plugin from the "PLUG-INS > Manage" page wait a few seconds for the plugin to initialize
    - go to the config page "PLUG-INS > IFTTT > Config" and click the "Dropbox Authorize" button
    then you should see a page like this:

    Click image for larger version

Name:	authorization.png
Views:	1
Size:	29.7 KB
ID:	1210374

    Click Allow, copy the provided code, go back to the plugin config page, paste the code in the text box, and click the Done button

    Click image for larger version

Name:	authorization2.png
Views:	1
Size:	20.1 KB
ID:	1210375
    Last edited by spud; January 4th, 2017, 02:31 PM.

  • #2
    FEATURES

    Actions:

    You can use this plugin to execute some IFTTT Actions. To do so, create a HS Event, create the trigger of your choice then select the "IFTTT Action" category, and set a dropbox path. It is strongly advised to use a subfolder dedicated to this plugin so that it doesn't conflict with your personal files.

    Click image for larger version

Name:	ifttt_action2.png
Views:	1
Size:	13.5 KB
ID:	1188408

    Then go to your IFTTT account, create a new applet and choose the Dropbox trigger: "New File in your folder". Enter the same subfolder name as in your HS event, and create the action of your choice.

    Click image for larger version

Name:	ifttt_action.png
Views:	1
Size:	19.0 KB
ID:	1188407

    Triggers

    You can also use this plugin to create some IFTTT applets that trigger HS Events.
    To do so create a new IFTTT applet with the trigger of your choice and choose the Dropbox Action: "Create a text file".
    Enter a a Dropbox folder path, it can be anything you want but as for Actions it is strongly advised to use a subfolder dedicated to this plugin.
    Enter any file name you want, but it must be a .txt file. And enter anything you want for the content (see the advanced triggers section below to use the content of the file to pass parameters to HS)

    Click image for larger version

Name:	ifttt_trigger3.jpg
Views:	1
Size:	36.9 KB
ID:	1188413

    Then go to HS and create an event. Choose the "IFTTT Trigger" category and enter the same folder path as in your IFTTT applet. Then create the action of your choice:

    Click image for larger version

Name:	ifttt_trigger2.png
Views:	1
Size:	12.9 KB
ID:	1188409

    That's it! If you have created the exact same applet/event than me you should hear a notification every time the outside temperature drops below 0
    Last edited by spud; January 4th, 2017, 02:57 PM.

    Comment


    • #3
      ADVANCED FEATURES

      Triggers:

      Here is a more advanced example of trigger which use a global variable to pass information from IFTTT to HS.
      Let's create an event that wil make HS speaks all the NBA breaking news published on ESPN

      First we need to create a new IFTTT applet like on the screenshot below.

      Click image for larger version

Name:	ifttt_advanced_trigger.jpg
Views:	1
Size:	38.6 KB
ID:	1188411

      The interesting part is what we put in the content of the Dropbox file which will be created. This content is parsed by the plugin and it creates 1 global variable ifttt_nba_news which contains the text of the news Then we just need to create a Speak action in our HS Event that speaks the content of this global variable, to do so we use the HS replacement variable $$GLOBALVAR:iftttt_nba_news:

      Click image for larger version

Name:	ifttt_advanced_trigger2.png
Views:	1
Size:	13.1 KB
ID:	1188412


      Notes:
      • the variable you defined in the content of the text file MUST begin with $ifttt
      • {{AlertBody}} is an "ingredient" of the IFTTT applet. Each IFTTT channel has different ingredients (i.e. dynamic variables), you can see the list of ingredients and add one to the content by clicking on the "+ ingredient" button.
      • you can define multiple variables by setting one per line in the content of the text file


      Actions:

      Let's now enhance the action example from the previous post, so that we send the status of a HS device as the SMS instead of a hardcoded message. To do so we will use the name of the file created on dropbox as the message. If you don't see the file textbox like on the screenshot below, click the "blue bird" button to switch to advanced editing mode.

      $$DTR:1019: is a replacement variable and means the status string of the device #1019. Click this link for more info about replacement variables

      Click image for larger version

Name:	ifttt_advanced_action2.png
Views:	1
Size:	14.2 KB
ID:	1188440

      On the IFTTT side the only thing we have to change is to use the {{Filename}} ingredient as the content of the message instead of the hardcoded one.

      Click image for larger version

Name:	ifttt_advanced_action.png
Views:	1
Size:	18.8 KB
ID:	1188439
      Last edited by spud; January 6th, 2017, 05:47 PM.

      Comment


      • #4
        SCRIPTING

        You can run an IFTTT action from a script by calling the RunIFTTTAction function with a folder and a filename passed as parameters, exactly as you would provide them for an Event action.
        Code:
        bool RunIFTTTAction(string dropboxFolder, string dropboxFile)
        Here is a C# example script that calls this function:
        Code:
        public object Main(object[] Parms)
        {
        	hs.PluginFunction("IFTTT", "", "RunIFTTTAction", new object[] { "/IFTTT/Actions/Test", "test.txt" });
        	return 0;
        }

        Comment

        Working...
        X