If the 30 minute 'threshold is IMPORTANT...
then I would suggest getting an RTC module (Real Time Clock) for the 'timing'.
The rest (and I guess even including the RTC portion) are all very beginning tutorial projects.. do a search..
Do each one separately, then work on combining.