New Feature: Rule HTTP Trigger

We’re excited to announce Rule HTTP Triggers which enable third party applications and services like IFTTT, WebCoRE, Zapier, Tasker (and more!) to trigger SharpTools rules. This opens up a variety of exciting integration possibilities!

:crown: HTTP Trigger is a Premium feature.
If you are using the free tier, please let us know if you’d like us to reset your trial.

Overview

Rule HTTP Trigger allows a rule to be triggered from a standard HTTP request from a third party application or service, such as IFTTT, Zapier, Microsoft Power Automate (Flow), and Tasker, or any other applications/services that can send an HTTP request. This was also one of the most popular features requested in the community.

How to use HTTP Trigger

Add HTTP Trigger to your rule(s)

HTTP Trigger can be added by tapping the “+” button in the Trigger(s) section, select Event Trigger and HTTP in the rule editor. Once added, you can tap the copy button to copy the request URL and use it in the other services/applications. (URL will not be functional until the rule is saved.)

:warning: Keep the HTTP Trigger URL private! Do not post the rule’s HTTP trigger URL publicly or share with anyone you don’t trust as the trigger URL contains a special key that is authorized to execute the associated rule.

How to trigger the rule with the HTTP request

HTTP Trigger accepts both GET and POST methods so you can use either one in a third party service/application to initiate the HTTP request to the URL copied from the previous step. See below for a Webhook (request) example in IFTTT.

How to pass data to a rule? (Request Parameters)

Data can be included in the HTTP request as query parameters or as a JSON payload to be passed to the SharpTools rule. These parameters can be used in IF conditions, device command parameters, notifications and more.

The predefined parameters in the HTTP Trigger block can be selected directly in the Context Variable list.

As an alternative approach to defining expected parameters in the HTTP Trigger, you can also select the Custom Parameter option from the Select Variable Prompt, Note that this approach also provides access to nested properties of objects using standard . syntax. (eg: switch.value)

More detailed parameter examples can be found in the Help Article - How to Us Rule HTTP Trigger.

The sky’s the limit

There are tons of integration possibilities that HTTP Trigger allows, and we are excited to see what the community comes up with. :wink:

Other Enhancements

We’ve also updated the $.runRule() hyperlink syntax to support parameters. This can be used in any tile which supports the Hyperlink Action.

For example, use the same rule but provide a parameter indicating which button number you want to simulate pressing:

$.runRule("RULEID", {"button": 1})

Or customize the message that you plan on including as part of a notification:

$.runRule("RULEID", {"message": "Hello World"});

These parameters can be accessed in the rule flow using the Custom Parameters option from the Context Variable → Event → HTTP Event section noted in the ‘How to pass parameters’ section above.

4 Likes

Wiki Post

This is a community wiki post. Please feel free to edit it with creative use cases, services, etc.

Services w/ HTTP

  • IFTTT
  • Zapier
  • Microsoft Power Automate
  • WebCoRE
  • Hubitat Rule Machine
  • Event Ghost
  • Tasker (Android)
  • Shortcuts (iOS)
  • Blue Iris
    - In Camera Property, configure the Alert to send web request to SharpTools Rule HTTP Trigger to turn on the light, play sounds on speakers and etc.
  • TinyCam
    - In the settings for a camera, select Motion Detection, then scroll down to Webhook on Motion
  • Home Assistant - RESTful Command
  • HomeSeer - GetURL or URLAction

As part of the beta, we had some questions about use cases and how the various examples in the wiki post immediately above can be used. Here’s my response from the beta thread:

IFTTT

Something like IFTTT could be used if you wanted to display data from a device or service that wasn’t natively supported in SmartThings. For example, there are a variety smart devices (lighting, air quality, kettles, appliances, shades, etc) as well as just generally helpful services (calendars, business tools, storage, sports, health, task management, etc).

Since these things can all be used as part of the “IF” side of IFTTT, you could then use them to trigger rules to run in SharpTools. And many of the services allow passing of data (“ingredients”) from the triggering service over to SharpTools letting to react in your SharpTools rules based on certain conditions being met (eg. your favorite team scoring flashes a light the team color).

WebCoRE

Some of our users were already existing WebCoRE users and a common use case is wanting to display variables from WebCoRE in SharpTools.

For example, some people have highly complex rules that they’ve created in WebCoRE that do all sorts of averaging, counting, or other math that ultimately gets stored into a WebCoRE variable. Prior to the release of SharpTools HTTP Triggers, those users had to resort to Rube Goldberg style integrations where they pushed data to external services and then used middle man services to turn the data into images (phew! :open_mouth:).

This update makes things much easier as they can just post the data straight from their WebCoRE rules over to SharpTools Rules… basically copying data from a WebCoRE variable into a SharpTools variable which can then be displayed in dashboards or used in SharpTools rules.

Hubitat Rule Machine

Similar to both WebCoRE and IFTTT, there’s several use cases that are opened up like pushing global variables from Hubitat to SharpTools.

Another use case is being able to trigger SharpTools Rules without needing a Virtual Device. Some people have lots of virtual devices just for being able to communicate between Hubitat and SharpTools - for example, at the end of a Hubitat rule they might flip on a Virtual Switch so they could indicate status over in SharpTools.

Now they could just push the status over via the HTTP Triggers to store the data in a SharpTools Variable.

As another use case, you could use the SharpTools HTTP Triggers to post data over to a SharpTools rule that sends an email notification.

Shortcuts (iOS)

Shortcuts is an app that’s built into modern iOS devices and is something of a workflow or automation tool for phones and tablets.

One common use case is to be able to create a widget in iOS which directly runs a SharpTools rule (via the HTTP Trigger). This lets you easily and quickly tap a widget on your phone and run a series of actions (or even condition actions) in a SharpTools rule.

Tasker (Android)

Tasker is a third party app developed for Android that enables automation and workflow on Android devices. It’s a bit of a tinkerers paradise, but it enables all sorts of creative things.

For example, when you connected your phone to a charger, you could have to push the status over to SharpTools. Or when your phone dropped below a certain battery level, you could have it push the status over. (Maybe displaying the status of your battery in a tile or turning a light a certain color to warn you).

Tasker has tons of ‘plugins’ and it’s also commonly used as a bridge for apps that don’t have any integration with SmartThings, IFTTT, or other popular services. For example, I’ve seen people monitoring their wood pellet smokers by watching for a notification on the phone that had a certain string of text and then reacting to that.

Blue Iris or TinyCam

These are both IP Camera monitoring solutions, so being able to webhook out of them means you could take motion data from your cameras and integrate it into your rules.

TinyCam even has object detection meaning it can detect between Person / Pet / Vehicle and you could use that information in a rule to decide how to react.

Home Assistant / HomeSeer

Home Assistant and HomeSeer are both popular home automation platforms. Like the WebCoRE example above, this allows you to push data from those home automation platforms over to SharpTools either for display in dashboard or for use as conditions in rules.

For example, when a motion sensor trips in HomeSeer, have it trigger a rule in SharpTools. Or when a mode or input component (variable) in Home Assistant changes, have that trigger a rule in SharpTools.

2 Likes

Oh my lord! Could I love this tool any more?!

This has made my day. Can’t wait to start playing with this!

Well done guys!

3 Likes