Direct SharpTools to IFTTT Webhook Trigger Tiles

Was in touch with Josh and he suggested I post here. Discovered that my inexpensive wifi to IR blaster is compatible with SmartLife app which is also compatible with IFTTT and Alexa.

IFTTT can trigger the wifi to IR blaster to fire IR codes via SmartLife scenes (macros) with a simple webhook trigger. The SmartLife app natively controls the IR blaster via virtual remotes. Id rather not have to take out my phone each time. So I figured, if I could create a tile in SharpTools which triggers the IFTTT webhook, I could fire IR codes from the wifi to IR blaster without the need to first set up a virtual switch in Smartthings then link that switch to IFTTT (Smartthings is also compatible with IFTTT). In other words I want to tap a tile on my dashboard and bypass Smartthings, which would save setup time and send the IR code faster. I could control any IR based device this way directly from a SharpTools dashboard and the blaster. (TVs, AC, Fans, etc).

So…Josh suggested using the $.get (webhook URL) syntax with a hyperlink tile, which worked.

Problem is with IFTTT a glaring red error message appears after the tile is taped as a server response. Josh explained it’s due to an incompatibility between Sharptools servers and IFTTT. He said the Sharptools server could be modified to handle the request so it works without the error message if there’s enough of a demand. Perhaps even a dedicated IFTTT webhook tile option (since the service is so popular now) could be added or a simple option in the existing hyperlink tile to turn off the server response message, etc.

IFTTT webhooks would open up a world of possibiltes to control devices via Sharptools that aren’t directly compatible with smartthings.

I know this can be addressed by injecting CSS with fully kiosk. I don’t use fully kiosk and that’s more complicated than it needs to be. So a simple option or dedicated tile would be fantastic.

Would there be any community interest to expedite this feature?

4 Likes

A lot of what you said was foreign to me :joy:. But ifttt integration would be awesome.

Yes a proper webhook integration, official IFTTT integration, or just a simple option to turn off the response message from the server for the current hyperlink tile would do the trick- neat and clean!

IFTTT is like a Smartthings hub in the cloud, compliments and enhances everyone’s existing setup and devices.

This is a no brainier for Sharptools.

Thanks for posting, @David_Smith!

The special REST API format for Hyperlink tiles makes the request directly from your browser. The SharpTools servers are not involved at all.

The problem is modern browsers will block requests made across two different origins (domains) if the API that is being called doesn’t return a CORS header. In this case, IFTTT’s webhook API is not returning any CORS headers at all which is causing the issue.

What we are proposing is adding an option to the Hyperlink tile REST API syntax which would route the request through our servers to workaround the CORS issue. (Again, the requests currently go directly from your browser to IFTTT)

1 Like

The option would be part of the actual syntax or a check box in the tile? How would this affect webhooks used for other services (not IFTTT)?

Any idea when this could be implemented?

An option for the special Hyperlink REST API syntax. Here’s a snippet of the current syntax for reference:

What I’m proposing is an extra ‘options’ parameter:

HTTP GET

$.get(url, options)

HTTP POST

$.post(url, data, options)

With a proposed option for proxying through the SharpTools servers to avoid CORS issues being something like the following:

HTTP GET

$.get("https://maker.ifttt.com/trigger/change_volume/with/key/XXXXX", {"proxy": true})

HTTP POST

$.post("https://your.cool.url", {"volume": 10}, {"proxy": true})
1 Like

I think that would make the most sense. Is this something that could be rolled out over the next few weeks?

User feedback and the level of community interest in feature requests is a key part of how we prioritize what we work on.

Creating this thread is a good first step in that process. :smiley:

1 Like

Another thought: Is it possible to send an email when a tile is pressed- without setting up a switch in Smartthings first?

You can setup a SharpTools.io Rule and then use a Rule Tile to execute the rule.

Well…IFTTT can receive an email as a trigger for an applet, so that might get around the webhook feedback error.

Cant select specific recipient for email notification (limited to account email) which means the email cant be sent to IFTTT and used as a trigger unfortunately.

I’m thinking I may have an interest in this also. Was just communicating with Josh on another topic today and IFTTT integration may be a solution to my problem also.

Thanks for voicing your interest! The proxy option (which improves support for REST API calls to sites like IFTTT and WebCoRE) is expected to be included in an upcoming beta.

For anyone who is interested in the beta program, you can find more details here: Beta Testers Requested!

Hi @David_Smith - just an update that we’ve added support for the {proxy: true} syntax as proposed in post #6 above to beta. I sent you a PM with more details. :smiley:

Edit: This feature is now available in production for everyone to use!

1 Like

Thanks Josh. Will be checking this out! Thanks for making the addition, it will surely open up a world of options for other users!