Two CT100 Thermostats appear to be conflicting while updating?


(Landon) #1

I’m really new to this, so I’m not even sure this is possible. I have two CT100’s installed, and a total of 6 “keep me cozy” smartapps installed. One for each thermostat for home/away/night modes. Both thermostats are working very well, and responding to the mode changes in 1-2 seconds. However, the problem comes when they report the new temperature setting. Only one thermostat will report the change; which thermostat appears to be random. I’ve just noticed this issue today, so I’ll do more testing while I’m at work tomorrow to see if perhaps it is just slow, but I’ve waited ~20 minutes several times and no update from the other thermostat. In each case, I’m able to go into the device and push the refresh button, and it will update to show the correct info.

Anyone seen this before? Thanks in advance!


(Eric) #2

not sure but I think Refresh is just a fresh display. Try looking at the physical device to see if your expected change occurred.


(Landon) #3

Yeah the actual changes are happening instantaneously. Really, the root of the problem is that it doesn’t update my smarttiles properly. Eventually, I’d like to get this set up so that I don’t need to use the ST app at all in the day-to-day, so having the tiles report the correct info is important.

If I push refresh on the offending thermostat, the tile updates immediately, also.


(Landon) #4

I figured it out. I found an error in the logs. Not sure if its my firmware version or what, but my thermostats do not like the poll() command. They report that it is an invalid command. I changed poll() to refresh() and it worked great. Then I ran into another issue of the heating and cooling setpoints not both reliably setting, so I made it so that only the active mode will change. ie if mode is cool, only change cool setpoint. Here’s the code in case anyone else has the problem:

   /**
 *  Copyright 2015 SmartThings
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 *  Keep Me Cozy
 *
 *  Author: SmartThings
 */
definition(
    name: "Keep Me Cozy",
    namespace: "smartthings",
    author: "SmartThings",
    description: "Changes your thermostat settings automatically in response to a mode change.  Often used with Bon Voyage, Rise and Shine, and other Mode Magic SmartApps to automatically keep you comfortable while you're present and save you energy and money while you are away.",
    category: "Green Living",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/temp_thermo.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/temp_thermo@2x.png"
)

preferences {
	section("Choose thermostat... ") {
		input "thermostat", "capability.thermostat"
	}
	section("Heat setting...") {
		input "heatingSetpoint", "number", title: "Degrees?"
	}
	section("Air conditioning setting..."){
		input "coolingSetpoint", "number", title: "Degrees?"
	}
}

def installed()
{
	subscribe(thermostat, "heatingSetpoint", heatingSetpointHandler)
	subscribe(thermostat, "coolingSetpoint", coolingSetpointHandler)
	subscribe(thermostat, "temperature", temperatureHandler)
	subscribe(location, changedLocationMode)
	subscribe(app, appTouch)
}

def updated()
{
	unsubscribe()
	subscribe(thermostat, "heatingSetpoint", heatingSetpointHandler)
	subscribe(thermostat, "coolingSetpoint", coolingSetpointHandler)
	subscribe(thermostat, "temperature", temperatureHandler)
	subscribe(location, changedLocationMode)
	subscribe(app, appTouch)
}

def heatingSetpointHandler(evt)
{
	log.debug "heatingSetpoint: $evt, $settings"
}

def coolingSetpointHandler(evt)
{
	log.debug "coolingSetpoint: $evt, $settings"
}

def temperatureHandler(evt)
{
	log.debug "currentTemperature: $evt, $settings"
}

def changedLocationMode(evt)
{
	log.debug "changedLocationMode: $evt, $settings"
	log.debug "${thermostat.currentThermostatMode}"
    def tm = thermostat.currentThermostatMode
    
    if (tm in ["cool", "auto"]){ //AC
		thermostat.setCoolingSetpoint(coolingSetpoint)
    	thermostat.refresh()
    }
    else if (tm in ["heat", "emergency heat", "auto"]){ //HEAT
		thermostat.setHeatingSetpoint(heatingSetpoint)
		thermostat.refresh()
    }
}

def appTouch(evt)
{
	log.debug "appTouch: $evt, $settings"

	log.debug "${thermostat.currentThermostatMode}"
    def tm = thermostat.currentThermostatMode
    
    if (tm in ["cool", "auto"]){ //AC
		thermostat.setCoolingSetpoint(coolingSetpoint)
    	thermostat.refresh()
    }
    else if (tm in ["heat", "emergency heat", "auto"]){ //HEAT
		thermostat.setHeatingSetpoint(heatingSetpoint)
		thermostat.refresh()
    }
}

// catchall
def event(evt)
{
	log.debug "value: $evt.value, event: $evt, settings: $settings, handlerName: ${evt.handlerName}"
}

(Chris LeBlanc) #5

I have 3 ct100 and have yet to find a decent solution for only one setpoint setting. Have you had problems with your solution not switching to heat or cool if on auto?