Z-Wave Thermostat Battery Status?


(www.rboyapps.com - Make your home your butler!) #16

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?


(www.rboyapps.com - Make your home your butler!) #17

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?


(Minollo) #18

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.


(www.rboyapps.com - Make your home your butler!) #19

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


(Minollo) #20

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"
zwave.batteryV1.batteryGet().format()
} else "delay 87"
}


(www.rboyapps.com - Make your home your butler!) #21

THE LATEST WORKING CODE HAS NOW BEEN MOVED HERE TO MAKE IT EASIER TO ACCESS AND READ

@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.


2gig ct100: humidity?
Thermostat control pane (slider)
[RELEASE] Enhanced Z-Wave Plus Thermostat (CT30/CT50/CT80/CT100/CT101/CT110/ZTS110/ZTS500/GoControl/Honeywell/Universal) Device Handler with Battery, Humidity, Clock Set, Alarm, Swing/Temp, Deadband Configuration and Updated User Interface
(Minollo) #22

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).


(www.rboyapps.com - Make your home your butler!) #23

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)


(Minollo) #24

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
}


(www.rboyapps.com - Make your home your butler!) #25

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?


(Minollo) #26

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.


(www.rboyapps.com - Make your home your butler!) #27

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


(www.rboyapps.com - Make your home your butler!) #28

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


(www.rboyapps.com - Make your home your butler!) #29

@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?


(Sully) #30

@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: http://community.smartthings.com/t/honeywell-smart-wi-fi-thermostat-compatibility/602/164

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!


(Convinced ST will never be unbroken…) #31

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


(www.rboyapps.com - Make your home your butler!) #32

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.


(www.rboyapps.com - Make your home your butler!) #33

@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.


(Sully) #34

@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.


(www.rboyapps.com - Make your home your butler!) #35

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.