HomeGenie Forum

Automation Program Plugins and Wizard Scripting => APP Contributions => Topic started by: miket on June 22, 2014, 10:52:54 PM

Title: Zwave Thermostat
Post by: miket on June 22, 2014, 10:52:54 PM
I just got the honeywell zwave thermostat.  I'm going to start working on adding functionality to the zwave thermostat module.

If anyone has put work into this already, please let me know and I'd be more than happy to help with your effort instead.   Gene-  if you have a preference for how you'd like it to work, let me know as well.  I'll put all of the work in a fork in github.

I'm going to start by adding the command classes to the zwave interpreter, then add front end stuff one at a time.   I'm probably going to begin with just status, then work through to sending commands.   

If anyone wants to help with this, please let me know.  If anyone knows of a good command reference for thermostats, let me know as well.   
Title: Re: Zwave Thermostat
Post by: miket on June 23, 2014, 02:43:08 AM
Gene-

Wondering if you had a roadmap for this.  I saw that you deprecated the thermostat module.  My plan was to build on top of that in order to integrate the thermostat.  But let me know what you were thinking.  We have a couple of functions- it works as a sensor, but there is also going to be a special kind of switch.  I think the functionality is specific enough to warrant a special module, but let me know if  you thought differently.

Thanks,
Mike
Title: Re: Zwave Thermostat
Post by: Gene on June 23, 2014, 07:04:51 PM
Hi Mike,

some tips about implementing Thermostat in ZWaveLib:

1) add missing command classes here:
     https://github.com/genielabs/HomeGenie/blob/master/MIG/Support%20Libraries/ZWaveLib/Devices/CommandClass.cs#L53
2) add code for handling Thermostat specific messages (from node to the controller) here:
     https://github.com/genielabs/HomeGenie/blob/master/MIG/Support%20Libraries/ZWaveLib/Devices/ZWaveNode.cs#L222
3) complete the current Thermostat driver here:
     https://github.com/genielabs/HomeGenie/blob/master/MIG/Support%20Libraries/ZWaveLib/Devices/ProductHandlers/Generic/Thermostat.cs#L30

In order to add the missing code to the Thermostat.cs class you need to override these methods:

Code: [Select]
namespace ZWaveLib.Devices.ProductHandlers.Generic
{
    public class Thermostat : Sensor
    {

public override bool HandleRawMessageRequest(byte[] message)
{
return false;
}

public override bool HandleBasicReport(byte[] message)
{
return false;
}

public override bool HandleMultiInstanceReport(byte[] message)
{
return false;
}

    }
}

In general the Thermostat node will answer with a Basic report or a Multiinstance one. If other message types are sent, the you can still take advantage of the HandleRawMessageRequest.

One last step to complete the ZWaveLib thermostat support, is to add methods for commands sent from the controller to the thermostat node, like you can see it happen for other command classes here:

https://github.com/genielabs/HomeGenie/blob/master/MIG/Support%20Libraries/ZWaveLib/Devices/ZWaveNode.cs#L531

You don't need to implement Sensor related stuff into Thermostat.cs since it already inherits the Sensor class.

Once finished with ZWaveLib, you may want to add thermostat commands to MIG service ZWave interface:

https://github.com/genielabs/HomeGenie/blob/master/MIG/MIG/Interfaces/HomeAutomation/ZWave.cs#L50
https://github.com/genielabs/HomeGenie/blob/master/MIG/MIG/Interfaces/HomeAutomation/ZWave.cs#L243

this will enable new http web service commands for interacting with a thermostat node.

After that a specific Thermostat widget should be created for the UI. There is already a dummy widget for that here:

https://github.com/genielabs/HomeGenie/tree/master/HomeGenie/HomeGenieUI/html/pages/control/widgets/homegenie/generic

To enable this widget you will have to uncomment this line:

https://github.com/genielabs/HomeGenie/blob/master/HomeGenie/HomeGenieUI/html/pages/configure/groups/listmodules.html#L126

that will re-enable the thermostat type selection in the module configuration and that is associated to that widget.

Hope this helps!

Cheers,
g.



Title: Re: Zwave Thermostat
Post by: Gene on June 23, 2014, 07:16:47 PM
One more thing.
To ensure that you thermostat device is recognized as a Thermostat device, put a break point here:

https://github.com/genielabs/HomeGenie/blob/master/MIG/Support%20Libraries/ZWaveLib/Devices/ZWaveNode.cs#L503

this is the code where the generic driver for a node is selected.
If this break point is not triggering then it means that your thermostat is sending another type for the generictype field, so you have to initially force the selection of the Generic Thermostat handler by adding some hard-coded lines.
When the generic thermostat handler is completed, then you can remove the hard-coded selection of the generic driver and add a specific handler for your device here:

https://github.com/genielabs/HomeGenie/tree/master/MIG/Support%20Libraries/ZWaveLib/Devices/ProductHandlers

by extending the Thermostat class and adding the proper manufacturer ID for your product as it happen for other devices, for example see:

https://github.com/genielabs/HomeGenie/blob/master/MIG/Support%20Libraries/ZWaveLib/Devices/ProductHandlers/Aeon/MultiSensor.cs#L37

Cheers,
g.
Title: Re: Zwave Thermostat
Post by: miket on June 24, 2014, 04:20:27 AM
Awesome- thank you Gene!  I'll let you know when I have a working beta.  Some other users volunteered to test so that we can make sure it works before sending it to other users.   
Title: Re: Zwave Thermostat
Post by: miket on July 01, 2014, 06:49:36 PM
ok...I have a testing version.  There is still a lot of work I need to do, but it would help if some of the other users tried it with different thermostats.  I especially need to see if my set point command works with celsius (my thermostat is all on F). 

