I have weather data saved to InfluxDB. All values such as temperature, humidity, are saved as strings (I know this is not ideal but this is how I have the data currently).
The visualization of the values in the graph is correct, but the Max, Minimum, Current, fields in the Legend are not displayed.
I did some research and found that Max, Min, Current, do not support String values. Someone suggested to use CONVERT or CAST in the SQL query to adjust the type of the values.
I tried this approach but I think I am missing something in my SQL query.
This is my panel:
SELECT “value” FROM “mqtt_consumer” WHERE (“topic” = ‘weather_sensor/novo_hamburgo/rincao/casa/rua_parana/temp’) AND $timeFilter
The data it gets as result:
InfluxDB show measurements:
I found this discussion where it seems to be possible to convert the value in the query, but I had no success: https://stackoverflow.com/questions/54771946/grafana-sql-query-convert-string-to-number
So, in short, it would be really great if I could make Min, Max, Current work by doing the value conversion in the SQL query, but I am lacking the SQL knowledge to write this query. Any help would be greatly appreciated!