Z-Wave Thermostat Battery Status?

I create a new device using this and associated the existing thermostat with this device but I still don’t see any battery or time. What am I missing here?

Funny thing with this code and my CT100 now it doesn’t even control the fan or mode (I don’t see time / battery anywhere).
But if I switch back to the default Z-Wave Thermostat it works but with no battery/time status.

Do you know how we can get the code for the latest version of the Z-Wave thermostat device?

Don’t know why you wouldn’t see battery status; if you check the live logging, do you see any “battery related traffic” logged for the device? As you can see from the code, there is some information logged there.
Time is a different topic; the code is meant to send the correct time to the device, not vice-versa.
The default zwave code is available as part of the default device types; you can see it if you create a new device type - where you can choose among all the officially supported device types to start as a template.

I see the logging in the activity, just don’t see a title for it. I’m guessing that depending up on the app and not the device type right?

I’m sorry but I didn’t understand how to find/use the template. When I click on new Device Type under My Devices, it gives me many check boxes for “Capabilities”. I don’t see anywhere to select the Device Type template, what am I missing here?

For some reason the Fan and mode buttons aren’t working on the CT100 with the code above but the default is so I wanted to the default to add your code to it. thanks

Just create a new device type with name and namespace “test”; once in the code window, you’ll have a button on the top-right of the page, “Device Type Examples”; click it, scroll down, and you’ll find the zwave thermostat one.

The logging I was referring to is device specific, nothing to do with the application:

private getBattery() { //once every 10 hours
def nowTime = new Date().time
def ageInMinutes = state.lastBatteryGet ? (nowTime - state.lastBatteryGet)/60000 : 600
log.debug "Battery report age: ${ageInMinutes} minutes"
if (ageInMinutes >= 600) {
log.debug "Fetching fresh battery value"
} else “delay 87”

1 Like


@minollo thanks for this. @duncan thanks for the Humidity multiinstance code for CT-100/101

@Ben something ST can look at including in the default code to include a battery tile and set time or create a custom device type for CT100/CT101.

BTW I should be tagging someone else from your team or sharing my thoughts with anyone else on the ST team in your place please let me know Ben.

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

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.