I would like to power a 120V attic fan every time my AC comes on. The low voltage wire connecting the thermostat with the compressor (to control the compressor) runs through the attic (as the compressor is on the roof) and I was thinking to put some sort of junction in the attic so the same wire that turns the compressor on also controls the attic fan. I can easily branch off a ceiling light box to install a box to power this, outlet or direct wiring.
My question is: which electrical device (switch?) can I use to input 24V and release or stop 120V outlet or direct wiring (on a separate circuit than the low voltage)? I imagine something like a power transformer that hangs on the outlet (input), and an input from the low voltage wire which controls another outlet (out) depending on whether it is charged or not.
I am asking this because the fan that I have is not smart and does not take thermostat input, only 120V on/off. So I am trying to control the release of the 120V every time the AC is on, as the control wire for it runs near.