Lookup status codes from SMA photovoltaic inverter

Hi! I’m doing my first steps with Grafana…

  • What Grafana version and what operating system are you using?
    Grafana 10.2.3 on Raspbian

  • What are you trying to achieve?
    I’m reading a status code from my inverter via InfluxDB as follows and I’m trying to visualize the current status in a stat panel:

  • 35 = error

  • 303 = off

  • 307 = OK

  • 455 = warning

I have two issues:

  • Data is only written to database if it changes. So if status remains on “okay”, Grafana will most of the time say “No data”. I expect Grafana to always reflect the the last value, no matter how old it is.
  • I’d like to do a lookup so that my panel doesn’t say “307” but “OK”. Perfect would be to color-code these lookups, so OK is green, warning is yellow etc.

Thanks - appreciating any support!

Welcome @luas to the Grafana forum.

Value mapping example: Transform Influx Result to true/false - #2 by grant2

“Last” value can be done in the query or in the Grafana panel settings

Thanks @grant2! Value mapping was easy.
Would you be so kind to be more specific on the “last value” thing? Are you talking about “Value options” in the right panel? I tried playing with these, but it doesn’t change anything.
image

Oh, and this is my query:

Anyway, I realized it makes sense to write those status codes to the database continuously, even if it doesn’t change. Otherwise Grafana would continue saying “OK” even if the inverter goes offline.
Therefore, I’m flagging this as solved. Thank you!

1 Like