Hi, all. Two issues:
(1) I'm trying to get the mode change event to trigger, but it won't.
(2) I also don't see any call to installed() or updated() when I change the code (there's nothing logged as the code below would imply).
Is there something obvious that I've got wrong?
Thanks for the help!
definition(
name: "Temperature Manager",
namespace: "ns",
author: "Len Hodder",
description: "Building Temperature Manager",
iconUrl: "",
iconX2Url: "",
iconX3Url: "",
singleInstance: true)preferences {
page(name: "pageConfig")
}def pageConfig() {
dynamicPage(name: "", title: "", install: true, uninstall: true, refreshInterval:0) {section("Inputs") { input "disableSchedule", "capability.switch", title: "Disable Schedule", required: true input "officeThermostat", "capability.thermostat", title: "Office Thermostat", required: true input "eastShopThermostat", "capability.thermostat", title: "East Shop Thermostat", required: true input "westShopThermostat", "capability.thermostat", title: "West Shop Thermostat", required: true }
}
}def installed() {
log.debug "installed"
initialize()
}
def updated() {
log.debug "updated"
unsubscribe()
initialize()
}
def initialize() {
log.debug "initialize"
unschedule()
runEvery1Minute(checkDevices)subscribe(location, "mode", modeEvent)
//if(modes) subscribe(location, modeEvent)
//Refresh devices
subscribeNow()
runRefresh()
}
def uninstalled() {
log.debug "uninstalled"
}// Schedule refresh
def modeEvent(evt) {
log.info "New mode at " + now() + " is " + location.mode
// Force Refresh now!
refresh()
}def checkDevices() {
log.debug "checkDevices" + disableSchedule
log.debug "office setpoint " + officeThermostat.currentValue("heatingSetpoint")
}def refresh() {
log.debug "refresh"
}def runRefresh() {
log.debug "runRefresh"
}