Selecting a door in my SmartApp doesn't seem possible


(Dan Barker) #1

I’m trying to write a SmartApp that will allow me to have all my doors closed and/or locked at night. In some apps I can see regular doors and garage doors, but I can’t figure out how to select them in my SmartApp. Is there a way to do this? I’d like to configure everything in one instance of the SmartApp instead of setting this up for each door/sensor combination separately. For example, I’d like to pick each door as a unit so the lock and/or sensor and/or switch comes as a unit. If this isn’t possible, then I’m not sure how to setup multiple lock/sensor/switch combinations inside my SmartApp without having the user setup each lock/sensor/switch independently.


(Keith Croshaw) #2

There’s a Hello Home action to do just that. It fires for me every night as a double check.


(John S) #3

“Doors” that are a combo of a lock and a sensor use the “Doors & Locks” internal smart app. - You don’t get to use that as a template when creating your own app, but you can see that a “Door” subscribes to events from both a sensor and a lock - If you wanted to recreate that in your app you’d have to do the same.

Or as @keithcroshaw suggests, a better way is to create a Hello Home phrase (“lock up” maybe?) which locks the doors you want. They you just trigger that phrase in your smart app

location.helloHome.execute("lock up")

when you want to lock up - as far as I can tell “location.helloHome” isn’t currently documented, but there are examples that use methods of it - execute and

def actions = location.helloHome?.getPhrases()*.label

Gets you an array of the strings of the currently defined phrases.