How to replace a numeric value with a text


I’m using Grafana to view data from my Mitsubishi heat pump. Data is stored into InfluxDB.

One measured value is heat pumps operation mode. It is numeric value (3 = cooling, 5 = heating, 7 = fan only etc…).

I have added that query to my graph, and I have nice curve that shows the operation mode (yellow, called “Toimintatila” in the screenshot below). However, I’d like to have the operation mode shown as a text (heating, cooling etc.) in the window that opens when I click on the graph. Is this possible?

Also I have other query for “Power” (on/off in the screenshot below), which is stored into database with boolean values true or false. When I add this to my graph, there is a curve that shows it correctly, but when I click on the graph, I see only empty value. Why it doesn’t show that value correctly. You can see this in the screenshot below.

I’m a newbie with Grafana and tried to search for answer, but no luck. Thanks!

Here are the queries.