I left the generic sensor reporting the current temp in C, and I convert it on the UI side to F unless there is a configuration parameter for the module.  (So that I didn't break anything that was already using the generic sensor)

My thermostat reports any changes automatically when associated with node 1, but I need to see what other thermostats do.   

So Gene:  should I send a pull request (probably later this week) with an early beta so that some of the other users can tell me what messages they are getting from their thermostats?   

Title: Re: Zwave Thermostat
Post by: Gene on July 02, 2014, 11:22:50 AM
Hi mike,

make your pull request whenever you feel to. Then I'll make a testing release with it.
I'm pushing r388 to github soon (mostly a UI update).

Cheers,
g.
Title: Re: Zwave Thermostat
Post by: pmowry911 on July 03, 2014, 09:55:07 PM
miket,

  I can put my thermostat in celsius mode for a few days to test.  My daughter is about to go to college so she needs to learn the conversion anyway ;)  If you not ready to submit your code to a test build, could I get a copy of your source to play with?

Thanks,

-Patrick
Title: Re: Zwave Thermostat
Post by: miket on July 04, 2014, 07:08:39 AM
Awesome-  I just sent the pull request to Gene.  Once he has a release for testing, we can start figure out what works or doesn't work with your thermostat, and I can make some modifications. 

Title: Re: Zwave Thermostat
Post by: Gene on July 04, 2014, 04:17:23 PM
Hi Mike,

merged your modification into the master repo.
Also bundled r392 for testing which includes your modifications.

https://sourceforge.net/projects/homegenie/files/testing/

Cheers,
g.
Title: Re: Zwave Thermostat
Post by: miket on July 04, 2014, 10:22:09 PM
Awesome!  Thanks Gene!

ok...if anyone is testing this, if homegenie is receiving messages from your thermostat, they will be announced as thermostat.[parameter] on the evens page of the control panel.

If your thermostat has association as an option, associate the thermostat with node 1 (this works for listening to messages from a honeywell thermostat)

Even if you don't see any messages, try setting your thermostat temp and see if it registers.  (If you are on celsius, try setting plausible C and F temps and see what happens)   

Try manually changing the temp from the thermostat and see if the thermostat updates.   

Title: Re: Zwave Thermostat
Post by: pmowry911 on July 05, 2014, 06:22:09 PM
Let me know if logs/test reports should be posted someplace else.  If I change the fan mode from auto to on and back I see the state update in the gui but temperatures are not close.  The interface shows 28F with a set point of -2.06 when the thermostat has 25c and 44c respectively

Changing the thermostat back to F I see 238F with a set point of 144.67 when the thermostat shows 77 and 80.

Using the dial to set the temperature works, but for Celsius mode I have to stay in the bottom quarter of the dial since the % correlates directly to the degree setting.

My thermostat is a RCS TZ45A

Manufacturer Specific = 0010:0001:0002
Supported Classes
40, 42, 43, 44, 45, Configuration, Sensor Multi Level, Version, 81, Manufacturer Specific


This is all I see in the log, but if I use another application that uses openzwave I see log entries every time the temperature changes a degree or other event.

pmowry@fw-1:/usr/local/bin/homegenie/log$ fgrep Thermostat homegenie.log
2014-07-05T10:37:14.9565320-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.OperatingState       2
2014-07-05T10:37:15.0051080-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.FanState     1
2014-07-05T10:38:40.4526920-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.OperatingState       0
2014-07-05T10:38:40.5533200-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.FanState     0
2014-07-05T10:43:42.8316450-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.OperatingState       2
2014-07-05T10:43:42.8821430-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.FanState     1
2014-07-05T10:59:56.4211160-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.SetPoint     114.44444444444444
2014-07-05T11:01:27.8116380-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.OperatingState       0
2014-07-05T11:01:27.8620960-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.FanState     0
2014-07-05T11:02:25.9443660-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.SetPoint     114.33333333333334
2014-07-05T11:02:34.0066730-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.SetPoint     114.3888888888889
 <<<<<<<  Changed thermostat to C mode >>>>>>>>>>>

2014-07-05T11:03:12.4253010-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.SetPoint     -2.5555555555555562
2014-07-05T11:03:12.4757130-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.SetPoint     -2.0555555555555554
2014-07-05T11:06:18.6730840-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.FanState     1
2014-07-05T11:06:18.7235750-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.FanMode      1
2014-07-05T11:06:30.7540490-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.FanState     0
2014-07-05T11:06:30.8045610-05:00       HomeAutomation.ZWave    2       ZWave Node      Thermostat.FanMode      0

Thank you so much for working on this.

-Patrick
Title: Re: Zwave Thermostat
Post by: miket on July 05, 2014, 10:03:41 PM
Awesome!   So it looks like your thermostat is announcing the events!  It looks like I have some issues in my C/F conversions.  =)

Were you able to add the module?   If so, what is the module displaying?   How does that compare to the real temp/setpoint on your thermostat's real display.

Thanks!

Title: Re: Zwave Thermostat
Post by: miket on July 05, 2014, 10:52:44 PM
Update:   

there was a little bug in my release that turned out to be the way I intended things to work.

If you are on F, then the setpoint is reported back in Celsius

This makes sense, I realize.  Let;s report everything in C and let the UI decide how to display it.

I've also moved the dial so it includes more plausible Celsius values.   

If you want to see things in C, add a parameter to the thermostat module:
Conditions.DisplayCelsius   and set it to TRUE

Otherwise it will default to F.   


For testers:  These are just little UI changes so you can download them and drop them in

{homegenie root}/html/pages/control/widgets/homegenie/generic/




Title: Re: Zwave Thermostat
Post by: RichieC on July 11, 2014, 01:00:16 AM
I have a Hosrtmann HRT4-ZW thermostat and i can't get it to work..

Im running Homegenie r395 on a raspberry pi which i beleive includes the themostat code, but i can't even add the thermostat as a z-wave node - it just times out and doesnt find anything at all.

Does anyone have any idea why this is and how i can get this to work?

