Sensi Thermostat


#1

I have two Sensi thermostats and wanted to know does anyone have any new information about integration with SmartThings. These were the least expensive at the time for me and also qualified for the rebate. I have everything integrated with SmartThings expect for my Sensi thermostats. I saw some older post saying Emerson did not have an open API available. The community here is very resourceful, so I was hoping someone may know or try something new. Thanks in advance for any feedback.


[RELEASE] Enhanced Z-Wave Plus Thermostat (CT30/CT50/CT80/CT100/CT101/CT110/ZTS110/ZTS500/GoControl/Honeywell/Universal) Device Handler with Battery, Humidity, Lock Controls, Clock Set, Alarm, Swing/Temp, Deadband Configuration and Updated User Interface
(Cris Gomide) #2

Hoping for the same…


(Kirk Brown) #3

Hey guys… I don’t actually own a Sensi Thermostat, but my brother does. I have been working on writing up a SmartApp and the Device Handler for Emerson Sensi. The API is still not open. The interface does its best to mimic a web browser. I followed some other programming language examples and came up with the following. Have you ever installed Custom SmartApps and Device Handlers? You should be able to copy and paste those in directly. Unfortunately, the only way I could see to log in to the Sensi website via this interface requires you store your username and password in the app itself. So if you’re comfortable with that then you should load it up, try it out and let me know what issues you have.

I can’t really test the app out myself all that well…

The SmartApp and Device Type are located at https://github.com/kirkbrownOK/SensiThermostat

Thanks to :



#4

Thanks a million times, got everything installed and looks good so far. I haven’t had much time to test it out, but basic functions seem OK so far.


(James Church) #5

I also installed today and it seems to work great with the exception of Google Home voice control. Google says it received the command and smart-things shows it was received but the thermostat does not adjust. None voice control works awesome. Thanks.


(David Trigo) #6

I just installed as well. Works perfectly. Been looking for this solution for about 2 years. The Sensi thermostats work great, but only delivered Echo integration. Thanks so much for contributing.


(James R) #7

Kirks Sensi Thermostat driver and App are great! Thanks to Kirk for taking the initiative to make this happen. I’ve been playing around with it for several days and am very pleased with the results.


(Nrg Zing) #8

I’ve tried to set it up a few times, but when I get to the last step where I have to hit “Done” to save the smartapp parameters, it crashes with an “unknown error” and can never save. Tried last night and again this morning. It seems my two thermostats though, which is good ?


(Nrg Zing) #9

Figured it out by looking at the live log in the IDE. Apparently it doesn’t like this > physicalgraph.scheduling.CronExpressionException: Invalid cron expression found ‘0 0/240 * * * ?’ @ line 150

I thought it refers to seconds, but apparently it’s minutes ? So I set it to poll every 5 minutes and it was able to save the settings and setup properly. Thanks for the great app by the way!!!


(Kirk Brown) #10

That’s a good catch. The SmartThings scheduling system won’t let you set schedules that are less than 1 minute. I added a (minutes) line to the poll rate input statement. Additionally I added a statement to check if the minutes were set to more than 59 and will drop back to 5 if that does happen.

Its definitely not worth pulling that new code down, but should help the next person.


(Norm) #11

Can you please elaborate on “enabling OUTH”. I am new to this, so appreciate the guidance.


(Kirk Brown) #12

Hey Norm I’m not sure where the “enabling outh” comment is from. If it was from me I was griping about sensi not being open enough in their API. OAUTH is a type of authentication that only needs a user’s credentials 1 time and then saves secure tokens, secret, and identifiers but aren’t the users credentials. That is preferred, but the sensi API doesn’t allow that with just any users. So the smartapp I wrote requires you to save your username and password inside the app. Which as far as I know is still pretty secure, but since it’s a community developed app I wanted to be clear about how the smartapp authorizes itself. There is always risk installing other people’s code (especially if you don’t/can’t understand it), and in good faith I want everyone to know. So that’s the soap box, you shouldn’t enable OAUTH for this smartapp, and if you do then I forgot to comment out some lines of code somewhere.


(Norm) #13

Kirk,

Thanks for responding.

The “OUTH” statement came from the generic instruction on using a custom smart app that you referenced to, and I now see was not written by you (see Step SA5) in https://github.com/kirkbrownOK/SensiThermostat

Anyway, that app work great.

Last question, have you though incorporating battery voltage display in to the app?

Thank you very much.

Norm.


(Kirk Brown) #14

Norm,

Actually no. I can see how that would be useful, but I don’t have a Sensi Thermostat. I parsed it out as an attribute sensiBatteryVoltage, but I didn’t display it as a tile. The thermostat I was testing off of had a voltage readout of milliVolts, usually around 3100. I’m guessing that they are using 2 AA, nominal voltage of 1.5V so 3000 mV should be the minimum voltage?

