I am very much a coding n00b also (read, I just mangle other's code to my uses.....) I know just enough to be dangerous
I'll probably get shouted at for suggesting this but I have a solution I use for a problem a little similar to yours but it involves a paid app and a static android device.
I have 2 x ESP8266 connected to DHT22 sensors that upload temp and humidity data to thingspeak, I then use Tasker on an old Android phone to parse and display the data from thingspeak, once the temperature and humidity are written to variables in Tasker you can do pretty much whatever you wish with them, e.g. If temp A = z degrees then "turn fan on" if Temp B < temp A then "turn fan off"
It's not an elegantly coded solution but allows some degree of flexibility as opposed to hard coding, but, if like me, your coding level is somewhat lacking (nil) then it works.
Here's the code I used -
http://www.arduinesp.com/thingspeak - just change the sensor type in line 19 to DHT22
an example of what the sensors send to taker -
https://thingspeak.com/channels/38948I know this probably doesn't help very much but it's a solution that works for me
*edit, you can also use a "thing react" on thingspeak to trigger an action should a condition be met from from your DHT22