Grafana and String Values

I have a sensor that reports the current state of the hvac. It’s values are “off”, “cooling”, “heating”.

I would like to track the cooling states over time on a graph in grafana. Anyone know how I would structure my query for this?