GroveStreams
tokp private msg quote post Address this user
I have set up a weather station that displays my sensor data.

Now I want to create a graph that shows the cumulative degree days since April 1st but I have not figured out how to do it.

The degree day calculation is simply taking the average temperature for the day and subtracting 50.I can get it to calculate the daily degree days correctly, but cannot get it to add the previous results to make the graph cumulative.

What is the best way to do this?

Thanks
Post 1 IP   flag post
MikeMills private msg quote post Address this user
Your best bet is probably a derived stream. The hard part is starting the cumulative data on April 1st.

Here's how I think I'd do it:
1. Edit your component and add a new Interval Stream
2. Set the Base cycle to Days
3. On the Derivation Tab, set derive from "Expression"
4. Set the Derivation Effective date to a very early date
5. Add the Degree Day stream as an Expression Variable (you may have to select the Day cycle here and how to calculate that in the variable grid)
6. Set the Expression to "var1" (the Degree Day stream).
7. Goto The Constraints Tab and select "Is Counter Stream".
8. Select the Reset Cycle for the Counter. The counter stream will reset at the start of each cycle. Here's the tricky part: Create a new Cycle and have it start with April 1st. You can configure this cycle to repeat annually or whatever you want. Select that cycle as your Counter Reset Cycle.

Save the component. Wait at least 30 seconds for the stream to derive. Use the stream in a dashboard widget.
Post 2 IP   flag post
MikeMills private msg quote post Address this user
To force the Derived stream to fully recalculate - right click on it and select "Delete all time series data". Then wait for a minute or so.
Post 3 IP   flag post
tokp private msg quote post Address this user
Perfect, got it to work as long as I used the reset cycle set to none which is fine since I can reset every year.

"To force the Derived stream to fully recalculate - right click on it and select "Delete all time series data". Then wait for a minute or so." - I am glad you included that, I have been waiting a day to see data come in to check my derivations. Resetting speeds up my testing a lot!

Thanks for your help
Post 4 IP   flag post
2839 4 4
Log in or sign up to compose a reply.
destitute