Jump to content

Thermostat In Programs...


kevkmartin

Recommended Posts

I finally got my Insteon / Venstar 2491Tup and running.

 

It works well in the admin panel, properly reporting and updating.

 

My next project wit it was going to be setting up a simple daily "Climate Control" e-mail notification.

 

I set up a custom notification. The goal was to include the current Heat and Cool Setpoints, as well as the number of cycles of heating / cooling called for that day.

 

I set up two (non-state) variables Heat_Cycles_Today, and Cool_Cycles_Today. I also wrote two simple programs:

 

Update_Cool_Cycle_Count

 

If

Status 'Thermostat / 14.67.A7 - Cool Control' is On

Then

$Cool_Cycles_Today +=1

$Cool_Cycles_Today Init To $Cool_Cycles_Today

Else

No Actions

 

 

 

Update_Heat_Cycle_Count

 

If

Status 'Thermostat / 14.67.A7 - Heat Control' is On

Then

$Heat_Cycles_Today +=1

$Heat_Cycles_Today Init To $Heat_Cycles_Today

Else

No Actions

 

 

At midnight, I received my first status e-mail; it reported NO Heat or Cool Cycles. I know the heat came on that day.

 

My first thought was that I needed to query the thermostat to pick up the Heat Status, so I wrote a program (and ran it) that queried the Thermostat once a minute.

 

At midnight, I received my second status e-mail; it still reported NO Heat or Cool Cycles.

 

I* have also found NO way (programmaticly) to retrieve the current heat / cool set points.

 

Any help?

Link to comment

The reason I ask, is that I have seen if I do a notification with a variable, and then change the variable. the notification shows the new value, unless I insert a wait before updating or resetting the variable.. I guess this is due tot he fact the the ISY is a state driven machine

Link to comment

If

Control 'Main Floor - Heat Control' is switched On

 

Then

$Int_12 += 1

$Int_12 Init To $Int_12

 

Else

- No Actions - (To add one, press 'Action')

 

I just tried the above, and manually made the heat come on and off, and my variable incremented each time.

Link to comment

I don't know what the tstat sends when. If Status was not working and a command is sent when the heat comes On it is because there was no corresponding heat Off. The Status MUST change for an If Status to trigger a Program. The Event Viewer will show what commands are flowing from the tstat. That will show what the tstat sends when the heat cycles.

Link to comment

I am subscribing to this as I am trying to figure out how to accomplish the same goal. :roll: I have four of these TSTATS deployed right now and want to know when they turn on / off.

 

This will allow me more insight as to the state of the home.

 

Teken . . .

Link to comment

Solved it (at least one part)!!!

 

This certainly wasn't obvious to me, so I hope it helps others.

 

Instead of using the control or status of the Heat or Cool nodes, I noticed that there was an option in the program pull down for the MAIN thermostat node called "Calling For Heat" and "Calling For Cool". When I changed my if statements to look at THOSE... worked like a champ!!!

 

Now... can anyone help figure out how to get the current set points (and possibly even the fan status) into variables so that the can be included in my report?

Link to comment
Solved it (at least one part)!!!

 

This certainly wasn't obvious to me, so I hope it helps others.

 

Instead of using the control or status of the Heat or Cool nodes, I noticed that there was an option in the program pull down for the MAIN thermostat node called "Calling For Heat" and "Calling For Cool". When I changed my if statements to look at THOSE... worked like a champ!!!

 

Now... can anyone help figure out how to get the current set points (and possibly even the fan status) into variables so that the can be included in my report?

 

Would you mind posting up the final code once its confirmed to be working. As I have the same needs and requirements as well.

 

Teken . . .

Link to comment
Solved it (at least one part)!!!

 

This certainly wasn't obvious to me, so I hope it helps others.

 

Instead of using the control or status of the Heat or Cool nodes, I noticed that there was an option in the program pull down for the MAIN thermostat node called "Calling For Heat" and "Calling For Cool". When I changed my if statements to look at THOSE... worked like a champ!!!

 

Now... can anyone help figure out how to get the current set points (and possibly even the fan status) into variables so that the can be included in my report?

 

Would you mind posting up the final code once its confirmed to be working. As I have the same needs and requirements as well.

 

Teken . . .

 

 

Sure. Here's what I ended up with:

 

Define variables (non-state):

 

$Cool_Cycles_Today

$Heat_Cycles_Today

 

 

 

Define Custom Notification:

 

Climate_Status

 

 

 

Programs:

 

 

 

Update_Cool_Cycle_Count

 

If

Status 'Thermostat / 14.67.A7 - Main' is Calling for Cool

 

Then

$Cool_Cycles_Today +=1

$Cool_Cycles_Today Init To $Cool_Cycles_Today

 

Else

No Actions

 

 

 

 

Update_Heat_Cycle_Count

 

If

Status 'Thermostat / 14.67.A7 - Main' is Calling For Heat

 

Then

$Heat_Cycles_Today +=1

$Heat_Cycles_Today Init To $Heat_Cycles_Today

 

Else

No Actions

 

 

