Page 1 of 1

Prometheus > Grafana Using Non-Numeric Variables

PostPosted: Sun Dec 27, 2020 3:30 pm
by HFTobeason
@ jheddings - I've had some success implementing your plugin - thanks!

Screen Shot 2020-12-27 at 13.25.24.png
Screen Shot 2020-12-27 at 13.25.24.png (118.01 KiB) Viewed 2541 times

I've run into an issue that is stumping me - the plugin appears to convert all variables into numeric values. For example, I have a variable which tracks the MODE of various thermostats - HEAT|COOL|OFF. I'm at a loss as to how to get those variables across into Grafana.

Any advice most appreciated.

Thanks.

Re: Prometheus > Grafana Using Non-Numeric Variables

PostPosted: Tue Apr 06, 2021 10:07 pm
by jheddings
Sorry for the delayed response here!!

Due to the way that Prometheus stores data, it is not possible to save strings directly and report in Grafana. Unfortunately, the only option would be to create another variable and trigger on status changes, converting them to a numeric value for Grafana to display.

That being said, it's an interesting use case. I will look into creating a custom metric type that does this mapping for you, at least on the Indigo side. You'll still have to set up a Grafana display that interprets numbers as state information (e.g. 0 = off, -1 = cool, +1 = heat or something).

Would that approach work for you?

Re: Prometheus > Grafana Using Non-Numeric Variables

PostPosted: Wed Apr 07, 2021 5:04 pm
by HFTobeason
@jheddings Thank you for your response. No worries re tardiness!

In the interim, I found a Grafana plugin that solved my problem: https://grafana.com/grafana/plugins/nat ... ete-panel/. To be honest, it's been long enough since I got it working that I really don't even remember how I did it...but until it breaks, I'm good to go...