Variable graph line color

Hi all I’m new to grafana.

I did my graph for the room temperature, everything is OK.

Now I want a feature that should be easy, but even if I have searched a lot, I haven’t find out nothing.

There are the column for the time and one one for the temperature (values to be plotted), I have also two columns (heat which is 0 for no heating and 1 for the heating on, same for the column cold (0 no refreshing, 1 it is on). I want the line to light grey when heat=0 and cold=0, red when heat=1, azure when cold=1.

I found only how to change the color for all the lines, how for only some lines based on the query?