Skip to content

Instantly share code, notes, and snippets.

@sanfx
Created November 3, 2019 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanfx/12a84987c89561b4808a52aa658a42f0 to your computer and use it in GitHub Desktop.
Save sanfx/12a84987c89561b4808a52aa658a42f0 to your computer and use it in GitHub Desktop.
SQL query used in Grafana to get temperature and humidity form MySQL server and computer dew point and heat index and display in panel.
SELECT
dt_created AS "time",
temp AS "Temperature",
humidity AS "Humidity",
(temp - ((100 - humidity)/5)) AS "Dew Point",
((temp* 1.8) + 32) AS temp_f,
(((-42.379 + 2.04901523*@temp_f + 10.14333127*humidity - .22475541*@temp_f*humidity - .00683783*@temp_f*@temp_f - .05481717*humidity*humidity + .00122874*@temp_f*@temp_f*humidity + .00085282*@temp_f*humidity*humidity - .00000199*@temp_f*@temp_f*humidity*humidity) - 32)*.5556)
AS "Feels Like"
FROM particle_photon
ORDER BY dt_created;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment