Is it possible to do this? (Setting mode based on another location and other criteria)

So basically I’m looking to have the ability to set my tstat to a cooler temperature on my way home from work.

I’m wondering if this is possible to do? It seems like the sort of functionality people would want to have, but I haven’t been able to figure it out yet. I think if we simply had the ability to create a geo-fenced location, and then use it in a trigger, this would all be a lot easier. I’m on iOS so I don’t have Tasker, which I also think would make things easier.

Here is some psuedo-code explaining in more detail with what I’d like to do:

if (timedayrange &&
location==omwhome &&
mode == Away)
   setmode OMWHome

mode OMWHome
   set tstattemp=78

mode Away
   set tstattemp=82

if (OMW Home Mode for more than 20 minutes) // means I wasn't actually coming home/stuck in traffic
   setmode Away

you might want to look into ifttt. iphone ifttt location which triggers an event on smartthings,

Yeah, I installed ifttt, but when I saw there was no way to do multiple triggers, I kind of gave up on it. Since at a bare minimum I’d need to have a way to say only trigger at certain times, and I’d like to expand upon that and say something like “only when in ‘At work’ mode” for example.

What type of temperature change are you looking to do? And just curious what type of AC do you have for your home?

You could do a IFTTT that when you arrive to work “Changes the mode to Away”. Then when you leave work, the IFTTT could change to a new mode that you select that just turns down the Thermostat for you. Something like Coming Home. Or you could just change to Home?

For right now I’m just looking to set my “home temp” before I get home, so it’s somewhat close to it by the time I get there. It’s a CT100 T-stat.

From messing with IFTTT it looks like you can’t change modes. You can however flip switches. I found that someone created a SmartApp that changes modes based on a switch being flipped. So then I can use that to change to my “OMWHome” mode, which will change the AC temp.

The only problem with that is I need to add safe guards so that I’m actually on my way home, and not just driving around. Then if I don’t make it home, that needs to be handled to turn back off my AC.

It seems like all of this would be WAY simpler if they would add the ability to create multiple geo-fences. Obviously you can create new locations, but since locations can’t interact, that doesn’t help. There should really just be a “Geo-fence” type that we can add new ones to. Have they mentioned if this is being worked on at all?

Hey @flashburn, why not try Life360. You can make multple locations with that and have IFTTT work with that to drive the automation at your home.

Never heard of Life360 before, thanks for the heads up! I’ll check it out now.

It’s definitely a bit annoying not to have the SmartThings app flexible and powerful enough to do all this stuff on it’s own, but I’m having some fun trying to figure out how to hack this all together myself.

It may seem limiting at first, but when compared to the other HA products, SmartThings is way ahead. At least you have ways to get things done here, and if you post on the community board what you need, there are more than a few people who will pipe up and will help you to figure out how to do it in the current environment.

I pretty much agree. It’s just a bit frustrating finding an awesome feature like geo-fencing, and then seeing limitations with it that really shouldn’t exist. Obviously with a new product like this, that’s going to happen though.

Plus, like you said, the community here is really pretty damn awesome.

I messed with Life360 a little, and checked the triggers in IFTTT, but I don’t really see any benefit with using Life360 vs the iOS location, since you can still have only one trigger per recipe.

I think for now, I’m going to try a very rudimentary ruleset that’s as follows:

if(arrive at work) // using LFTTT, trigger the dummyswitch, which will do:
{ setmode work } // work mode does nothing

if(driving home from work) // using LFTTT, when driving past an area on my way home trigger dummyswitch2 (or turn dummyswitch1 off perhaps)
if (currentmode==work) // this is built in to the Mode change SmartApp)
{ setmode=omwhome} // which changes ac

I remember seeing some code to handle turning off a switch after a certain period of time, so I should be able to use that to safeguard if I’m not actually going home.

Obviously this will only work for when I’m coming home from work, but I can probably create some other triggers to help cover other scenarios. Definitely not ideal, but it should be doable.

@flashburn it sounds like you have a good grasp on how to tackle your needs., I would have thought though that once you left Work, that Life360 would have reported the change, which you could then use IFTTT to change the mode at home. Of course, it sounds like what you have in mind will work just as well, and will give you a finer grain of control.

Yeah, I’m sure I could do that with Life360, but IFTTT supports the same ability with using a geofence. One less app means one less failure point.

I had to use a different SmartApp that someone else wrote for running an event (instead of directly triggering a mode) when a switch is turned on and a different one when off. I modified it so that it only runs the event if it’s in the mode I expect it to be in.

I tested it manually by flipping the switch and also having IFTTT send the on/off switch command. Works perfect. Now I’m just hoping that the IFTTT geofencing works, and if so, I should be good. I don’t even think I need to restrict it any more than it is. The only further step I need to do is switch back to Away mode if I don’t make it home after X amount of time after my OMWHome event is sent. After that I’ll probably try to think up a way to have it work for more than just when I’m coming home from work.

Well, so far everything is a COMPLETE bust. Very disappointing first couple days with SmartThings.

The first issue I noticed when I got to work, is that since I left home there were ZERO presence changes. My IFTTT triggers worked (more on this later), but they SmartThings didn’t react to that, or even when I left the house. So I got to work, and my system was still in “Home” mode. I couldn’t even control my thermostat or change modes once I was at work, it did nothing. Immediately when I got on WiFi things seem to be working as normal.

So it seems like I have zero functionality when not on WiFi. Hopefully this is a configuration issue and not some sort of limitation with SmartThings.

The other thing is that IFTTT only polls every 15 minutes, no notifications are real time, so that makes it basically useless. Not sure why everyone loves IFTTT so much, since that severely limits its usefulness in my opinion.

1 Like

Very odd, with regards to the connectivity issue, it works perfectly fine when I switch off LTE. I’m wondering if I’m just running into some Sprint issues or something.

I still need to find a solution for a real-time trigger. There is another one called Zapier, but the free version has 15 minute polling too. You have to pay monthly to get down to 5 minute polling.

Are you saying it works on 2G/3G, but not LTE? Or that it only works on WIFI?

3G/Wifi works fine. LTE doesn’t. But like I said, I’m fairly sure that it’s some sort of Sprint issue, as the other day I noticed an unrelated service also wasn’t working with LTE.

Sounds like there might be some port blocking going on. Contact support to get a list of ports the SmartThings app uses to phone home, then contact Sprint to see if they’re blocking any of those on LTE, (and why).

Good idea, I’ll do that, thanks.

Anyone have any ideas about how to do a geofence trigger without the ~15 minute delay with IFTTT?

Well, you’re on iOS so you will need an app. On Android, you could use something like Tasker or Locale to fire off a HTTP GET to a virtual switch via an oAuth endpoint from as many locations as you wish.

Look for an app in the App store that may be able to do the same thing.

Yeah, I’ve yet to find anything that doesn’t have the same or worse delay in polling.

Geofancy is one geo-fence app I’ve found that can do HTTP Get’s, but it seems highly unreliable so far. Maybe I’ll think about switching to Android.

I’m looking to do the same things with the thermostat, did you ever get the polling time resolved?