Trying to learn how to create SmartApps


(Shawn) #1

Hi,

I registered today as a developer I am trying to write some smart apps or have someone help write them for me who is better skilled in this area.

Here are some of the apps Im trying to create:

SmartApp which Unlocks the Doors When Someone Arrives Home

When Someone arrives home (via Presence sensor or iPhone location) (would be great if you could add multiple people for example 2 sensors and 1 iPhone all in one app)

  1. Which People:
    Person 1 (iPhone Location from SmartThings app)
    or
    Person 2 (SmartThingsPresence Sensor 1)
    or
    Person 3 (SmartThingsPresence Sensor 2)

  2. Unlock Front Door (two specified door Locks trigger both at same time not one after the other)

Which locks do want to control?

Lock 1
Yale Deadbolt

and

Lock 2
Yale Lever Lock
http://www.yaleresidential.com/en/yale/yaleresidential-com/Residential/?groupId=1294297&productId=1294301

If they are not already unlocked


SmartApp which Makes Sure the Front Door is Locked When you Leave the House and ONLY if the front door is closed

When Someone leaves home (via Presence sensor or iPhone location) (would be great if you could add multiple people for example 2 sensors and 1 iPhone all in one app)

  1. Which People:
    Person 1 (iPhone Location from SmartThings app)
    or
    Person 2 (SmartThingsPresence Sensor 1)
    or
    Person 3 (SmartThingsPresence Sensor 2)

  2. Front Door is Confirmed Closed (via SmartThings Multisensor)

If Front Door is not Closed don’t lock the locks as the deadbolt will stick out and possibly get damaged.

  1. Lock The Front Door (two specified door Locks trigger both at same time not one after the other)

Which locks do want to control?

Lock 1
Yale Deadbolt

and

Lock 2
Yale Lever Lock
http://www.yaleresidential.com/en/yale/yaleresidential-com/Residential/?groupId=1294297&productId=1294301

If anyone can help out that would be great

Thank-you,

Shawn


(Nicholas Wilde) #2

Have you tried looking at the “Top SmartApps” for locks? I think they might suffice. I don’t know if ST supports your specific Yale locks out-of-the-box, but you can always add a custom device type with the help of the community.


(Matt Nohr) #3

Like @NickW said, I would first see if you can use the provided SmartApps.

For the case of checking if the door is open, you could look at the “Lock It When I Leave” example SmartApp in the IDE. You could add a door to check before locking the door.

Something like:

if(door1.latestState('contact') == 'closed') {
    lock1.lock()
}

This assumes you have added a “door1” input. Also, it is a little tricky since this app allows for multiple locks, but hopefully that helps.