[RELEASE] Lennox iComfort Thermostat

I worked fine for me. Tested with Lumia 520 and 920.

2d35c6bd-1a3a-4fd5-ab29-52071dce509c ‎3‎:‎07‎:‎13‎ ‎PM: debug HTTP GET response: [tStatlookupInfo:[[Lang_Nbr:0, description:cool only, ReturnStatus:SUCCESS, name:Operation_mode, value:2, sort_order:0], [Lang_Nbr:0, description:heat only, ReturnStatus:SUCCESS, name:Operation_mode, value:1, sort_order:1], [Lang_Nbr:0, description:heat or cool, ReturnStatus:SUCCESS, name:Operation_mode, value:3, sort_order:2], [Lang_Nbr:0, description:off, ReturnStatus:SUCCESS, name:Operation_mode, value:0, sort_order:3], [Lang_Nbr:0, description:emergency heat, ReturnStatus:SUCCESS, name:Operation_mode, value:4, sort_order:4]], ReturnStatus:SUCCESS] 


2d35c6bd-1a3a-4fd5-ab29-52071dce509c ‎3‎:‎07‎:‎13‎ ‎PM: debug HTTP GET request: [uri:https://jasonmok:************@services.myicomfort.com, path:/DBAcessService.svc/GetTstatLookupInfo, query:[name:Operation_Mode, langnumber:0]] 


2d35c6bd-1a3a-4fd5-ab29-52071dce509c ‎3‎:‎07‎:‎13‎ ‎PM: debug HTTP PUT response: [msg_code:SUCCESS, msg_desc:Success] 


2d35c6bd-1a3a-4fd5-ab29-52071dce509c ‎3‎:‎07‎:‎12‎ ‎PM: debug HTTP PUT request: [uri:https://jasonmok:************@services.myicomfort.com, path:/DBAcessService.svc/ValidateUser, query:[UserName:jasonmok, lang_nbr:1]]

Figured it out. Turns out that the service doesn’t like passwords with special characters in them. Probably thinks it is some kind of URL encoding attack.

Makes sense, and I don’t know why I didn’t think of that before, quite honestly.

Thanks for the help/

First thank you for creating this Smart App and Device!! Great job.

I was able to successfully add the Smart App and Smart Device in the SmartThings website. I then was able to add the Smart App, configure it with my iComfort credentials, and then add the SmartDevice within the app. All this worked fine.

However now whenever I go to my “Things” page within the SmartThings iOS app all my “Things” are missing. All the other categories inside the SmartThings iOS App (Lights & Switches, Doors & Locks, etc) appear to be fine. If I remove the iComfort SmartAPp and Smart Device my “Things” return. Any ideas?

I installed this today using the code in this github repository: https://github.com/copy-ninja/SmartThings_iComfort

Thanks,
Paul

This is a weird behavior. It’s probably my latest codes broke it. Did you have this problem when you install it last time?

I’ll take a look at it tonight to see if the codes in GitHub is in sync with the codes I have in ST.

Looks like the issue is because my SmartThings Timescale in the iOS App preferences is set to Celsius. When I change it to Fahrenheit my “Things” re-appear. Hopefully you can re-create the issue now.

I think the problem has existed since the last SmartThings iOS update, or the one just before that. I had to uninstall the iComfort SmartApp back then, and didn’t have time to troubleshoot the issue at the time. Hopefully this is something you can re-create and easily correct?

Thanks again for taking the time to build this.

Paul

I have updated the codes and merged both Android and Non-Android version to one single master. For those who wish to update, you will need to reinstall everything.
This will fix issues with celcius display on all OS. IOS will not display decimal points for celcius until SmartThings update the iOS app.

Also, this should fix the background schedules that updates the data. ST is currently plagued with those schedules dying with unknown causes. So, you most likely won’t need to press refresh anymore, but the data should update automatically.

Thanks for fixing the app (iOS celcius display decimal points issue). Works great now. Hopefully SmartThings fixes the decimal point issue as they are nice to have when using celcius.

Is this still working (@copyninja)? I noticed that my “things” group in smartthings went blank a few months ago. Once I deleted the app everything came back.

Tried to get this going today using v1.3a on Github. Seems to always give the following error when setting up:

error java.lang.NullPointerException: Cannot set property ‘last’ on null object @ line 331

It is working for me. You need to delete the app from your phone, paste the app from github and install the app again.

Weird, did that… still getting:

error java.lang.NullPointerException: Cannot set property ‘last’ on null object @ line 331

Should I try using the “Troubleshoot” toggle when first installing it on the iOS app?

Try with the latest 1.4

@copyninja - works great now, thanks. Love that you even worked in the away button! This will help with my ultimate plan of putting the iComfort in away mode after a period of motion inactivity (and then back on motion sense).

Odd - I’m getting the 318 error now out of nowhere :frowning:. Stopped working around 11am EST.

java.lang.NullPointerException: Cannot invoke method executeMethod() on null object @ line 318

There was an update on ST backend that broke my codes. I’ve put up a fix on the github.

@copyninja - many thanks, works great.

Can anyone help with this use case?

I would like to have @copyninja 's iComfort app turn away mode “on” after a period of motion inactivity (say 1 hour), and turn away mode back off when motion is sensed. This (in my opinion) would be a killer use/app - essentially providing the presence functionally of nest but with multiple sensors and Lennox’s variable load capacity to boot.

I have an app that I use to turn lights on/off right now that I would like to modify - just need some direction (I’m not a programmer … but I can (barely) take other peoples work and revise it to make it work for my purposes).

Any help is appreciated.

I guess to start, what would I need to write so that I can change the mode to “away” in @copyninja iComfort app?

/**
 *  Turn light on with motion for x minutes on motion
 *
 *   Written by Aaron Herzon
 *
 *  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.
 *
 */

definition(
    name: "Nightlight (Dimmable)",
    namespace: "TC",
    author: "TC",
    description: "Dimmable Nightlight",
    category: "Safety & Security",
    iconUrl: "http://cdn.marketplaceimages.windowsphone.com/v8/images/c7615463-1173-4d2a-a239-9f1b956a53aa?imageType=ws_icon_small",  
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
    iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png")
    //todo:  replace icon with something appropriate.  


preferences {
	section("Select Motion Sensor(s) you want to Use") {
        input "motions", "capability.motionSensor", title: "Motion Detector", required: true, multiple: true
	}
    section("Select Dimmers you want to Use") {
        input "switches", "capability.switchLevel", title: "Dimmer Switches", required: false, multiple: true
	}
    section ("Set Brightness for motion-triggered light and on time after motion stops") {

        input "BrightLevelStr", "number", title: "Motion-Sensed Level %", required: true, 
        	defaultValue: "100"

        input "DelayMinStr", "number", title: "Bright Delay After Motion Stops, minutes", required: true, 
        	defaultValue: "5"
        	}
}
def installed() {
	log.debug "Installed with settings: ${settings}"

	initialize()
}

def updated() {
	log.debug "Updated with settings: ${settings}"

	unsubscribe()
	initialize()
}

def initialize() {
	log.debug "initialize()"

    state.BrightLevel = BrightLevelStr as Integer
   	if (state.BrightLevel == 100) {
    	state.BrightLevel = 99
    }
    state.DelayMin = DelayMinStr
    

    subscribe(motions, "motion.active", handleMotionEvent)
    subscribe(motions, "motion.inactive", handleEndMotionEvent)
	subscribe(location, "mode", modeChangeHandler)

}


def handleMotionEvent(evt) {
	log.debug "Motion detected..."

    unschedule(turnLightsOff)

    if (state.lightIsOn) {
        log.debug "... light already on (do nothing)"
        }
    else {
    	   	switches?.setLevel(state.BrightLevel)
        	state.lightIsOn=true
        	log.debug "...turning lights on"
        }
        
	}

def handleEndMotionEvent(evt) {
	log.debug "Motion stopped..."

    if (state.lightIsOn) {
    	runIn((state.DelayMin*60), turnLightsOff)
       }

}

def turnLightsOff() {   

	log.debug "turnLightsOff()" 

    switches?.setLevel(99)
    switches?.setLevel(0)
    state.lightIsOn=false
}

def modeChangeHandler(evt) {
	log.debug "Mode Changed... turn state.light off"

    	state.lightIsOn=false
        runIn((state.DelayMin*60), turnLightsOff)

}

@sidjohn1 has thermostat Auto Away and Auto Home that should be compatible. I haven’t personally tested myself.

I was able to get it going… thanks for writing this app, proving very useful in my household!

/**
 *  
 *
 *   Written by Tuffcalc
 *
 *  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.
 *
 */

definition(
    name: "Thermostat (Away/Present on Motion)",
    namespace: "tuffcalc",
    author: "tuffcalc",
    description: "Thermostat (Away/Present on Motion)",
    category: "",
    iconUrl: "http://www.bayareaheatingandcooling.com/wp-content/uploads/2014/01/thermostat-icon-150x150.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("Select Motion Sensor(s) you want to use") {
        input "motions", "capability.motionSensor", title: "Motion Detector", required: true, multiple: true
	}
    section("Select Thermostat you want to use") {
        input "thermostat", "capability.thermostat", title: "Thermostat", required: false, multiple: true
	}
    
        input "DelayMinStr", "number", title: "Turn on AWAY mode after how many minutes?", required: true, 
        	defaultValue: "120"
        	
}
def installed() {
	log.debug "Installed with settings: ${settings}"

	initialize()
}

def updated() {
	log.debug "Updated with settings: ${settings}"

	unsubscribe()
	initialize()
}

def initialize() {
	log.debug "Initialize... starting app and setting mode as HOME."
   
    state.DelayMin = DelayMinStr
    state.Home=true
    thermostat?.present()

    subscribe(motions, "motion.active", handleMotionEvent)
    subscribe(motions, "motion.inactive", handleEndMotionEvent)

}


def handleMotionEvent(evt) {
	log.debug "Motion detected."

    unschedule(putAwayMode)

    if (state.Home) {
        log.debug "Thermostat already in HOME mode (do nothing)."
        }
    else {
    	   	thermostat?.present()
        	state.Home=true
        	log.debug "Putting thermostat in HOME mode."
        }
        
	}

def handleEndMotionEvent(evt) {
	log.debug "Motion stopped."

    if (state.Home) {
    	runIn((state.DelayMin*60), putAwayMode)
       }

}

def putAwayMode() {   

	log.debug "Putting thermostat in AWAY mode." 
    thermostat?.away()
    state.Home=false
}

I just got a new Hub v2 and installed the Devices and Smart apps for my iComfort with 2 zones. It recognized them at first and showed them as Active in my Devices list but now they are listed as Inactive. When they were active I could only get one zone to show feedback correctly. Any help would be appreciated. I currently have my Polling set to 1 minute on each device.

I am a new user so it is limiting me to 3 replies in the separate post.

So I should only have (1) SmartApp but (2) Devices? I appears that you can only see the downstairs zone when it is in away mode. As for the error, I deleted my devices and started them again and didn’t get the error.