Hi,
I suggest you get just one thing working at a time. Like temperature measurement, Like relay control of a motor.
splitt og hersk
Get an example working software sketch for each thing separately, THEN start to combine them..
Tell us more details of your hardware.