more G-Labs products

Author Topic: Zwave Thermostat  (Read 21850 times)

October 13, 2014, 05:27:24 PM
Reply #45

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
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).

October 31, 2014, 03:36:14 AM
Reply #46

bradvoy

  • ***
  • Information
  • Full Member
  • Posts: 50
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?

November 05, 2014, 01:51:31 PM
Reply #47

mblack

  • *
  • Information
  • Newbie
  • Posts: 14
Same problem on my Ct-30 and Ct-100 thermostats.

November 06, 2014, 03:53:00 AM
Reply #48

mblack

  • *
  • Information
  • Newbie
  • Posts: 14
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.

November 07, 2014, 03:11:57 PM
Reply #49

miket

  • **
  • Information
  • Jr. Member
  • Posts: 40
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.   

November 07, 2014, 03:16:05 PM
Reply #50

miket

  • **
  • Information
  • Jr. Member
  • Posts: 40
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!

November 07, 2014, 06:27:48 PM
Reply #51

mblack

  • *
  • Information
  • Newbie
  • Posts: 14
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 ?

November 08, 2014, 01:08:31 AM
Reply #52

miket

  • **
  • Information
  • Jr. Member
  • Posts: 40
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

November 08, 2014, 04:21:54 PM
Reply #53

bradvoy

  • ***
  • Information
  • Full Member
  • Posts: 50
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?

November 08, 2014, 05:15:59 PM
Reply #54

mblack

  • *
  • Information
  • Newbie
  • Posts: 14
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.

November 09, 2014, 01:26:59 PM
Reply #55

mblack

  • *
  • Information
  • Newbie
  • Posts: 14
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.

November 10, 2014, 12:42:52 PM
Reply #56

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
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

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
« Last Edit: November 11, 2014, 01:29:32 AM by Gene »

November 11, 2014, 01:26:58 AM
Reply #57

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
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.
« Last Edit: November 11, 2014, 01:37:10 AM by Gene »

November 11, 2014, 02:16:38 PM
Reply #58

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
The new thermostat widget has now its own thread here:

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

Cheers,
g.

November 12, 2014, 08:07:22 PM
Reply #59

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
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

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/MIG/Interfaces/HomeAutomation/ZWave.cs#L88

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

Cheers,
g.