Multiple MQTT entities in same card

Upfront warning… Home assistant newbie here and still learning everything. I have been getting Lovelace UI setup based on a code someone else shared however, I have ran into a question. I am working to create a custom button card template for our pool but what I want the card to do requires multiple MQTT entitites. I think I know how to use this with “variables” option (although not sure where those variables come from)

Basically I want to use sensor.pool_water_temp to display a temperature but I want to use sensor.pool_pump to set the card to a specific color (eventually I’d like to make it turn a different color if the heater is running but one step at a time)

I have the icon setup and it’s reading the water temp but I’m lost on where to go from here.

To be honest I’m lost in general with trying to understand the template group. I understand the icon template but I’m confused on how the multiple templates tie together. Does anyone have any good resources to learn more information on stuff?

I think I was able to figure this out by using a switch I had to turn on and off the pump and using the temp parameter for the title. Have to work to understand templates more so get the card layout right though.