-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the chart to math minute by minute history, not just latest readings #62
Comments
@krook - a suggestion... Since every chart shows the 'live' values over time, how about we just make all the charts show 8 hours (or whatever is the longest configured window). Then when you look at a chart, you always get the same experience - "this chart shows me how X has behaved over the last 8 hours" - doesn't matter whether X is the live sensor readings, or the 4 hour average - they all change minute-to-minute. |
then the SQL is always the same : where timestamp_mins <= (UTC now - longest window in hours) |
Ah, I see what you mean. So this works great for a device that has readings in this time period of the last 8 hours. But won't show anything if the device hasn't reported in that timeframe. For this case, it might be helpful to fall back to last fixed number of readings. |
Ok, I added switching logic based on whether the device is active |
@albertum1 this is related to the issue we've been discussing. |
Hello Team, I tested with the Sensor Simulator and Rules Decision to see how the data would output during some edge case scenarios. I have set the sensor simulator to output a fixed number every 10 minutes(sometimes). Meaning, every 10 minutes, a random number is generated, and if the number is even, a fixed reading (i.e., CO level 100) is sent to the database. |
Hi @albertum1 Looking at the 10 min TWA from 12.20-12.29 Looking at the 10 min TWA from 12.30-12.32 and the 30 min TWA from 12.50-12.59 Looking at the 10 min TWA from 13.00-13.07 I hope that helps & makes sense! If you're satisfied these explanations are correct and they match what you're seeing, perhaps your data above would make a useful addition to the unit tests? (enable the regression tests to check for consistent behaviour across code changes. Also to cover similar questions by future maintainers). |
Right now the chart uses
LIMIT
to pull the last 10, 30, 60, 240, 480 readings. These may or may not correspond to consecutive minutes.The text was updated successfully, but these errors were encountered: