We have moved at community.getvera.com

Author Topic: Can i check a thermostat setpoint ?  (Read 6157 times)

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Can i check a thermostat setpoint ?
« on: November 22, 2013, 02:30:31 pm »
My StellaZs do not always react to a setpoint change. At the moment i am using a scene which repeats the setpoint every 5 mins, so that at every wakeup it should get the new setpoint. This is now working with a 99% reliability. I thought it might be better though to somehow get the current setpoint in a variable, and then somehow compare it to the desired setpoint in PLEG. Then use PLEG to repeat the desired setpoint until it has been accepted by the thermostat. Is that possible, if so how would i do it ? I can probably work out the logic once i have the setpoint in a variable or something, that is the main issue for me

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: Can i check a thermostat setpoint ?
« Reply #1 on: November 22, 2013, 05:46:32 pm »
I don't know about the StellaZ but most thermostats have a variable CurrentSetpoint. If you create a PLEG Device Property for this you can include it in a condition expression to compare it with your desired value.

If your target value is calculated in a condition expression, you can send it to the device using the SetCurrentSetpoint  NewCurrentSetpoint = {(condition-name-or-expression)} feature.

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: Can i check a thermostat setpoint ?
« Reply #2 on: November 24, 2013, 09:20:24 am »
I have set up a currentsetpoint variable, StudySetpoint. My thermostat has a wakeup interval of 240 secs. So once the setpoint changes, i need to check 245 seconds later if it has been changed. I have 2 setpoint temperatures, 2 degrees and 24 degrees. StudyHeatOn triggers my scene to set it to 24 degrees, StudyHeatOff to 2 degrees via another scene.

StudyHeatOn   (StudyWD1 or StudyWE1 or StudyWE2) and NOT Away   2013-11-24 13:00:00.204    true
StudyHeatOff   NOT StudyHeatOn or Away   2013-11-20 22:00:00.161    false

These are the current conditions which i want to change. StudyWD1 or StudyWE1 or StudyWE2 are schedules to determine if the thermostat should be on.

I am not sure how to do this from here though

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: Can i check a thermostat setpoint ?
« Reply #3 on: November 24, 2013, 02:27:30 pm »
I have not tested this logic but I would try something like this:

Conditions
StudyHeatOn   (StudyWD1 or StudyWE1 or StudyWE2) and NOT Away
StudyTarget   StudyHeatOn ? 24 : 2
SendStudySP   (StudySetPoint != StudyTarget) and (SendStudySP; Now > 4:05)

Actions
SendStudySP   SetCurrentSetpoint   NewCurrentSetpoint={(StudyTarget)}

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: Can i check a thermostat setpoint ?
« Reply #4 on: November 24, 2013, 04:14:16 pm »
I am going to try that, i think that might work. I do not understand all of it yet, and some of it i did not know you can do, so i learnt something again which is good. I assume
Quote
StudyTarget   StudyHeatOn ? 24 : 2
this turns to 24 when true, otherwise 2. I did not know that function (but i am not very good at deciphering the PLEG wiki i have to say)
If i changed the setpoint manually to something other than 24 or 2, would that setpoint then stay until the next automatic setpoint change ? That is something else which i would like to have just in case. If theis function
Quote
SendStudySP   (StudySetPoint != StudyTarget) and (SendStudySP; Now > 4:05)
only checks when scheduled changes occur (via StudyHeatOn) then it would work. I dont understand what the ! after the expression does, thats why i am not sure exactly what it does

I really appreciate your input ! Great help.

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: Can i check a thermostat setpoint ?
« Reply #5 on: November 24, 2013, 05:08:41 pm »
Quote
If i changed the setpoint manually to something other than 24 or 2, would that setpoint then stay until the next automatic setpoint change ? That is something else which i would like to have just in case.
The logic I suggested will attempt to override any manual setting. If you want a manual override facility, you will have to change the logic to be event-driven rather than comparing target and setpoint. One possibility would be to define a PLEG self-triggered timer of 4:05 and start it with an action when you send the new setpoint. When the timer expires, you can check whether the setpoint stuck and, if not, resend it. Try to identify all required functionality before starting to design the logic.

Quote
I dont understand what the ! after the expression does, thats why i am not sure exactly what it does
SendStudySP has two parts:

(StudySetPoint != StudyTarget) will be true when the current setpoint does not equal the target setpoint. This will happen when the target setpoint changes due to StudyHeatOn changing, if you manually change the current setpoint or if the SetCurrentSetpoint action was not successful.