To display something along those lines, you should modify your device handler to include a tile for sensiBatteryVoltage and then add that tile name to the details([ ]) function. Should look something like this:

    standardTile("refresh", "device.refresh", inactiveLabel:false, decoration:"flat",width:6, height:2) {
        state "default", icon:"st.secondary.refresh", action:"refresh.refresh"
        state "error", icon:"st.secondary.refresh", action:"refresh.refresh", backgroundColor:"#e81e1e" 
    }
    //No clue what a Fully Charged battery is vs a Dead Battery. Guessing from 2 AA nominal 1.5V per unit and 3.0V is adequate
	valueTile("batteryDisplay", "device.sensiBatteryVoltage", inactiveLabel:false) {
        state "default", label:'${currentValue}', unit:"milliVolts",
            backgroundColors:[
                [value: 3000, color: "#ff3300"],
                [value: 3075, color: "#ffff00"],
               // [value: 3150, color: "#33cc33"],
                //[value: 74, color: "#44b621"],
                //[value: 84, color: "#f1d801"],
                //[value: 95, color: "#d04e00"],
                [value: 3140, color: "#33cc33"]
            ]
    }
    main(["temperatureIcon" ])

    details(["thermostatFull","temperature", "operatingState", "fanState",
    	"mode", "fanMode", "hold",
        "heatingSetpoint", "heatDown", "heatUp",
        "coolingSetpoint", "coolDown", "coolUp", 
        "batteryDisplay",
         
        "refresh"])
}

(Norm) #15

Yes, exactly. They use 2 x AA batteries.

I got the code to work, although I see two tiles with voltage (see screenshot). Question: How do I get voltage to display in Volts vs milliVolts?

Thanks.


(Kirk Brown) #17

Hey Norm, looking at that screenshot makes me think that somehow, your details([ ]) function likely has two “batteryDisplay” entries?

Mine looks like:

	valueTile("batteryDisplay", "device.sensiBatteryVoltage", inactiveLabel:false) {
        state "default", label:'${currentValue}', unit:"V",
            backgroundColors:[
                [value: 2.9, color: "#ff3300"],
                [value: 3.07, color: "#ffff00"],
                [value: 3.1, color: "#33cc33"],
                [value: 3.5, color: "#33cc33"],
                [value: 2900, color: "#ff3300"],
                [value: 3075, color: "#ffff00"],
                [value: 3100, color: "#33cc33"],
                [value: 3500, color: "#33cc33"]
            ]
    }
    valueTile("lowBattery", "device.sensiLowPower", inactiveLabel:false, width: 2) {
        state "default", label:'LowPower: ${currentValue}', unit:"V"
    }
    main(["temperatureIcon" ])

    details(["thermostatFull","temperature", "operatingState", "fanState",
    	"mode", "fanMode", "hold",
        "heatingSetpoint", "heatDown", "heatUp",
        "coolingSetpoint", "coolDown", "coolUp", 
        "batteryDisplay","lowBattery",             
        "refresh"])
}

I’m going to make a few suggestions regarding the battery info.

  1. Add the Capability of “Battery” - I think that is what it is. If the battery value gets “Low” then ST will alert you.
  2. Add another attribute for the device that will show you the value from Sensi that is “LowPower”.
  3. Change the parsing on the batteryvoltage from milliVolts to Volts
  4. If the sensi thermostat decides the batteries are “LowPower” then set the battery level to 0 and have ST alert the user. Otherwise the battery will be set as 100. That is just % and isn’t shown as a tile (but could be if you wanted)

1 Looks like:

	capability "Relative Humidity Measurement"
	capability "Health Check"
    capability "Battery" //New Capability

2 Looks like:

    attribute "sensiThermostatMode", "string"
    attribute "sensiBatteryVoltage", "number"
    attribute "sensiLowPower", "string" //New Attribute
    attribute "thermostatHoldMode", "string"

3 And 4 Look like:

        //Existing unchanged code
        if(name=="Humidity") { 
            def sendValue = value
            checkSendEvent("humidity", sendValue, "${device.label} humidity ${sendValue}","%")
        } 
        //This will convert milliVolts to Volts 
        if(name=="BatteryVoltage") { 
            //def sendValue = value //In milliVolts
            def sendValue = value/1000 // in Volts
            TRACE("BV is $value and sensiBV is ${sendValue.toFloat().round(1)}")
            checkSendEvent("sensiBatteryVoltage", sendValue.toFloat().round(1), "${device.label} BatteryVoltage ${sendValue}",null,false)
            
        }
        //This will parse LowPower into sensiLowPower attribute and it will send low battery alarms from ST via battery capability
        if(name == "LowPower") {
        	def sendValue = value
            checkSendEvent("sensiLowPower", sendValue, "${device.label} LowPower ${sendValue}",null,sendValue)
            if (sendValue == true) {
            	checkSendEvent("battery", 0, "${device.label} Battery is Low", null, true)
            } else {
            	checkSendEvent("battery", 100, "${device.label} Battery is Not Low", null, false)
            }
        }

(Norm) #18

Thanks Kirk.

I incorporated all the changes and cleaned up the color of the Battery Voltage tile based on the voltage range provided by Sensi support. Not 100% of the need for the “LowPower: false” tile, but left in there. I figured that the test of the voltage and color coding of the Voltage tile should probably be sufficient without the need for the separate tile.

Anyway, I am attaching the complete handler in case you want the version I now have.

Thanks again,

Norm.


(Jay S) #19

Hey Kirk, Just started playing with your code since I installed my Sensi yesterday…here is a screenshot…good job.


(Robert) #20

Wanted to post and say Thank You for your efforts. Works great! Setup a routine in ST and can just tell Alexa “Turn On Bedtime” to turn off all the lights and set my pellet stove to 45 degrees.


(Terry Grant) #21

Great Job! I love it!