Richie
Title: Re: Zwave Thermostat
Post by: miket on July 12, 2014, 09:22:18 PM
Are you able to successfully pair your thermostat with your controller?  If this doesn't work, then you have a hardware issue.  Read the manual for your device very carefully- some of these things have funny configuration settings.

Does the whole homegenie system time out or just your browser?

Can you at least see the thermostat as an option in the dropdown module?   

I'm not sure if you can get to your homegenie log, but if you can, it would be great if you posted what the log is saying when you have the issue.

Thanks for your feedback-  hopefully we can make it work!
Title: Re: Zwave Thermostat
Post by: bradvoy on July 13, 2014, 04:08:56 PM
I just installed r394 and tried this with my Radio Thermostat CT101.  All the fields on the thermostat module are empty (Set, Fan, Op, Mode).  If I click on the gear image, it shows "40".  If I change the temperature here, it does change my thermostat's set point accordingly.  But the next time I come back here it shows 40 again, not the temperature I set.

My homegenie log file doesn't show any thermostat-related entries except for a handful like this:

hg/html/pages/control/widgets/homegenie/generic/thermostat.json   HTTP    GET
Title: Re: Zwave Thermostat
Post by: miket on July 13, 2014, 04:15:37 PM
ok...I'm pretty sure I know what it is.

So your thermostat is connected correctly, but it just isn't announcing changes automatically.   

There is one thing you can try-  on the configuration page for the module, if your thermostat supports association, try associating it with node 1.  My thermostat requires this in order to receive announcements.

Let me know if this works, but if it doesn't, in the next update I'm going to figure out a way to poll the thermostat for messages.   

I appreciate the feedback-  keep me up to date on how things are working/not working!
Title: Re: Zwave Thermostat
Post by: bradvoy on July 13, 2014, 08:27:21 PM
I just double checked the configuration page for the module, and I don't see anything there about association. 

Thanks for your work on this.  I'll continue playing around with it and let me you know if I learn any more.
Title: Re: Zwave Thermostat
Post by: RichieC on July 14, 2014, 03:23:46 PM
No, i can't even pair the thermostat with homegenie. I do have other z-wave devices though which work fine, so if its a hardware issue its with the thermostat itself, although i think it has more to do with the way it communicates with the controller. I remember reading somewhere that it associates with group2 which is not what homegenie is not listening for..

Are you able to successfully pair your thermostat with your controller?  If this doesn't work, then you have a hardware issue.  Read the manual for your device very carefully- some of these things have funny configuration settings.

Does the whole homegenie system time out or just your browser?

Can you at least see the thermostat as an option in the dropdown module?   

I'm not sure if you can get to your homegenie log, but if you can, it would be great if you posted what the log is saying when you have the issue.

Thanks for your feedback-  hopefully we can make it work!
Title: Re: Zwave Thermostat
Post by: RichieC on July 16, 2014, 06:30:18 PM
There are some instructions that i found here for adding this thermostat to a Z-Wave network (but not for Homegenie) I've tried to use these instructions to add the thermostat device in Homegenie, but have not had much luck. The instructions are here:

http://www.maartendamen.com/2011/05/horstmann-hrt4-zw-thermostat/ (http://www.maartendamen.com/2011/05/horstmann-hrt4-zw-thermostat/)

there is also a document that details the supported classes etc here:

http://www.pepper1.net/zwavedb/uploads/resources/c9a9e2f0a21623166ddfc437c4f842c34020aa45.pdf (http://www.pepper1.net/zwavedb/uploads/resources/c9a9e2f0a21623166ddfc437c4f842c34020aa45.pdf)

As i said before i can't even get the device to pair with homegenie...

Any ideas why this is not working or what can be done to get it to work?

Rich

No, i can't even pair the thermostat with homegenie. I do have other z-wave devices though which work fine, so if its a hardware issue its with the thermostat itself, although i think it has more to do with the way it communicates with the controller. I remember reading somewhere that it associates with group2 which is not what homegenie is not listening for..

Are you able to successfully pair your thermostat with your controller?  If this doesn't work, then you have a hardware issue.  Read the manual for your device very carefully- some of these things have funny configuration settings.

Does the whole homegenie system time out or just your browser?

Can you at least see the thermostat as an option in the dropdown module?   

I'm not sure if you can get to your homegenie log, but if you can, it would be great if you posted what the log is saying when you have the issue.

Thanks for your feedback-  hopefully we can make it work!

Title: Re: Zwave Thermostat
Post by: miket on July 19, 2014, 09:29:09 PM
Hey Richie:

That's a cool looking thermostat!

What controller are you using?   With the zstick controller (which is what I use), I have to walk over to the thermostat with my controller (most of them have to be within 5 feet or so), put my controller in add mode, and then follow the instructions for adding the thermostat.   (All outside of homegenie).  My controller then gives me a satisfying double blink to let me know that it worked.  After all of that is done, then I can go to homegenie and add the new node to my control panel.   

Do you know at which step of the process something is going wrong?   

The great think about your thermostat is that it has associations-  so once you are able to include it in your network, it will automatically send updates to homegenie after you associate it with (usually) node 1.     




Title: Re: Zwave Thermostat
Post by: bradvoy on July 19, 2014, 10:47:25 PM
Mike, I noticed that when I change the thermostat setting using your widget that the call back to the HG server uses the URL /api/HomeAutomation.ZWave/<zwaveNode>/Therm.Temp/<temperature>.  So I can use that call to adjust the thermostat from another node on my  network.  But I can't figure out how to do the same thing from within an HG module.  I was thinking it would be somthing like this:

Code: [Select]
Modules.WithName("Main floor").Get().Parameter("Therm.Temp").Value = "78";
But that isn't working.  Can you give me any hints on this?
Title: Re: Zwave Thermostat
Post by: Gene on July 20, 2014, 12:36:29 AM