The second part: and (SendStudySP; Now > 4:05) is intended to repeat the action every 4:05 until the current setpoint matches the target. It does this by reference to the timestamp when the condition was last true - and therefore the action last fired.

So as long as the current setpoint does not equal the target setpoint, the condition and action will fire every 4:05. In practice the time will be about 5 minutes because NOW runs once per minute.

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: Can i check a thermostat setpoint ?
« Reply #6 on: November 24, 2013, 07:32:09 pm »
Another simple approach is to define the action with built-in retries. Just add delays of, say, 5 minutes to the action and repeat the SetCurrentSetpoint command.

I have a few mission-critical actions where I repeat the command three times with appropriate delays. In most cases the action works on the first attempt but, if not, it gets two more shots. If it fails after three attempts, it's broken.  :o
 

Offline BrianLBeaton

  • Sr. Member
  • ****
  • Posts: 325
  • Karma: +12/-1
Re: Can i check a thermostat setpoint ?
« Reply #7 on: November 24, 2013, 08:07:20 pm »
I have a few mission-critical actions where I repeat the command three times with appropriate delays.

Rex: What do you consider to be be critical to your home's 'mission'?

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: Can i check a thermostat setpoint ?
« Reply #8 on: November 25, 2013, 03:21:46 am »
Quote
Rex: What do you consider to be be critical to your home's 'mission'?
It is the home-automation that has the mission - the reason I installed it in the first place. This is to make my home apparently occupied when I am not there.

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: Can i check a thermostat setpoint ?
« Reply #9 on: November 25, 2013, 05:13:41 am »
Another simple approach is to define the action with built-in retries. Just add delays of, say, 5 minutes to the action and repeat the SetCurrentSetpoint command.

I have a few mission-critical actions where I repeat the command three times with appropriate delays. In most cases the action works on the first attempt but, if not, it gets two more shots. If it fails after three attempts, it's broken.  :o

I am doing that at the moment with my scenes. I had it at 3 repeats, as i still had a few failures to set the setpoint, i upped it to 4 setpoint resends (every 4.05 mins to make sure its awake). Fairly decent reliability, But still, when i got up this morning the house was cold as the thermostat was still on night time setting. That is the reason i wanted to use a different logic.
I think if i could somehow to get your logic to ignore setpoints which are not 24 or 2, and then just change them on the next scheduled event. Meaning, when i change it manually i have to change it to something different than 2 or 24, and then it should be ignored until the next scheduled change. Is that a possibility ?

Quote
The logic I suggested will attempt to override any manual setting. If you want a manual override facility, you will have to change the logic to be event-driven rather than comparing target and setpoint. One possibility would be to define a PLEG self-triggered timer of 4:05 and start it with an action when you send the new setpoint. When the timer expires, you can check whether the setpoint stuck and, if not, resend it. Try to identify all required functionality before starting to design the logic.


This sounds like it could be a solution. But how do i do the self triggered timer ?
« Last Edit: November 25, 2013, 05:21:59 am by mikee123 »

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: Can i check a thermostat setpoint ?
« Reply #10 on: November 25, 2013, 05:55:30 am »
Quote
I think if i could somehow to get your logic to ignore setpoints which are not 24 or 2, and then just change them on the next scheduled event. Meaning, when i change it manually i have to change it to something different than 2 or 24, and then it should be ignored until the next scheduled change. Is that a possibility ?
Yes that is easy to do but would it work as you want? It would mean that if you set the 'stat to, say, 20 degrees the logic would not change it to 2 or 24 when StudyHeatOn changed. How is the logic to determine the difference between an unresponsive thermostat and one that has been manually adjusted?

Quote
But how do i do the self triggered timer ?
Create a new timer (MyTimer) in your PLEG and set Start Type: to Self Trigger, Stop Type: to Interval and Every to the required duration (4:10?).

You start the timer using the PLEG action StartTimer for the timer name. You would do this from the condition that sends the SetCurrentSetpoint action as a result of StudyHeatOn changing.

Now you need a condition that fires when the timer finishes and the setpoint is still wrong:
TimerEnded !MyTimer
ResendSP   TimerEnded AND (TimerEnded; NOW < 1:00) AND (StudySetPoint != StudyTarget)

The action for this condition should resend the SetCurrentSetpoint and also start the timer again.

