Redstone-IFTTT 1.0.0

Trigger your IFTTT recipes with redstone!

  1. dumptruckman
    Native Minecraft Version:
    1.13
    Tested Minecraft Versions:
    • 1.14
    Redstone-IFTTT is a plugin that lets you use redstone to control things outside of Minecraft. It does this using the Webhooks service on IFTTT.

    Here's a short tutorial and demo video:


    Currently, only triggers are supported. However, I'm planning to add the ability to turn on redstone devices with an IFTTT recipe in version 2.0.0.

    Plugin Setup
    Redstone-IFTTT requires your Webhooks API key from IFTTT. Visit https://ifttt.com/maker_webhooks and click the Documentation button. Your API key will be at the top. Keep this secret to avoid people from controlling your recipes! To set up the plugin with your key. Run /ifttt setup your_api_key. You only have to perform this process once. However, if you regenerate your API key, you will need to repeat the process.

    Commands
    • /ifttt - The only base command which provides help and includes a list of subcommands
    Permissions
    • ifttt.setup - gives access to /ifttt setup command. (default: OP)
    • ifttt.trigger.manual - gives access to /ifttt trigger manual command. (default: OP)
    • ifttt.trigger.create - gives access to /ifttt trigger create command. (default: OP)
    • ifttt.trigger.list.block - gives access to /ifttt trigger list command. (default: OP)
    • ifttt.trigger.list.all - gives access to /ifttt trigger list all command. (default: OP)
    • ifttt.trigger.delete.block - gives access to /ifttt trigger delete command. (default: OP)
    • ifttt.trigger.delete.all - gives access to /ifttt trigger delete all command. (default: OP)
    • ifttt.debug - gives access to /ifttt debug and /ifttt loglevel commands. (default: OP)
    Creating Triggers
    Triggers require a name and at least one trigger condition (though they can support multiple.) Triggers can optionally have a scaling factor to scale a redstone signal which is normally in the range of 0 to 15 to some other range (such as 0 to 100 or -10 to 10.)

    Notably, when a trigger is activated it sends along the old and new current to IFTTT as value1 and value2 respectively. This, along with scaling, allows you to activate recipes that require some sort of numeric input value.

    To create a trigger, use the /ifttt trigger create <name> <conditions> [scaling] command.

    Name
    A trigger's name should reflect the event name in the Webhooks trigger in your IFTTT recipe.

    Conditions
    Trigger conditions are checked when a redstone event occurs. A redstone event occurs when the redstone current in a block changes. A trigger condition will act on the old current (before the change) and the new current (after the change.)

    There are a few very simple built in conditions for the most common scenarios:
    • ON - condition is met when something with no redstone current gains some redstone current.
    • OFF - condition is met when something with some redstone current loses all redstone current.
    • ANY - condition is met when the old current and the new current are different.
    Custom conditions can also be created using simple equations and inequalities. There are two variables, OLD and NEW, which can be used in the inequalities. The integer values in the range of 0-15 can be used on the right hand side of operator. Additionally, multiple conditions can be strung together using a semi-colon ;. Valid operators are =, !=, >, >=, <, <=. Here are some examples:
    • OLD=0;NEW=15 - condition is met only when the redstone current goes from fully off to fully on.
    • NEW>OLD - condition is met when the redstone current increases.
    Scaling
    The optional scaling parameter of the create command allows you to specify a new range for the current to be adjusted to when sent to IFTTT. Here are some examples:
    • 0:100 - converts the 0 to 15 range into a 0 to 100 range. A current of 7 would be scaled to approximately 46.667.
    • 15:0 - inverts the 0 to 15 range so that a current of 15 sends a value of 0 to IFTTT and a current of 0 sends a value of 15.
    • -15:15 - converts the 0 to 15 range into a -15 to 15 range. A current of 7 would be scaled to -1.
    Maximvdw likes this.