Hello,
how can I display only the lowest measured value in grafana?
background, we have 2 outdoor sensors
the first one is processed by the sun in the morning until midday and the second one from the afternoon until the evening.
But now I only want to see the lowest value in the gauge display.
from(bucket: "openhabian")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "Balcony_Temperature" or r["_measurement"] == "Street_Temperature")
|> filter(fn: (r) => r["_field"] == "value")
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "mean")
Thank you
I would put both sensor readings in a group and use the aggregation feature to assign the lowest value to the group. You can then persist the group state and use that for visualisation.
Good morning,
thanks for your answer yes that’s how i would do it in mysql but with flux…
i asked the ai earlier and got this code.
balcony = from(bucket: "openhabian")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "Balcony_Temperature" and r["_field"] == "value")
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> rename(columns: {_value: "balcony"})
street = from(bucket: "openhabian")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "Street_Temperature" and r["_field"] == "value")
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> rename(columns: {_value: "street"})
join(
tables: {balcony: balcony, street: street},
on: ["_time"]
)
|> map(fn: (r) => ({
_time: r._time,
_value: if r.balcony < r.street then r.balcony else r.street,
_field: "min_temperature",
_measurement: "Combined_Min"
}))
|> yield(name: "min")
Yes, it works immediately.
I just have to see how I can do it like before with the numbers 0 10 20 30 as a scale.
AI recommended
‘Infinity Gauge Panel’
‘Gauge Panel Plus
‘Boom Table
did I have to do it this way before?
thx
I would do that in openHAB