Door Left Open for "X" Min = Mode Change

I’m new to ST and I’m trying to find a way to have my AC change its setting if a door is left open for X minutes. I’ve decided an easy way is to create a “door open” mode and change the AC settings within it. But my issue is that I can’t find where I can trigger a mode change based on a door being open for X minutes (using a door contact) - I can only find alerts for that. Anyone have any ideas?

You probably want an App to set a timer to change to the door open mode in x minutes when you get the door open event, then cancel the timer if you see a door closed event.

That sounds like it would work. Do you know if a timer app already exists? Where can I find apps that others have written and posted to the site?

You could probably review my modified app for door left open (with repeating alerts) and adjust for your needs. I think your magic will need to happen somewhere in line 66 or 68 (based on my version 1.3.1 code).

To simply change modes, you will need setLocationMode(“modename”) or
def doorleftopenmode = "modename"
setLocationMode(doorleftopenmode)

You could also look at Virtual switch to change mode to get an idea of changing home modes.

If you need to run actions that you have defined in a Hello Home phrase (adjust lights, thermostats, home modes, etc), and I think this is what you are wanting, you could call out to that phrase using: location.helloHome.execute(“hello home phrase here”).
For example:
def myHHPhrase = "Nice Outside"
location.helloHome.execute(myHHPhrase)

Thanks Brian. I’ve tried copying in the code but I’m new to this. It’s not working for me. In a nutshell, what you sent is very close to what I need. I just need an app to change the thermostat temperature after a door contact has been open for X amount of minutes. An option to also change to a different mode what that occurs would be good too. Any help is appreciated.

Should be fairly simple to do.
I’ll try to take a look at doing that sometime this week or weekend if someone else doesn’t get it done first.
I would probably replace the repeating alarm with a single thermostat setpoint change and option to run a Hello Home action, then possibly an option to revert back when the door is closed.

Beta code is up here in the testing branch: https://github.com/rayzurbock/SmartThings-DoorLeftOpen/tree/testing
Beta version release: 1.3.2-Beta1
If nasty bugs are not found, I’ll roll it over out of beta soon.

I recommend uninstall of the previous version for each door/contact sensor that it has been installed for prior to changing the code and reinstalling this version.

  • Added dynamic pages
    • App initially starts with an overall configuration status page with an option to click to configure the app
  • Added option to run a Hello Home action when a door is left open
    • This action will only be run on the first alert (until the contact closes and a new alert is later caused again)
    • Added Optional Hello Home action on alert clear (contact closure)
      • Hello Home actions allow you to change your home mode, thermostat settings among other things, so rather than build these into the SmartApp, I am relying on the configuration of desired Hello Home Actions to do the same thing.
      • This feature should probably only be configured on 1 door that could be in alert state at a time as the app does not look to see if other doors have already run a hello home. There could easily be an alerting conflict where one door changes the mode/action another door set.

Thanks Brian. At first glance, this looks like it should do the trick. I won’t have a chance to test it until the end of the month but will let you know. Thanks again!

1 Like

Version 1.3.3 has been released. Details here: Door left open (with Photo Burst, Hello Home, & Speech), Version 1.3.5

I based an app off of @rayzurbock’s, to make it a little more tailored to my needs. Plus, I wanted to create a simple app for my first SmartThings app and this seemed like a good place to start.

The differences in my app are:

  • I removed the camera, voice, and Hello Home features as I don’t use them.
  • Time is in seconds instead of minutes.
  • You can send SMS messages to up to two phones.
  • You set how many times the message is repeated.
  • You can turn push messages on and off.

https://github.com/PurelyNicole/SmartThings-DoorLeftOpen

1 Like

Awesome! Exactly what I was looking for! Thanks…

Modified the code to use minutes instead of seconds.

Now just need to add for specific modes (away mode)

I can add the modes sometime this weekend if you’d like. I’ll probably need them eventually anyway.

FWIW, you can put over 60 seconds in the field to get to minutes.