Code: [Select]
var termperature = Modules.WithName("Main floor").Command("Therm.Temp");
termperature.Set("<some_value>");

g.
Title: Re: Zwave Thermostat
Post by: bradvoy on July 20, 2014, 01:33:27 AM
That works great!  Thanks Gene and Mike.
Title: Re: Zwave Thermostat
Post by: RichieC on July 20, 2014, 11:48:08 AM
I am using a zstick2 and running homegenie on a raspberry pi..
But I diddnt think that pairing devices directly with the zsrick (by pressing its button) made any difference to homegenie - have always just added zwave devices within homegene - is this not correct?

You might be onto something with not being close enough to the controller to pair the device though... I'll try getting a bit closer and see what happens.. if i view the log while attempting to add the thermostat nothing is logged at all.. could be because it's not close enough I guess!

Richie

Hey Richie:

That's a cool looking thermostat!

What controller are you using?   With the zstick controller (which is what I use), I have to walk over to the thermostat with my controller (most of them have to be within 5 feet or so), put my controller in add mode, and then follow the instructions for adding the thermostat.   (All outside of homegenie).  My controller then gives me a satisfying double blink to let me know that it worked.  After all of that is done, then I can go to homegenie and add the new node to my control panel.   

Do you know at which step of the process something is going wrong?   

The great think about your thermostat is that it has associations-  so once you are able to include it in your network, it will automatically send updates to homegenie after you associate it with (usually) node 1.   
Title: Re: Zwave Thermostat
Post by: RichieC on July 21, 2014, 11:03:21 AM
Ok, I've done a bit more testing around this, but unfortunately haven't got any further with getting this thermostat working with Home genie.

I've tried moving the thermostat closer (about 1 foot away!) and it still doesn't respond to a add node request .. nothing is logged in the homegenie logs when attempting this.

If i unplug the z-stick from the pi and press it's button to include a device and then select the install option on the thermostat (the same as im doing when attempting to add the node in homegenie) i get the "double blink" on the z-stick and the thermostat shows that its paired sucessfully. If then plug the z-stick back into the pi and restart homegenie there are no new z-wave devices listed that i can add and trying to add a node again in homegenie still doesnt work.

Any ideas what is happening here?

Hey Richie:

That's a cool looking thermostat!

What controller are you using?   With the zstick controller (which is what I use), I have to walk over to the thermostat with my controller (most of them have to be within 5 feet or so), put my controller in add mode, and then follow the instructions for adding the thermostat.   (All outside of homegenie).  My controller then gives me a satisfying double blink to let me know that it worked.  After all of that is done, then I can go to homegenie and add the new node to my control panel.   

Do you know at which step of the process something is going wrong?   

The great think about your thermostat is that it has associations-  so once you are able to include it in your network, it will automatically send updates to homegenie after you associate it with (usually) node 1.   
Title: Re: Zwave Thermostat
Post by: James on July 21, 2014, 03:03:46 PM
I had the same issue with a standard GE switch, tried 4 or 5 times to add and remove it but it never showed up in HG then one last time I removed the z-stick and manually Removed and then added the switch to the z-stick, plugged the z-stick back in and rebooted still didn't show up, I then hit Discovery and Its there!!!

hope this helps
Title: Re: Zwave Thermostat
Post by: miket on July 22, 2014, 07:36:28 AM
Awesome!  Glad it worked!

Title: Re: Zwave Thermostat
Post by: RichieC on July 22, 2014, 08:14:25 PM
Well.. i went back in and did a discovery.. and you're right .. my thermostat is now there!

I have added it as a module, but i can't seem to get it to do a great deal. Changing the temperature on the thermostat or on the homegenie module doesn't do anything.

Is there some other configuration changes i need to make to get the thermostat to report / respond to changes?

Richie

I had the same issue with a standard GE switch, tried 4 or 5 times to add and remove it but it never showed up in HG then one last time I removed the z-stick and manually Removed and then added the switch to the z-stick, plugged the z-stick back in and rebooted still didn't show up, I then hit Discovery and Its there!!!

hope this helps
Title: Re: Zwave Thermostat
Post by: RichieC on July 22, 2014, 10:48:53 PM
Ok.. i've got a bit further with getting my Horstmann HRT4-ZW thermostat working.. but i still have a few issues that hopefully someone can help with..

The thermostat that i have consists of two devices - the thermostat itself (the HRT4-ZW) and a switch that you connect to your boiler (HRT4-ASR-ZW) to allow the thermostat to turn the heating on/off.

I unpluged the z-stick from the raspberry pi and unpaired these devices manually and then readded both of them to the z-stick by pressing it's button etc.
Then plugged the z-stick back into the pi and restarted homegenie - then when i did a discovery in homegenie there were two new z-wave ids! I added both of these and how have the two devices added and working! (kind of!)

Both of the devices have to be added as thermostat devices for them to work:

The first device - the switch, switches on and off when the Off and Heat buttons are pressed in it's homegenie widget - so that works!

The second device  - the thermostat - displays temperature and set point values in it's homegenie widget and if i change the set point by moving the dial on the thermostat - the set point in home genie changes!

The part that doesn't work is changing the set point in the homegenie widget - it doesnt update the set point on the thermostat.

Also, as this is two seperate devices is there anyway to combine the two - so that the temp display/control and Off/Heat buttons will work in the same widget as though they were one device?

RichieC
Title: Horstmann HRT4-ZW Thermostat...
Post by: RichieC on July 28, 2014, 01:13:14 AM
I think that for this thermostat at least homegenie is sending the wrong type of commands to set the setpoint of the thermostat..

If i monitor the "event history" from homegenie, when changing the setpoint on the thermostat itself by moving the dial to set the temp to 22 degrees C, i get the following:

00:04:20.974   Thermostat.SetPoint   22.0   33   HomeAutomation.ZWave

