IFTTT Triggers

Is there a way to add more triggers to the SmartThings IFTTT channel? It seems very limited. There are various actions and data that I would like to log periodically to Google Drive files but they aren’t necessarily based on one of the actions listed as an available trigger in IFTTT.

I’d be interested in adding triggers also.

Just thinking out loud here, I wonder if a smartapp could be written that creates a completely customized trigger. So in IFTTT there would be a trigger action called “custom” or something like that and in a smartapp it activates that trigger based on an app which allows you to select almost anything that your system can read.

Beware of IFTTT trigger times. I had an IFTTT recipe that would unlock my rear door ((Smartthings-Kwikset) when the ignition was turned off (Automatic Link OBD) in my car. Problem was it took 1-2 minutes for the trigger from the Link through IFTTT to Smartthings to operate. So, my wife would arrive home, get out of her car, manually enter the unlock code, enter the house manually locking the door behind her. A minute later, the door would unlock.

Since it was determined to be an IFTTT issue, I ended up returning the Automatic Link OBD back to Automatic. I was told IFTTT triggers could take as long as 15 minutes. I did find that recipes with Smartthings as the IF and THEN worked right away.

In my experience ST pure triggers fire straight off using IFTTT. When I add in something like DASH OBD it doesnt. On average IFTTT only polls many services every 15 minutes or so but ST has been really solid with it.

I have been having the same issue with the DASH OBD and IFTTT recipe with my Schlage lock. I also had it trigger when I turned off the engine on the other side of town which was out of the geo-fence I created. Ethan at Dash has been looking into the issue with me. Seems that the trigger timing is still very inconsistent. In theory it would be a great idea, but not quite there yet. I would trust it more to turn on lights than to unlock my door. Too concerned about security.

I’ve learned my lessons about IFTTT lag through other recipes… Its hit or miss. Definitely not good for time-sensitive or critical trigger. Hope its reliable enough to log events.

If you use an iPhone, you may be interested in our upcoming SmartRules app - http://smartrulesapp.com. This app will give you the ability to easily create rules, similar to IFTTT, but more flexible, and they run locally on the ST cloud, so you’ll get the same speed as a SmartApp. We’re finishing up beta testing now and will be releasing soon.

3 Likes

I thought I made a suggestion about this on their Feature Requests - can’t find it though… :unamused:

I wanted triggers that could activate “Hello and Goodbye”.

For Instance: If Nest set to Away, Then ST set to Goodbye".

Seems simple enough.

1 Like

It does seem simple, but at the present time the SmartThings IFTTT channel can only turn things on and off, and do a few more things specific to thermostats.

However, if you’re willing to do a small bit of custom code, you can set up a virtual switch through SmartThings, and then have IFTTT turn that “on” or “off” and change the SmartThings Mode that way. This is called a “man in the middle” protocol.

It’s a little convoluted, obviously, but it does work.

I am using IFTTT to provide voice control via Hey Siri for my SmartThings installation. I was initially very concerned about the lag as well, but have since found that if you are triggering off of a text or email, as the method I’m using does, there’s almost no lag at all, it’s clear that IFTTT is processing those requests on demand. However, if I just set up a recipe to trigger “when a switch is turned on,” then, yes, it might take 15 minutes until IFTTT gets around to polling for the change. All makes sense. The point is just that some IFTTT recipes can be set to trigger very quickly, but not the ones relying just on device state change.

Custom Code? how much of this is actual coding? (writing if, thens, loops, etc by hand). How would you suggest I start? link?

Here is the FAQ for creating a virtual switch.

After that it depends on what you want to do with it. A virtual switch can be any of several types, but for IFTTT mode changing you probably want a simple binary (on/off) switch.

The virtual switch doesn’t really exist, but the network will act as though it does, including letting you change it from the mobile app and telling IFTTT that it has turned on/off.

Is it up to SmartThings to allow IFTT access to Phrases and Mode changes?

Yes, and so far they haven’t.

What I’d really like to see SmartThings add is a way to create virtual switches and virtual presence sensors easily right in the mobile app, without touching the IDE. That would be a plug and play solution for noncoders. Then they could use IFTTT or use the virtuals for other purposes and never have to see a line of Groovy. :blush:

3 Likes

How about some new Actions? Particularly a Toggle action like the WeMo channels have. This way you don’t need two separate recipes to turn things on and turn things off.

You can make a momentary push button device and use the follow smartapp code.

definition(
name: “Momentary Toggle”,
namespace: “smartthings”,
author: “SmartThings”,
description: “Toggles light state”,
category: “Convenience”,
iconUrl: “https://s3.amazonaws.com/smartapp-icons/MyApps/Cat-MyApps.png”,
iconX2Url: “https://s3.amazonaws.com/smartapp-icons/MyApps/Cat-MyApps@2x.png”,
iconX3Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”)

preferences {
section(“Real Switch…”) {
input “realswitch”, “capability.switch”,
title: “Real Switch…”,
required: true
}
section(“Virtual Stand-in…”) {
input “standin”, “capability.switch”,
title: “Stand In Virtual Switch…”,
required: true
}
}

def installed() {
subscribe(standin, “switch.on”, switchOnHandler)
subscribe(standin, “switch.off”, switchOffHandler)
}

def updated() {
unsubscribe()
subscribe(standin, “switch.on”, switchOnHandler)
subscribe(standin, “switch.off”, switchOffHandler)
}

def switchOnHandler(evt) {
state.wasOn = realswitch.currentValue(“switch”) == "on"
state.wasOff = realswitch.currentValue(“switch”) == "off"
if(state.wasOff)realswitch.on()
if(state.wasOn)realswitch.off()

}

def switchOffHandler(evt) {
}

2 Likes

Thanks @RobtheEngineer! I created the momentary button but I’m having trouble wrapping my brain around the smartapp you shared. its looking for a real switch and a stand in virtual switch… Do I need to create another virtual switch and add it here as the stand in?

The push button will be the virtual switch and whatever switch (ie bedroom light) you want to toggle off and on will be your real switch.

ahhh, got it. it finally hit me. this works great. especially with the DO button. thanks!