I’m new to webCoRE and this is my first post, i have webCoRE installed and working in SmartThings.
I’m looking or may have to write a piston(s) to control my thermostat (i have three) modes (heating, off, cooling) based on outside temperature (if below 55 turn on heat, if between 60 and 70 turn off, if above 80 turn on cool) and then turn off thermostat if a window is open and on cool. This is not to change the heating or cooling set points, which is controlled by SmartThings (mode and presence sensors).
I would like this to be how i would manually control a thermostat my self, if really cold outside then finally turn on heat, if really hot turn on the A/C, if mild out set off; but i don’t want it to be “hunting”. So I think the most efficient way would be to start making this mode based; heat, off, cool and perhaps auto (which i never use but if it was on auto stay on auto and turn off thermostat when windows are open and above a certain temp, perhaps 40 degrees) as the first logical checks. I would want the heat to stay on, perhaps get a notification, if window(s) are open as i don’t want the pipes to freeze!
I have window contact sensors on my honeywell vista-128 alarm panel integrated with SmartThings thru envisalink 4 panel emulator device, and I also have the outdoor temperature from my davis vantage pro2 weather station integrated with SmartThings thru an Ambient Weather App.
I saw this post Created a Piston to turn off thermostat when door is open on how to capture the state of something. i do think i would want to create variables for temperature points.
I think i need would need to create a variable, say “target state” and initialize it to current TS state at piston start up, and then use that as my logical test.
rough draft:
capture thermostats state
if target state is heat do
notify if window is open
if outdoor temp is above 60 turn off TS and change target state to off
end if
if target state is off do
if outdoor temp below 55 turn on heat and change target state to heat
if outdoor temp above 80 turn on cool and change target state to cool
end if
if target state is cool do
if window open, capture TS state and then turn off TS and return to cool when window(s) close
if outdoor temp below 70 turn off and change target state to off
end if
if target state auto do
if window open, capture TS state and then turn off TS and return to cool when window(s) close
end if
loop back to after capture TS state
thought please and all help is welcome:D