but if i change the temp to 12 degrees C in the homegenie widget, this is what is sent to the thermostat (which doesnt work):

00:04:49.109   Status.Level   0.12   33   HomeAutomation.ZWave

Should this not be sending a Thermostat.SetPoint command instead of Status.Level ?

Thanks for all the work on this so far and i really hope you can help with this as i'd love to get this working .. and it's almost there!

Richie





Ok.. i've got a bit further with getting my Horstmann HRT4-ZW thermostat working.. but i still have a few issues that hopefully someone can help with..

The thermostat that i have consists of two devices - the thermostat itself (the HRT4-ZW) and a switch that you connect to your boiler (HRT4-ASR-ZW) to allow the thermostat to turn the heating on/off.

I unpluged the z-stick from the raspberry pi and unpaired these devices manually and then readded both of them to the z-stick by pressing it's button etc.
Then plugged the z-stick back into the pi and restarted homegenie - then when i did a discovery in homegenie there were two new z-wave ids! I added both of these and how have the two devices added and working! (kind of!)

Both of the devices have to be added as thermostat devices for them to work:

The first device - the switch, switches on and off when the Off and Heat buttons are pressed in it's homegenie widget - so that works!

The second device  - the thermostat - displays temperature and set point values in it's homegenie widget and if i change the set point by moving the dial on the thermostat - the set point in home genie changes!

The part that doesn't work is changing the set point in the homegenie widget - it doesnt update the set point on the thermostat.

Also, as this is two seperate devices is there anyway to combine the two - so that the temp display/control and Off/Heat buttons will work in the same widget as though they were one device?

RichieC
Title: Re: Zwave Thermostat
Post by: miket on August 01, 2014, 01:11:36 AM
Sorry-  I've been gone from the forum for a bit.  Busy week!

Richie...can you post your log file (from the homegenie directory...not the event history)?  So the good thing is that the device is reporting the temperature correctly and sending events! 

Have you tried sending a higher temperature to see if it works (even try sending plausible F temps)

The "status.level" is a byproduct of extending the sensor class...it's actually sending a thermostat command.  I'll know more if you can send the logfile (with the raw io bytes)


I'm going to think about the issue you had a bit and see if I can figure it out.   

Title: Re: Zwave Thermostat
Post by: RichieC on August 01, 2014, 03:41:43 PM
No need for apologies.. busy here too just lately so i know all about that!

I'm not at home at the moment but i'm pretty sure i've tried setting the temperature to high values.. all the way up to 100 and it doesn't work. I can see what you're thinking though - the values that it sends currently in status.level messages are between 0 and 1 (so for 20degrees it sends 0.2) when i see a thermostat.setpoint message it sends a value of 20 - It could be that the thermostat is not accepting the status.level values as they are out of the range of values that it can set the thermostat to - it only allows values from 5 - 30 degrees C (setting it manually anyway) so even if i try to set the temperature to 100 in the homegenie widget it still only sends it as 1.0 which is still out of range.

How can get the full log to appear? When i download the log from the configuration screen it doesnt seem to contain everything (raw data byte etc). Do i need to stop the homegenie service and start it manually from a telnet session to see this?

I have also solved the problem of it being two separate devices as i stated previously - i have added node 1 (homegenie) and 32 (the switch device) to the switch association on the thermostat and this causes it to switch the switch device on and off when the heat icon appears on the thermostat and also shows off/heat in the homegenie widget for the thermostat :-) The Off / Heat buttons dont work though because they are still sending to the thermostat device instead of the switch .. but im not too bothered about this..

Rich

Sorry-  I've been gone from the forum for a bit.  Busy week!

Richie...can you post your log file (from the homegenie directory...not the event history)?  So the good thing is that the device is reporting the temperature correctly and sending events! 

Have you tried sending a higher temperature to see if it works (even try sending plausible F temps)

The "status.level" is a byproduct of extending the sensor class...it's actually sending a thermostat command.  I'll know more if you can send the logfile (with the raw io bytes)


I'm going to think about the issue you had a bit and see if I can figure it out.
Title: Re: Zwave Thermostat
Post by: RichieC on August 03, 2014, 10:41:00 PM
Unfortunately there appears to be a bug in the latest version of homegenie (r403) that  means that the module parameters cant be set from the UI anymore (clicking the 3-bars icon on a module now just opens it settings the same as clicking on the module itself ). I did have the variable in there to set the thermostat to use Centigrade.. but it looks as though its gone back to Fahrenheit and i cant change it back - so the values from the thermostat are in C but i can only set the widget to F temps..

But..

Here is the log output from homegenie when setting my thermostat to 15 degrees C (using the dial on the device itself)

2014-08-03T19:27:28.4160370+00:00       MIG.Gateways.WebServiceGateway  192.168.0.12    api/HomeAutomation.HomeGenie/Config/Modules.Get/HomeAutomation.HomeGenie.Automation/35/1407094035857    HTTP    POST
2014-08-03T19:27:31.4593190+00:00       MIG.Gateways.WebServiceGateway  192.168.0.12    api/HomeAutomation.HomeGenie/Config/Interfaces.List/1407094038511      HTTP     GET
[19:27:31.504146] SPI > 01 0C 00 04 08 21 06 43 03 01 22 00 96 2D
[19:27:31.511925] SPO < 06
2014-08-03T19:27:31.5183550+00:00       HomeAutomation.ZWave    33      ZWave Node      Thermostat.SetPoint     15.0
[19:27:31.563061] SPI > 01 0C 00 04 00 21 06 43 03 01 22 00 96 25
[19:27:31.571255] SPO < 06
2014-08-03T19:27:31.5774430+00:00       HomeAutomation.ZWave    33      ZWave Node      Thermostat.SetPoint     15.0
2014-08-03T19:27:35.3225900+00:00       MIG.Gateways.WebServiceGateway  192.168.0.12    api/HomeAutomation.HomeGenie/Logging/RealTime.EventStream/      HTTP   GET

