Temperature Sensor Integration for AV Closet

I have a media closet that houses all my AV gear, and I’m looking to improve the cooling system. Currently, I have a fan plugged into a smart plug that turns on in the evening when we watch TV. However, I would love to automate this process by using a temperature sensor. The idea is that the fan will activate once a certain temperature threshold is reached, ensuring the AV equipment stays cool without manual intervention. I came across some options on Amazon, such as motion sensors and contact sensors that also read temperature, but I’m not sure which one would work best for my setup. I’m hoping to find a reliable solution that integrates seamlessly with my existing smart home ecosystem. Any advice or recommendations would be greatly appreciated! Thanks.