Just talking out loud…
There’s some weather apps that let you check outside temp (weather tile). If you put a temp/humidity sensor in your attic…
You’d have to set what “favorable conditions” are, but I don’t see why you couldn’t say “if 100 degrees outside AND 80 degrees in attic THEN turn on attic fan”?
Is that what you’re trying to accomplish? It wouldn’t require any coding outside of setting up the automation within the ST app.