State config MySql


I have a MySql table that have a field door, in this field I indicate if it is open or closed.

Can I use singlestat to display the statue?

And what would be the query be?

If it is is open I want it red with the text “open” and if it is closed I want it to be green with text “closed”


Thanks for your help

@johans you can achieve an effect like that using value mappings:

as far as the query, have you already configured the mysql datasource plugin in Grafana?

Thank you