Thermostat with a photon?

Im using a dht22 to get information on a room in my house, i’ve also got a heater hooked up to a relay controlled by a button assigned a virtual pin that is attached to D7 on my particle photon.

Is there any way to make it so when a temperature is reached the button is triggered?

Do you mean that you would like to see that your button have changed the state?
If yes, it will be available very soon

in the meantime, I believe you can do it in the particle code, as explained in the comment about phase 2 in this project:

best of luck!