ok so super simple app, when sensor A is open turn off the thermostat and turn on the fan, that part is working just fine. The issue is the eventhandler for closing the sensor. It doesn’t turn the thermostat back on or set the fan to auto and I don’t know why. I’ve got to be missing the syntax of the command but I don’t see it. the very small code block is as follows from the preferences block, any input would be apprecieated, actual thermostat is Honeywell lyric v2(maybe there is an issue there?):
preferences {
section(“Select Window Sensor”) {
input “windowsensor”,“capability.contactSensor”, required: true, title:“Select Sensor”
}
section("Choose thermostat… ") {
input “thermostat”, “capability.thermostat”, required: true, title:“Select Thermostat”
}
}
def installed() {
log.debug "Installed with settings: ${settings}"
subscribeToEvents()
}
def updated() {
log.debug "Installed with settings: ${settings}"
unsubscribe()
subscribeToEvents()
}
def subscribeToEvents() {
subscribe(windowsensor, “contact.open”, openHandler)
subscribe(windowsensor, “contact.closed”, closeHandler)
}
def openHandler(evt) {
log.debug "openHandler called: $evt"
thermostat.off()
thermostat.fanOn()
}
def closeHandler(evt) {
log.debug "closeHandler called: $evt"
thermostat.auto()
thermostat.fanAuto()
}