Windchill (Celsius), peer review

  • What Grafana version and what operating system are you using?
    Grana 9.2.4. Debian Bullseye
  • What are you trying to achieve?
    Create a wind chill plot
  • How are you trying to achieve it?
    See Below
  • What happened?
    It worked
  • What did you expect to happen?
    For it to work
  • Can you copy/paste the configuration(s) that you are having problems with?
    See Below, requesting a peer review to ensure I got the statements correct.
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No
  • Did you follow any online instructions? If so, what is the URL?
    Not Applicable

import “math”

//double w = 13.12 + 0.6215t + (0.3965t - 11.37) * Math.pow(v, 0.16)

p = 0.16

ot = from(bucket: “netatmo”)

|> range(start: v.timeRangeStart, stop: v.timeRangeStop)

|> filter(fn: (r) => r[“_measurement”] == “Temperature”)

|> filter(fn: (r) => r[“module”] == “outdoor”)

|> filter(fn: (r) => r[“station”] == “Maison (station)”)

|> truncateTimeColumn(unit: 1m)

|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)

|> keep(columns: [“_time”, “_value”])

ws = from(bucket: “netatmo”)

|> range(start: v.timeRangeStart, stop: v.timeRangeStop)

|> filter(fn: (r) => r[“_measurement”] == “WindStrength”)

|> filter(fn: (r) => r[“module”] == “wind”)

|> filter(fn: (r) => r[“station”] == “Maison (station)”)

|> truncateTimeColumn(unit: 1m)

|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)

|> keep(columns: [“_time”, “_value”])

wc = join(tables:{ot:ot, ws:ws}, on:[“_time”])

//|> map(fn:(r) => ({ time: r._time, _value: float(v: r._value_ws) * float(v: r._value_ot)}))

|> map(fn:(r) => ({ time: r._time, _value: (13.12 + (0.6215 * float(v: r._value_ot) + ((0.3965 * float(v: r._value_ot) - 11.37) * (math.pow(x: float(v: r._value_ws) , y:p)))))}))

//|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)

|> drop(columns: [“_result”])

//|> mean()

|> yield()