Hi: I can’t figure out why the following temperatureHandler() is reachable in the simulator when I use the virtual sensor but isn’t called when I substitute in either of the smartThings moisture or multi sensors. I’ve tried variations, as well as the ‘too cold’ demo. (BTW, I can catch the Open/Closed states no problem with the multi sensor…)
Any suggestions are appreciated:
definition(
name: “kitchen temperature”,
namespace: “”,
author: “n/a”,
description: “n/a”,
category: “My Apps”,
iconUrl: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png”,
iconX2Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”,
iconX3Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”)
preferences {
section(“Temp”) {
input “tempSensor”, “capability.temperatureMeasurement”
}
}
def installed() {
log.debug "Installed with settings: ${settings}"
initialize()
}
def updated() {
log.debug "Updated with settings: ${settings}"
unsubscribe()
initialize()
}
def initialize() {
subscribe(tempSensor, “temperature”, temperatureHandler)
}
def temperatureHandler(evt) {
log.debug(“handler finally reached”)
def currentState = tempSensor.currentState(“temperature”)
log.debug “temperature value as a string: ${currentState.value}”
}