SmartApp Device Handler Not Working


(Casey Roe) #1

I am having some issues with my Device Handler and Status. subscription looks fine and i receive the log.debug response for subscription but i never receive the “thermostatsHandler success” even though everything to me looks to be correct. Any ideas on why this is not working?

def installed() {
subscribe(thermostats, “thermostat”, thermostatsHandler)
subscribe(thermostats, “thermostatSetpoint”, thermostatsHandler)
subscribe(thermostats, " thermostatOperatingState", thermostatsHandler)
subscribe(thermostatCoolingSetpoint, “coolingSetpoint”, thermostatsHandler)
subscribe(thermostats, “generateStatusEvent”, thermostatsHandler)
log.debug “subscribed ThermostatMode”
}
def updated() {
unsubscribe()
subscribe(thermostats, “thermostat”, thermostatsHandler)
subscribe(thermostats, “thermostatSetpoint”, thermostatsHandler)
subscribe(thermostats, " thermostatOperatingState", thermostatsHandler)
subscribe(thermostatCoolingSetpoint, “coolingSetpoint”, thermostatsHandler)
subscribe(thermostats, “generateStatusEvent”, thermostatsHandler)
log.debug “subscribed ThermostatMode”
}

def thermostatsHandler(evt) {
log.debug “thermostatsHandler success"
if (evt.name == “temperature”) {
SendUpdate(”/${evt.deviceId}=Temp=${evt.value}")
}
if (evt.name == “heatingSetpoint”) {
SendUpdate("/${evt.deviceId}/=HeatSP=${evt.value}")
}
if (evt.name == “coolingSetpoint”) {
SendUpdate("/${evt.deviceId}/=CoolSP=${evt.value}")
}
if (evt.name == “thermostatMode”) {
SendUpdate("/${evt.deviceId}/=SystemMode=${evt.value}")
}
if (evt.name == “thermostatFanMode”) {
SendUpdate("/${evt.deviceId}/=FanMode=${evt.value}")
}

}

And here is what I see in Debugger:
ogsClear
5b015db1-a0d0-4630-8c93-0215ea3fff25 5:20:36 PM: debug Thermostat Updated
bbfc722b-5b95-4ae6-868c-0860412c9b9b 5:20:35 PM: info call pollChildren with child: HOUSE
18fba97c-cb0a-4656-902f-a902b5d07bef 5:20:35 PM: debug Executing ‘poll’ using parent SmartApp
18fba97c-cb0a-4656-902f-a902b5d07bef 5:20:36 PM: debug Generate Status Event = Cooling to 72 F
18fba97c-cb0a-4656-902f-a902b5d07bef 5:20:36 PM: debug generateStatusEvent: mode:cool, temperature:79, heatingSetpoint:65, coolingSetpoint:72
18fba97c-cb0a-4656-902f-a902b5d07bef 5:20:36 PM: debug thermostatMode:cool, heatingSetpoint:65, coolingSetpoint:72
18fba97c-cb0a-4656-902f-a902b5d07bef 5:20:36 PM: debug Generate SetPoint Event: scale:F
18fba97c-cb0a-4656-902f-a902b5d07bef 5:20:36 PM: debug scale:F, parsing data [deviceAlive:true, deviceTemperatureUnit:F, coolingSetpoint:72, minCoolingSetpoint:50, thermostatFanMode:on, allowedFanModes:[Auto, On, Circulate], maxHeatingSetpoint:90, temperature:79, heatingSetpoint:65, minHeatingSetpoint:40, humidity:49, thermostatMode:cool, allowedModes:[Cool, Heat, Off], maxCoolingSetpoint:99]
18fba97c-cb0a-4656-902f-a902b5d07bef 5:20:35 PM: debug Generate Status Event = Cooling to 72 F
18fba97c-cb0a-4656-902f-a902b5d07bef 5:20:35 PM: debug generateStatusEvent: mode:cool, temperature:79, heatingSetpoint:65, coolingSetpoint:72
18fba97c-cb0a-4656-902f-a902b5d07bef 5:20:35 PM: debug thermostatMode:cool, heatingSetpoint:65, coolingSetpoint:72
18fba97c-cb0a-4656-902f-a902b5d07bef 5:20:35 PM: debug Generate SetPoint Event: scale:F
bbfc722b-5b95-4ae6-868c-0860412c9b9b 5:20:35 PM: debug Trying to hit URI: https://tccna.honeywell.com/WebAPI/api/devices/2328439/thermostat/changeableValues/coolSetpoint using auth token: JhHOEGMi1MbyOxZK4PfDZA11TH1Y_NZvhdLpCyfhMXn2IIl6zhDJYRgElgFN-skZOyn5SOuY2GYUGghND8B1g-U4qgadLooHBU9jPInaKQwlPdYAFkvvBMp4LqOZ4Wshd7fGz62rMTze-BK7bg9hKwqTzd4ob3aXtzR0cbtY0BKELdFIibBLdd4ot2eRj0vtPoSwb17WvJEF3shcq_bnrqh39CN13GkLLPiVHaaRHu5HBLgbAri7u__en-_U0h0M3-ffxjKhLYceeJoCM1Q3bZhWUWvcYuYT1rF-nJhno9w5AMExK02gRxEFI_rdhM6IorXbcwpJD5ydYzXeAFqr0_gJiVOLHg2Qh3SDtMHMdkEx5AbwBOVlZemuCURe1Qo0aekqDtIDvi93XILDLWNXqudNpeqn-Xu87M3EAVnpQwt6TZrJDOkbInT603pit5Dx8GcV7r4NU5e68SjBWztfPTOxPyT1WDyywhB_80Prljf55YkWNIYqPd00-SLFFPYE-MirqImhZClOGcHBXb2sqYkRSJcX8kJvcCKUuSmSsaBXZuYbHxDBV0AI7_wfYpQQCGyScl6XwgPO0atddHJELieHlHnJF3SDEM5OcM4M6FxLiTrn and Value: 72
18fba97c-cb0a-4656-902f-a902b5d07bef 5:20:35 PM: debug Sending setCoolingSetpoint> coolingSetpoint: 72, heatingSetpoint: 65
18fba97c-cb0a-4656-902f-a902b5d07bef 5:20:35 PM: debug ***cooling setpoint 72
5b015db1-a0d0-4630-8c93-0215ea3fff25 5:20:21 PM: debug subscribed ThermostatMode


(Eric) #2

Hello…

1 - You posted this in two separate posts.
2 - You might not want to post your honeywell authentication token.

Is something not working other than missing the log statement?


(Casey Roe) #3

Thanks I should have thought of that. I was finally able to get everything
working. Turns out you have to have discreet thermostat handlers for each
event type instead of just a global thermostat handler. Also it only
updates when a change is made which I dont really like incase I need to
poll what the current settings are at startup. Other than that things are
working well.