Z-Wave Thermostat Battery Status?

One more change is:
def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
def nowTime = new Date().time
state.lastBatteryGet = nowTime

That take care of setting the “last battery checked” time to avoid asking it too frequently (and causing useless battery depletion).

I’m sorry I don’t get where I should put this function? I don’t see any existing batteryReport cmd so I’m guessing this is a new handler. It looks incomplete and how does one register it (I’m still new to this dev platform)

It’s part of the code I originally posted in this thread:
def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
def nowTime = new Date().time
state.lastBatteryGet = nowTime
def map = [ name: “battery”, unit: “%” ]
if (cmd.batteryLevel == 0xFF || cmd.batteryLevel == 0) {
map.value = 1
map.descriptionText = “$device.displayName battery is low!”
} else {
map.value = cmd.batteryLevel
}
map
}

Perfect thanks. BTW I just saw that the device also support reporting Relative Humidity. Do you happen to know what code one can use to get this info also in addition the battery?

RH should “just work”, as it should be reported through as sensor type “5” as part of the sensor multi level report event - which is properly handled in the code. Unfortunately, I’ve never seen the CT100 actually reporting it, even trying to request it in any possible way I could think of; I asked the thermostat manufacturer for help, but they ignored me; so, I had to give up on that.

Got it thanks I check your other threads also, I’ve updated the code above

thanks @scottinpollock for the tip on how to get the Battery tile

@scottinpollock I see the Tiles in the simulator but when I publish it to me and I refresh the device I don’t see if on my iPhone. I tried changing the type to z-wave thermostat and then back to the custom device type but still no show. Any idea why?

@RBoy, this is great code… Thanks! I’m messing around with this too, but I’m just starting. Progress is decidedly slow. Out of curiosity… Is there any way to get rid of the slider and do something like this: https://github.com/ethomasii/honeywell-smartthings/blob/master/honeywell.groovy

Info on the code can be found in this topic: Honeywell Smart Wi-Fi Thermostat Compatibility

It’s code for a Honeywell thermostat, but it’s got icons and arrows to change temps instead of the slider. Not sure if it’s even possible, but I thought it might give you some inspiration. I’m not sure about the slider part, but implementing the icons for the modes seems like it should be doable.

Again, thanks for the work on this!

Try logging out on the mobile app, force quit, re-launch, login again.

1 Like

You genius! that did it, and now I see the Battery :smile:
RH is blank but I expect that to be based on the comments above, it’s an issue that needs to be resolved with CT communication.

@jsulliweb great idea, I’ve made the changes to the code and published it above. I prefer up/down to slider, it’s easier.
I’ve also added icons to it.

@RBoy, that works! I had sort of figured out the icons, but I wouldn’t have gotten the up/down stuff. Also, just for your reference. I also changed:

def modes() {
[“off”, “heat”, “cool”]
}

I took out all but the above. I never use Auto mode, and by reducing it to those three, it just cycles through them ignoring Auto mode. Just a thought, if you’re like me and don’t want Auto in the cycle.

Glad to know, personally I’m a huge fan of auto mode and one of the reasons I got this thermostat. I dislike that during season changes I need to switch between heat and cool modes depending upon how the sun is doing. This way I can set a comfortable range, say 70 to 72 and let the thermostat figure out when to heat or cool as long as it’s within the range.

But I’m glad to see that it works for you.

One more thing I noticed, on mode, fanmode, coolingsetpoint and heatingsetpoint. You want to get rid of decoration: “flat” .

You want to replace it with: canChangeIcon: true

That gets the nice circle around everything with the colored backgrounds. Just FYI.

Very true and thanks for pointing that out, I’ve made the edits to the thermostat and fan button but for up and down I’m sticking wtih flat because the changeicons don’t show if the button was “pressed” which the flat ones do. that feedback is important for setting temperature IMHO

@minollo what does

else “delay 87”

do? I noticed that my thermostat battery has been dying very quickly past few days. I see from the activity feed that it’s polling the thermostat every 15 odd mintues, wondering if StandardDelay and this delay 87 have anything to do with it and what impact it will have if I increase standard delay to say 10000 and increase this delay 87 to delay 8700?

thanks

The delay in fetching battery status has nothing to do with polling frequency; it’s just to avoid overwhelming the device with requests all at once when the polling happens. If the mechanism works properly, the battery status should be fetched only once every 8 hours, if I well remember (it does that for me). The polling happens independently from the battery status.
Unfortunately batteries in CT100 don’t last long - if you are not using the C wire to provide power.

Thanks, I’m still not getting the purpose of the delay 87 though.

As mentioned, you (from what I understand) always want to send zwave commands a bit split up in time; if you send them all at once, the device gets confused and won’t process (some of) them.