Hi all,
I am enhancing my custom garage door handler. It uses separate z-wave door contacts to determine whether it’s open or closed, but I want to display that status in my Device Type.
I created a Preferences section in the Device Type like you would in a SmartApp, and I can select the sensors - but when I try to access them it doesn’t work. Is this not possible in a Device Type?
Instead of getting “open” or “closed” I’m getting something like: physicalgraph.app.AttributeWrapper@3c1b85e8
preferences {
section("Doors") {
input "doorSensor1", "capability.contactSensor", title: "Left door sensor"
input "doorSensor2", "capability.contactSensor", title: "Middle door sensor", required: false
input "doorSensor3", "capability.contactSensor", title: "Right door sensor", required: false
}
}
def refresh() {
log.debug "*** Checking Door Sensors ***"
if (doorSensor1) {
log.debug "Door 1"
log.debug doorSensor1.contact
if (doorSensor1.contact == "open") {
Opened1()
} else {
Closed1()
}
}
if (doorSensor2) {
log.debug "Door 2"
log.debug doorSensor2.contact
if (doorSensor2.contact == "open") {
Opened2()
} else {
Closed2()
}
}
if (doorSensor3) {
log.debug "Door 3"
log.debug doorSensor3.contact
if (doorSensor3.contact == "open") {
Opened3()
} else {
Closed3()
}
}
}