Hello all!
I have a simple time series of air temperature that I would like to alert on three possible conditions:
- Any value from the last 1 hour is above a value.
- Any value from the last 1 hour is below a value.
- No data from the last hour.
I have written a very basic query that returns the time series data:
SELECT
airtemp1,
ts AS "time"
FROM
bsp_met_min
WHERE
$__timeFilter(ts)
ORDER BY
ts ASC
And then use two reduce for min/max:
And then I use a math expression to check the range. (Yes, they are checking against the same value, 30, as a test for me - in practice these would be actual values.)
Is this the correct way to proceed here? I would have thought threshold might be an answer but I can only use one refid in the threshold check.
I’d really appreciate any insight or pointers for a better way to proceed (this is with just one parameter, airtemp, but I do have multiple other parameters in the table that I’d like to check against other ranges as well - something like pressure and precipitation).
I think I have the nodata sorted out by using the nodata
alert state to Alerting
- is that correct?
TIA!