and here is what happens when i set the setpoint in the homegenie widget to 80 degrees F

2014-08-03T19:50:53.5136390+00:00       MIG.Gateways.WebServiceGateway  192.168.0.12    api/HomeAutomation.ZWave/33/Therm.Temp/80/1407095440976 HTTP    GET
[19:50:53.530055] SPO < 01 0C 00 13 21 05 43 01 02 09 50 05 12 CA
[19:50:53.542989] SPI > 06
[19:50:53.551419] SPI > 01 04 01 13 01 E8
[19:50:53.557577] SPO < 06
[19:50:53.765755] SPI > 01 05 00 13 12 01 FA
[19:50:53.773813] SPO < 06
[19:50:53.780138] SPO < 01 0C 00 13 21 05 43 01 02 09 50 05 12 CA
[19:50:53.824894] SPI > 06 01 04 01 13 01 E8
[19:50:53.832878] SPO < 06
[19:50:53.934121] SPI > 01 05 00 13 12 01 FA
[19:50:53.942431] SPO < 06
[19:50:53.949076] SPO < 01 0C 00 13 21 05 43 01 02 09 50 05 12 CA
[19:50:53.993560] SPI > 06 01 04 01 13 01 E8
[19:50:54.001631] SPO < 06
[19:50:54.102926] SPI > 01 05 00 13 12 01 FA
[19:50:54.110951] SPO < 06
[19:50:54.117887] SPO < 01 0C 00 13 21 05 43 01 02 09 50 05 12 CA
[19:50:54.162126] SPI > 06 01 04 01 13 01 E8
[19:50:54.170103] SPO < 06
[19:50:54.321470] SPI > 01 05 00 13 12 01 FA
[19:50:54.329415] SPO < 06
2014-08-03T19:50:54.3397520+00:00       HomeAutomation.ZWave    33      ZWave Node      Status.Level    0.8

Let me know if theres anything else you want me to try..

RichieC
Title: Re: Zwave Thermostat
Post by: lozza on August 05, 2014, 04:49:11 PM
That works great!  Thanks Gene and Mike.

Hi All
I too have the CT-100 thermostat at home and am trying to get it to work with HomeGenie. I am having the same issue as Bradvoy - I can add it as a node, but it does not send info back to HomeGenie on it's status. I have tried to search for a tutorial on how to add the script that Gene wrote (which seems to have fixed Bradvoy's issue) but I can't figure out how to code in that part. I am running the latest version of HomeGenie on a Raspberry PI. I would really appreciate guidance, even if it is a link to an existing tutorial.

Also - I have downloaded the HomeGenie app for Android but I can't seem to be able to click on the thermostat to update it within the app - is this a feature that is not ready yet?

Thanks in advance!
Lozza
Title: Re: Zwave Thermostat
Post by: RichieC on August 13, 2014, 01:13:08 PM
Mike,

Have you had a chance to look at this?

My Log file is in my previous post.

Would love to get this working.. I have done some C programming (but not much with C# so far) so if there's anything i can do to help debug this code,  let me know...

Richie


Sorry-  I've been gone from the forum for a bit.  Busy week!

Richie...can you post your log file (from the homegenie directory...not the event history)?  So the good thing is that the device is reporting the temperature correctly and sending events! 

Have you tried sending a higher temperature to see if it works (even try sending plausible F temps)

The "status.level" is a byproduct of extending the sensor class...it's actually sending a thermostat command.  I'll know more if you can send the logfile (with the raw io bytes)


I'm going to think about the issue you had a bit and see if I can figure it out.
Title: Re: Zwave Thermostat
Post by: miket on August 16, 2014, 11:40:32 PM
Perfect-  thanks for posting the log, that is exactly what I need to debug.  Checking it out now
Title: Re: Zwave Thermostat
Post by: RichieC on August 20, 2014, 10:29:51 AM
Did you manage to find anything from this log?

Perfect-  thanks for posting the log, that is exactly what I need to debug.  Checking it out now
Title: Re: Zwave Thermostat
Post by: bwoods1 on September 12, 2014, 12:50:38 PM
I am having the same issue as Bradvoy and Lozza, would anyone mind showing/explaining this to us. We would greatly appreciate it. Thank you.
Title: Re: Zwave Thermostat
Post by: RichieC on September 18, 2014, 11:10:03 AM
Mike,

Just wondering if you got anywhere with this - would love to get this working...

Rich

Perfect-  thanks for posting the log, that is exactly what I need to debug.  Checking it out now
Title: Re: Zwave Thermostat
Post by: Damien on September 18, 2014, 05:51:24 PM
I am in the same boat here...have a CT-100 thermostat. Used to work well with "InControl" on a Windows7 PC. I recently decided to move to a pi to minimize power usage from this PC being on 24/7 (MySQL, XBMC, rtorrent and zwave server), got it all working well, and I am actually pretty amazed with what the little pi can do!

I have a tricklestar zwave stick, a few zwave switches and dimmers (all working perfectly), and that one CT-100 thermostat.

The screenshot a couple posts above is what I am getting...
Looking forward to a solution!
Title: Re: Zwave Thermostat
Post by: jarrettv on September 24, 2014, 04:05:53 AM
I'm also seeing this on my new CT-100 thermostat. I hope to debug once I get moved in and unpack my dev machine.
Title: Re: Zwave Thermostat
Post by: bwoods1 on September 29, 2014, 07:32:01 PM
We look forward to your findings!
Title: Re: Zwave Thermostat
Post by: kebob on October 07, 2014, 12:02:51 PM
I'm new to Z-Wave (and HA in general) but received a Z-Stick at the weekend and have been playing about ever since.

I have the same Room Stat and Boiler switch as RichieC - HRT4 & ASR. Managed to get things all paired up pretty easily. But unfortunately I didn't get any further than RichieC with regards to changing the Thermostat Setpoint from Homgenie...

I've tried sending various commands via urls/api but nothing that updates the temp on the Stat.

Being new to all this I'm not really sure where to look next - I'm guessing that "Therm.Temp" etc etc that gets sent isnt actually what gets sent out to the device, it's just a command class/code set somewhere in the Homegenie files? And that what actually gets sent is a byte code of some sort?

Or am I way off?  ;D

I'm not really sure I can get any further without help!

E: I have mucked about with the layouts etc slightly. eg, removed the 'cool' button and I amended the widget temp circle slider to send more suitable values for my system (5'C - 30'C) but that doesnt make any difference to actual functionality (or at least it's not broken anything because I cant get it working in the first place!).

Edit 2: I'm probably way off the mark here, but on the slim chance it means something - the ZwavwLib.dll & MIG.dll only has setpoint "GET" entries, nothing for SET? Can a GET request through Zwave also make a change?

Edit 3: nm, I'm returning the Z-Stick and giving the VeraLite a go instead!
Title: Re: Zwave Thermostat
Post by: bkenobi on October 13, 2014, 05:27:24 PM
This may not be the best place to ask this, but I have questions about the capabilities of these Zwave (and other protocol) thermostats.  I currently have a Honeywell thermostat that has no connectivity capabilities.  I could have purchased one at the time of installation (end 2011 I think) that had WiFi, but nothing supported it and it appears somewhat deprecated now.  The thermostat is very nice, but I want more flexibility.

So, what I want to know is what you can access on these thermostats.  I need to be able to know what the outside temperature is (based on the sensor installed in my heat pump that the thermostat displays).  I need to know the inside temperature (I could add a sensor, but the thermostat already knows what it uses so I want that value).  Most importantly, I want to control the set point.

My goal is logically simple to me, but apparently no thermostat has the functionality I want available so I need to add code.  Since the logic is relatively simple (assuming I know the inside and outside temperatures), I figured I could just add on to HG with a script that uses the Zwave Thermostat code (or another compatible thermostat).
Title: Re: Zwave Thermostat
Post by: bradvoy on October 31, 2014, 03:36:14 AM
This week I discovered a new problem with my thermostat (CT101) and its operation with HomeGenie.  When the thermostat is in cooling mode, I'm able to control the set point via HG.  But when the thermostat is in heating mode, it seems to ignore commands to change the set point from HG.  Has anyone else noticed this problem?  Is anyone aware of a solution?
Title: Re: Zwave Thermostat
Post by: mblack on November 05, 2014, 01:51:31 PM
Same problem on my Ct-30 and Ct-100 thermostats.
Title: Re: Zwave Thermostat
Post by: mblack on November 06, 2014, 03:53:00 AM
It looks like the program is using a generic thermostat definition. The 2gig thermostats have separate heating and cooling temperature setpoints and must use an index number to write to them ( I assume the cooling temperature setpoint must be the default, but I do not know enough about coding to add a definition for these thermostats. What I have learned is from using an openzwave app. The one thing they mention in that definition for the 2gig thermostats is that their setpoint descriptions are 0 based, not 1, whatever that means.
Title: Re: Zwave Thermostat
Post by: miket on November 07, 2014, 03:11:57 PM
Sorry everyone for being gone for so long!  I was crazy busy!  There are some big bugs in the thermostat, but I'm getting my head around them. 

The tough part is that I've never found a comprehensive documentation for the thermostat command classes.  So I'm just working it out as I go.  (If anyone finds something like this please post!)

I've attached a quick fix for the next month (this will let you only set for heat now, the old one only set for cold) until I have time to do the large rewrite of the code that is needed.   Drop it in the main homegenie folder and restart.

Keep posting your bugs and I think I'll be able to put some time on this by December.   
Title: Re: Zwave Thermostat
Post by: miket on November 07, 2014, 03:16:05 PM
Also-  did you guys have any luck with the association?  I just added another thermostat and I realized that I had to configure the association (to send unsolicited messages) from both the thermostat and homegenie.   (Associate with node 1, as always!)

When I do the rewrite, I'm going to see if I can add "polling" in case you can't get the announcements to work.   

Again-  sorry for leaving everyone (literally) in the cold.  I'm going to  be gone from the forum for another month or so, but keep posting bugs and I'll try and collect them all at the same time.

I also figured out that my thermostat can do Celsius, so I'll try and fix that at the same time!
Title: Re: Zwave Thermostat
Post by: mblack on November 07, 2014, 06:27:48 PM
I think I know how to fix the temperature issue for heat and cool. MikeT, did you change the index number from 0x02 to 0x01 in the Thermostat.cs file  to make the heat only work ?
Title: Re: Zwave Thermostat
Post by: miket on November 08, 2014, 01:08:31 AM
Yes!  That is exactly what I did.,  So I just hardcoded that for the time being (since it is winter).  When I have some time I am going to work out a more elegant solution.  =) 

If you are a programmer, feel free to get in there and suggest changes.  I think there are 3 or four different things that I have to change after testing for the last couple of months
1)  Is a better way to set heat/cold  (when I wrote the original, I thought there was only one setpoint)
2)A better way to handle F/C
Title: Re: Zwave Thermostat
Post by: bradvoy on November 08, 2014, 04:21:54 PM
Mike, thanks for your work on this.  I just downloaded your updated dll and can confirm that I'm now able to control the heat setpoint on my thermostats.

I don't understand what it means to configure the association.  I don't see anything in the HomeGenie UI related to associations.  Am I overlooking something?
Title: Re: Zwave Thermostat
Post by: mblack on November 08, 2014, 05:15:59 PM
MikeT,

