Would be great if we could get a mode trigger added to the SmartThings channel on IFTTT.com. For example, If the mode is changed to Goodbye, then send me a text message “The house has been armed away.”
There are two ways to do this now, although neither is perfect.
-
whenever you do something that changes the mode behind the scenes, whether it’s a hello home action or a smartapp, have that flip a virtual switch. You can use that virtual switch to trigger IFTTT. However, if you just change the mode manually through the mobile app, it won’t catch it.
-
alternatively, create a smartapp to subscribe to mode changes and and flip that switch. This has the advantage of picking up even manual mode changes, but the disadvantage of requiring more system resources and more custom code. See @baldeagle072 's comment below. (Edited to correct for subscription method.)
Both require some custom coding, if only to set up the virtual switch. ( btw, @baldeagle072 has a smartapp that simplifies creating a tile for a virtual switch. )
It’s pretty easy to do with virtual switches. Here’s a thread on it
For me, I use a modified version of what’s in that thread along with virtual momentary switches. I only use the switches to send the commands and so I use the momentary switches (not monitoring the state). The benefit of the momentary switches is that when pressed, they send an on command followed by an off. I use the app to monitor only the on commands and send the HH command.
IFTTT then can send on commands to the virtual switch or monitor for the switch being turned on. Monitoring the on works well. I use it to trigger harmony commands via IFTTT when I push the virtual button.
Here’s my modified code in case you want to use it. In addition to only using the on command, there’s an optional delay, which I use in my case to set the away mode. This way, I can arm the away mode 60 seconds after pressing the button so I can get out the door without an alert.
https://github.com/tierneykev/SmartThings/blob/master/Hello%20Home%20Momentary%20Switch
This is all pretty cool, but seriously, SmartThings needs to update the API/IFTTT capabilities already. It can’t be that big of a deal.
You don’t need to schedule to check the mode. You can subscribe to mode changes using subscribe(location, onLocation)
. In onLocation(evt)
, evt.value
should give you your mode that was just changed to. It even works when you manually change mode in the mobile app
Awesome, I will edit my post.
Agreed. I’m surprised changing modes wasn’t a trigger to begin with.
Is there a better place to request this be added to the integration with IFTTT?