Thermostat sample code

ChrisWalker

Active Member
A few of the people who have purchased our new Z-Wave PC SDK have registered to download the beta--and many of those have been creating some really cool projects with it.

I'm not sure what the proper forum for this is, but I thought that I'd share a sample I built in a few hours using VB.NET and the Z-Wave PC SDK.

This "thermostat" sample lets you monitor and control every Z-Wave thermostat in your Z-Wave network. It features: thermostat mode, fan mode, heating/cooling set points, temperature, operating state, and fan state.

You must have a copy of the ControlThink.ZWave dll (v1.1 beta, build 125) to compile this sample application.

[note: you can download the Z-Wave PC SDK v1.1 beta from the PC SDK beta forum at http://forums.controlthink.com. For access, simply pre-order the Z-Wave PC SDK from http://tech-home.com and follow the instructions you receive via e-mail]


thermostat.gif


Chris
 

Attachments

  • Thermostat.zip
    8.9 KB · Views: 25
By the way, this sample even includes polling (in the background for temperature, operating state, and fan state--and in a timer routine for setpoints, mode, and fan mode).

It's really cool to slide the setpoint sliders and watch the thermostat setpoint change in real time. And to change the mode/fan mode and watch that change--it's _so_ responsive.

Chris
 
electron said:
Looks really nice Chris, which thermostat are you using?
Both of them, of course :) The RCS TZ16 and the ACT ZTT000.

The SDK and its sample code is a Z-Wave Certified product, so we are very careful to be 100% compatible with all Z-Wave products.

In this particular example, one could set a setpoint on the thermostat which is below 65 F or above 85 F, in which case the software will "gracefully degrade" by pushing the slider to the edge of the bar. And if the user sets the thermostat to a mode not supported by the sample (like "Dry Air" on the ZTT000), none of the selection button will be selected.

We're going to add association to this sample as well, so when you press the Mode or Fan Mode button on the ACT Thermostat, you'll get an _instant_ live status update in the sample!

We built the basic sample, with exception handling, in less than 40 minutes. Adding in the sliders and commenting the code didn't take much longer. It's really amazing how fast a person can put together their own Z-Wave software application now.

We're going to build an ASP.NET-based thermostat sample as well. So someone could create a web page to check up on (or change) their thermostat with just a few lines of code. Should I be sharing that one as well? :(

Chris
 
I thought the SDK and interface wasn't going to be available until the first of the year?
 
If you buy the SDK now, you get access to the latest beta of the software, eventho you won't get the hardware until sometime in Q1 next year.
 
mcascio said:
Hey Chris,

Do you know if their SDK will also support plugins written in VB?

Thanks.
mcascio:

The SDK supports the .NET Framework. But as I understand it, Microsoft has created an interoperability layer between .NET and VB6, so it should be possible. If nothing else, someone could create a "shell" around the .NET library which would work with VB6, and then integrate on the VB6 side.

Since VB.NET has basically the same syntax as VB6, it wouldn't be hard for the same person to do both. I'm guessing that there are at least a few people on this board with such coding skills :(

Chris
 
Rupp said:
I thought the SDK and interface wasn't going to be available until the first of the year?
rupp:

When you pre-order the SDK, you get access to download the beta of the next version (1.1)--plus a full developer forum where you can get support.

Chris
 
We've updated the thermostat sample code. You can download the updated version--it's an attachment to the first message in this thread.

We just released the newest beta of our upcoming Z-Wave PC SDK v1.1, and this update brings full association functionality.

[As a matter of history, the v1.0 release has association functionality, but we have now deprecated it in leiu of this new, super-clean object model]

So, the new thermostat sample features "live status" updates. For an ACT thermostat, you can check "enable live status" and then the sample will get updates in real time whenever you press the MODE or FAN MODE buttons on your thermostat.

It's pretty cool to see that in action.

You will need the Z-Wave PC SDK v1.1 (build 125) to test out this sample.

[note: you can download the Z-Wave PC SDK v1.1 beta from the PC SDK beta forum at http://forums.controlthink.com. For access, simply pre-order the Z-Wave PC SDK from http://tech-home.com and follow the instructions you receive via e-mail]

Chris
 
Back
Top