Page 1 of 1

Detecting temperature trends

Posted: Sat Nov 21, 2009 4:58 am
by cbhiii
Which variable is going to be more sensitive at detecting a rising or falling temperature?

[last15m_th0_temp_trend]
or
[last60m_th0_temp_trend]

If the temperature starts to rise or fall, which one will detect it first?

Thanks for your insight and help.

Re:Detecting temperature trends

Posted: Sat Nov 21, 2009 6:56 am
by WS Grave
I wanted to say that to you when I visited your site yesterday.
You should use the day1 trends.
I also had the 15 minutes trends, but the arrows were mostly leveled.
The day1 trends gives the result you're looking for :)

Re:Detecting temperature trends

Posted: Sat Nov 21, 2009 6:29 pm
by cbhiii
That's just what it thought, but the Day1 value doesn't seem to change fast enough either over the course of the day. Maybe using "last24h" would be better? Because at the end of the day things get reset right at midnight and so the value would not be a good representation of the past day.

Re:Detecting temperature trends

Posted: Sun Nov 22, 2009 7:14 am
by cbhiii
After watching all 4 different types today (15m, 60, 24h, day1) I've decided that 'last24h' appears to be the best as it shows trends right away and does not go back to 0 at midnight like 'day1' does.

Best of luck!

Re:Detecting temperature trends

Posted: Sun Nov 22, 2009 9:22 am
by WS Grave
I've also changed to last24h.
I had noticed strange behaviour before, and it was after midnight, so you're right about that.

Re:Detecting temperature trends

Posted: Mon Nov 23, 2009 9:19 pm
by cbhiii
I have figured it out. It is more simple than we thought. I watched the readings all yesterday to confirm.

The trend is calculated by taking the [actual temp] and comparing it to the [average temp] of that time period. If the current temp is higher, the trend is 1. If the current temp is lower, the trend is -1.

So you need to decide if you want to see a trend over the [last60m] which is a small window or do you want to see it over the [last24h] which is way too large.

When I tried [last24h] I saw current temp readings that were above the average so the trend is 1, but the temperatures were falling - so this is wrong and not what we are looking for. I'm stuck with "last60m" for now.

A better solution would be to have a "last3h" variable to watch the trend over the last 3 hours. That would be an excellent block of time to monitor trends.

Re:Detecting temperature trends

Posted: Mon Nov 23, 2009 11:28 pm
by cbhiii
This code might work for 6 hour trends. I just started playing with it, so no promises. It uses the 6 hour WD values.

Code: Select all

<script type="text/javascript"> 
 
var trend=""; 
var tnow = "[actual_th0_temp_f]"; 
var tac = "[seqhour6_th0_temp_c@1:-]"; 
taf = Math.round(((1.8*tac)+32)*10)/10; 
 
if (tnow>taf){trend="1"} 
else if (tnow<taf){trend="-1"} 
else if (tnow==taf){trend="0"} 
 
document.write(trend); 
 
</script>