I have not tested this. It may need some additional lockout terms.
« Last Edit: November 25, 2013, 05:53:16 pm by RexBeckett »

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: Can i check a thermostat setpoint ?
« Reply #11 on: November 25, 2013, 08:05:13 am »
This is what i have created, testing now...

Device Properties
StudySetpoint Study Rad CurrentSetpoint 2013-11-24 21:06:53  2

Conditions
StudyHeatOn (StudyWD1 or StudyWD2 or StudyWE1 or StudyWE2) and NOT Away 2013-11-24 13:00:00  false
StudyHeatOff NOT StudyHeatOn or Away 2013-11-24 22:10:00  true
StudyTarget StudyHeatOn ? 24 : 2 2013-11-25 12:44:33  2
ResendSP !StudyTimer AND (StudySetPoint != StudyTarget) 0 false
SendStudySP (StudySetPoint != StudyTarget) and (SendStudySP; Now > 4:05) 2013-11-25 12:44:33  false

Actions
Actions for Condition: StudyHeatOn
Immediate
Device Action Arguments
MultiSwitch SetStatus1 newStatus1=1
HVAC PLEG StartTimer timerName=StudyTimer

Actions for Condition: StudyHeatOff
Immediate
Device Action Arguments
MultiSwitch SetStatus1 newStatus1=0

Actions for Condition: ResendSP
Immediate
Device Action Arguments
Study Rad SetCurrentSetpoint NewCurrentSetpoint={(StudyTarget)}
HVAC PLEG StartTimer timerName=StudyTimer

Actions for Condition: SendStudySP
Immediate
Device Action Arguments
Study Rad SetCurrentSetpoint NewCurrentSetpoint={(StudyTarget)}


So if this works (and i believe it does) then unless i manually enter a setpoint while the system is still trying to set a setpoint it should accept a manual setpoint and keep it until changed again by the scheduled events.
If this all works i can create the same thing for my normal heating thermostat... (cant risk the other half sitting in the cold...)

Great help RexBeckett

Hope this might help others too

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: Can i check a thermostat setpoint ?
« Reply #12 on: November 25, 2013, 09:51:58 am »
Your logic has got two different solutions running at the same time. Also I added some logic to the timer condition that you did not notice. I anticipate problems when you try changing the setpoint manually...

Remove the action and condition SendStudySP. Change the conditions to:

StudyHeatOn (StudyWD1 or StudyWD2 or StudyWE1 or StudyWE2) and NOT Away
StudyHeatOff NOT StudyHeatOn or Away
StudyTarget StudyHeatOn ? 24 : 2
TimerEnded !StudyTimer
ResendSP TimerEnded AND (StudyTimer; TimerEnded < 5:00) AND (StudySetPoint != StudyTarget)

Add an action to StudyHeatOn to SetCurrentSetpoint to 24. Add an action to StudyHeatOff to SetCurrentSetpoint to 2. Add an action to StudyHeatOff to start StudyTimer.

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: Can i check a thermostat setpoint ?
« Reply #13 on: November 25, 2013, 10:23:48 am »
Ok i have changed it to:

StudyTarget StudyHeatOn ? 24 : 2 2013-11-25 12:44:33  2
ResendSP StudyTimerEnded AND (StudyTimer; StudyTimerEnded < 5:00) AND (StudySetPoint != StudyTarget) 0 false
StudyTimerEnded !StudyTimer 2013-11-25 15:11:18  true

Actions for Condition: StudyHeatOn
Immediate
Device Action Arguments
MultiSwitch SetStatus1 newStatus1=1
HVAC PLEG StartTimer timerName=StudyTimer
Study Rad SetCurrentSetpoint NewCurrentSetpoint=24

Actions for Condition: StudyHeatOff
Immediate
Device Action Arguments
MultiSwitch SetStatus1 newStatus1=0
HVAC PLEG StartTimer timerName=StudyTimer
Study Rad SetCurrentSetpoint NewCurrentSetpoint=2

Actions for Condition: ResendSP
Immediate
Device Action Arguments
Study Rad SetCurrentSetpoint NewCurrentSetpoint={(StudyTarget)}
HVAC PLEG StartTimer timerName=StudyTimer

See how i get on with that

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: Can i check a thermostat setpoint ?
« Reply #14 on: November 25, 2013, 11:20:23 am »
That isn't what I suggested. Put StudyTimerEnded before ResendSP. The order of conditions is important in PLEG.