Although I have dealt with code for many years, I wouldn't call myself a programmer. I would be glad to send you the changes to the 2 .cs files that are needed to support 2 setpoints if you could compile them and post them.
As far as the Fahrenheit vs. celcius issue, I haven't even looked at that yet.
Title: Re: Zwave Thermostat
Post by: mblack on November 09, 2014, 01:26:59 PM
MikeT, I don't have a compiler installed, so if you could run these two files, i think it would give us both heat and cool setpoints. I do not know how to modify widgets, so the current thermostat widget will only display the cool setpoint, but we can test via html command line. Many thanks.
Title: Re: Zwave Thermostat
Post by: Gene on November 10, 2014, 12:42:52 PM
Hello everyone,

since I'm also working on thermostat widget, I'm sharing some thoughts so we can discuss them.

I've setup a codepen page where the widget can be edited:

http://codepen.io/anon/pen/bNbLQj?editors=101 (http://codepen.io/anon/pen/bNbLQj?editors=101)

inside this editor we can edit both the widget html and json files and also have a live preview with almost all functionalities.

The widget should be compatible with previous mike version, but it is not completed. Here some considerations:

1) it should support both Cool setpoint and Heat setpoint with own values (Thermostat.HeatSetPoint and Thermostat.CoolSetPoint fields)
2) it should hide various fields automatically when not in use by current module
3) it should support mixed Cool+Heat mode as well
4) it should set the unit to celsius or fahrenheit by reading the Sensor.Temperature.Unit field (with 'Celsius' or 'Fahrenheit' value)
5) it should store human-readable values into  high-level field like Thermostat.OperatingState and Thermostat.Mode, so numbers will be replaced by the matching word value
6) images used to display heat/cool/fan are currently fetched from external sites, but these wiil be locally copied to homegenie/generic/images  folder
7) the currently implemented api Therm.* should be renamed to reflect MIG/HomeGenie logic. these names should be fully human readable and should be usable not just for Z-Wave. So to have a syntax like:
Code: [Select]
Thermostat.Mode.Get
Thermostat.Mode.Set
Thermostat.Status.Get
Thermostat.Temperature.Get
Thermostat.FanMode.Get
Thermostat.FanMode.Set
Thermostat.HeatPoint.Get
Thermostat.HeatPoint.Set
Thermostat.CoolPoint.Get
Thermostat.CoolPoint.Set

please feel free to help with your thoughts and considerations.

I'm also attacching a very very preview of the "Generic Thermostat" APP that will let use any temperature sensor module and any switch/relay module to implement a thermostat within HomeGenie (this will be used with Eden Sensor Board). This app is also using the generic thermostat widget.

Cheers,
g.

UPDATE #1: updated generic thermostat app with some comments
UPDATE #2: implemented heat mode logic in generic thermostat app
UPDATE #3: changed api commands as discussed above
Title: Re: Zwave Thermostat
Post by: Gene on November 11, 2014, 01:26:58 AM
Attacched a preview of the proposed thermostat widget. Currently the options popup is still to be reviewed.
I added a variable "displayUnit" at the beginning of the .json file to allow manually select from Celsius to Fahrenheit.
In the final version this setting will be probably read from a module property (Sensor.Temperature.Unit pheraps).
Also the api command is changed to reflect the syntax discussed in the previous message .

MikeT: can you change the ZWave class accordingly? Is it ok for you or do you have some other suggestion?

I'm still thinking how the options popup will let the user set different values for "Cool" and "Heat" modes.... any suggestion about this part of the UI?
Also I am not sure how the Fan Mode works. Can some of you give me some directions about how to implement this in the widget UI, or is it just a read-only parameter?

Cheers,
g.
Title: Re: Zwave Thermostat
Post by: Gene on November 11, 2014, 02:16:38 PM
The new thermostat widget has now its own thread here:

http://www.homegenie.it/forum/index.php?topic=458.msg2554 (http://www.homegenie.it/forum/index.php?topic=458.msg2554)

Cheers,
g.
Title: Re: Zwave Thermostat
Post by: Gene on November 12, 2014, 08:07:22 PM
Hi MikeT and everyone,

had some time to review zwave thermostat device handler.
Also packed up a new testing release so Mike and you others can check if things are still working (cannot test since don't have any thermostat dev).

http://www.homegenie.it/forum/index.php?topic=129.msg2568#msg2568 (http://www.homegenie.it/forum/index.php?topic=129.msg2568#msg2568)

This is the new code:

https://github.com/genielabs/HomeGenie/blob/master/MIG/Support%20Libraries/ZWaveLib/Devices/ProductHandlers/Generic/Thermostat.cs (https://github.com/genielabs/HomeGenie/blob/master/MIG/Support%20Libraries/ZWaveLib/Devices/ProductHandlers/Generic/Thermostat.cs)

https://github.com/genielabs/HomeGenie/blob/master/MIG/MIG/Interfaces/HomeAutomation/ZWave.cs#L88 (https://github.com/genielabs/HomeGenie/blob/master/MIG/MIG/Interfaces/HomeAutomation/ZWave.cs#L88)

also the thermostat widget has been updated and should work with the new api.

Cheers,
g.
Title: Re: Zwave Thermostat
Post by: Bkeitht on March 29, 2017, 04:54:32 AM
Hey everyone,

I have Homegenie running several switches and sensors and it's working really well. I bought a CT 30 thermostat with the Zwave USNAP module. My HVAC is a heat pump and when I connect the CT 30 without the USNAP module it works fine. However, when I attach the USNAP and it starts communicating with Homegenie the thermostat exhibits the following problems:
- The Save Energy button refuses to turn off and this makes setting the temperature impossible. It seems that when I change the System.Level parameter to 1 the Save Energy feature turns off. However after Homegenie queries the USNAP then the Save Energy feature turns back on.

Is there a place where i can permanently set the System.Level parameter to 1 to verify this resolves the problem? Or are there any alternative troubleshooting ideas that I could use to help figure out what the issue is?