Hello,
I am not new to Smartthings, but I am failry new to programming custom apps in Groovy. I am trying to create a fairly basic app that checks my garage door status (multisense) upon leaving the house. I have pasted by current code below. I cannot get my door status to not read ‘null’. I’m sure it’s something very basic, but I think I’m following all the examples on the help page.
preferences {
// What door should this app be configured for?
section (“Check these doors”)
{
input “garageDoor”, “capability.contactSensor”
}
section(“Send Notifications?”)
{
input(“recipients”, “contact”, title: “Send notifications to”)
}
}
def installed() {
subscribe(location, “mode”, modeChangeHandler)
}
def modeChangeHandler(evt)
{
def doorState1 = garageDoor.status
def doorState2 = garageDoor.temperature
def doorState3 = garageDoor.contact
log.debug “mode is changed to ${evt.value}”
sendNotificationToContacts(“Mode is changed to ${evt.value}”, recipients)
checkDoor()
}
def checkDoor()
{
sendNotificationToContacts("Garage Door is ${doorState1}, ${doorState2}, ${doorState3} ", recipients)
}