Storing values in a list that changes daily... overwriting the oldest value


#1

1) Give a description of the problem
How do I save the temperature at 10:00am for the last 5 days, and then use today’s temperature to overwrite the oldest value? Example:
Monday - 22
Tuesday - 23
Wednesday - 24
Thursday 25
Friday 26
Saturday 27

Saturday’s temp should overwrite Monday’s 22 temp.

How can I do this?

2) What is the expected behavior?
The idea is to take an average temp for the last 5 days. If the average is 60 or greater, disable NEST thermo.

If it is less than 60, turn on the NEST thermo.

3) What is happening/not happening?
Not sure where to start… See piston below.

4) Post a Green Snapshot of the pistonimage


5) Attach any logs (From ST IDE and by turning logging level to Full)
No logs. I tested this by changing the time to 5 minutes, and it worked… It doesn’t look like days works though.
I’m not sure if NST Manager stores 5 days worth of data.


#2

Hmm I have an idea but need to put it together…


#3

I’ve tried creating a variable for the current temp
[NEST : temperature]

But you can’t use this to say ‘WAS’. You can say ‘stays’, but I don’t think that would work.

The other idea I have is based on forecast… So based on the next 7 days + today / 8 (average), do x or y.

I’m not really sure…


#4

This is the basis of shifting the data… probably the tricky part. Just to explain what I did…

dTL = day temperature list
I pre-populated the list for this test… you might want to do that with your last 5 day reading if you have access to that. If you import this piston code and click the Execute link. It should replace day 1 in the list with nextValue 24, another execution will relplace day 2 with the value of nextValue 24.

The above can be applied to your piston when it executes once a day to update the value.