Send_Climate_Status_And_Reset_Variables

 

 

If Time is 11:59:30PM

 

Then

Set 'Thermostat / 14.67.A7 - Main' Query

Send Notification to 'kevkmartin e-mails' content 'Climate Status'

$Heat_Cycles_Today = 0

$Heat_Cycles_Today Init To 0

$Cool_Cycles_Today = 0

$Cool_Cycles_Today Init To 0

 

Else

No Actions

 

 

Let me know if you need anything else (or figure out how to get the current set-points and fan condition).

Link to comment

To get a Thermostat temperature (or set point) value into a variable, here's a way although It's not pretty but it works.

 

I created dozens of mini programs to set the state variable $S_1stThermostat to the current status of the 1st floor thermostat. Each program is a particular temperature. Here's one example for 57 degrees. I created one for each temperature from 55 degrees to 85 degrees (probably need higher ones for the summer, at least on the 2nd floor).

 

I know that chews up a lot of programs but that's the best I could come up with at the moment. I also send a status message every morning that tells me the temperature of my beer keg, chest freezer, whether the house is in "Leave" or "Return" state, and now both Thermostat temperature and set points! Makes me feel good when I get that text message from ISY every morning knowing it is healthy and so is my house.

 

 

If

Status '1st Flr Tstat - Main' is 57° (Temperature)

 

Then

$S_1stThermostat = 57

 

Else

- No Actions - (To add one, press 'Action')

Link to comment
To get a Thermostat temperature (or set point) value into a variable, here's a way although It's not pretty but it works.

 

I created dozens of mini programs to set the state variable $S_1stThermostat to the current status of the 1st floor thermostat. Each program is a particular temperature. Here's one example for 57 degrees. I created one for each temperature from 55 degrees to 85 degrees (probably need higher ones for the summer, at least on the 2nd floor).

 

I know that chews up a lot of programs but that's the best I could come up with at the moment. I also send a status message every morning that tells me the temperature of my beer keg, chest freezer, whether the house is in "Leave" or "Return" state, and now both Thermostat temperature and set points! Makes me feel good when I get that text message from ISY every morning knowing it is healthy and so is my house.

 

 

If

Status '1st Flr Tstat - Main' is 57° (Temperature)

 

Then

$S_1stThermostat = 57

 

Else

- No Actions - (To add one, press 'Action')

 

 

After sleeping on this more, I came up with a much better way eliminating all of these programs and even more that I would have eventually needed for the cooling season. By using REST to pull the Thermostat information and then again using REST to assign those pulled values back to ISY variables, I can do the same thing with a script and 8 lines of code. I already have some other scripts running on my iMac so it will be very easy to integrate these into them.

 

I searched far and wide for REST syntax for Thermostats and finally found everything necessary.

 

First, pull the thermostat temperature (using ST for status) and set points (CLISPH for Heat set point, CLISPC for Cooling set point) and assign to temporary variables in the script. Note that the NODE address must include %20 for the spaces. My 1st floor Thermostat Insteon address is 11.BE.42 so the NODE_ADDRESS used below would be 11%20BE%2042%201 where that last 1 is the first component of the Thermostat device (others being Heat Control, Cool Control & Fan Control).

 

#

# get ISY Thermostat temperature & set points and assign to temporary variables

#

1stthermtemp=`curl -u : -s http:///rest/nodes//ST | cut -f6 -d' '| cut -c12-13`

1stthermset=`curl -u : -s http:///rest/nodes//CLISPH | cut -f6 -d' '| cut -c12-13`

2ndthermtemp=`curl -u : -s http:///rest/nodes//ST | cut -f6 -d' '| cut -c12-13`

2ndthermset=`curl -u : -s http:///rest/nodes//CLISPH | cut -f6 -d' '| cut -c12-13`

 

My example looked like the following (without the space after http: in order for it to not create an automatic link here):

 

1stthermtemp=`curl -u myuser:mypassword -s http: //192.168.15.152:5052/rest/nodes/11%20BE%2042%201/ST | cut -f6 -d' '| cut -c12-13`

 

I then take these acquired values and set them back to ISY variables where I can make use of them in programs! The ISY_variable_type is a 1 for Integer variables, 2 for State variables. Note that the variables must first be created in ISY and then take the ID number assigned by ISY and plug it into ISY_variable_ID. They are sequentially assigned by ISY.

#

# set ISY variables

#

curl -u : -s http:///rest/vars/set///$1sttermtemp > /dev/null

curl -u : -s http:///rest/vars/set///$1stthermset > /dev/null

curl -u : -s http:///rest/vars/set///$2ndthermtemp > /dev/null

curl -u : -s http:///rest/vars/set///$2ndthermset >/dev/null

 

My example looked like the following using state variable type (2) and variable ID 15 (without the space after http: in order for it to not create an automatic link here):

 

curl -u myuser:mypassword -s http: //192.168.15.152:5052/rest/vars/set/2/15/$1sttermtemp > dev/null

 

 

 

One can do so much with the rest interface. Hope this helps out others.

Link to comment

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.3k
×
×
  • Create New...