i would say its the coolant temp sensor, others might say the crank sensor.
first thing to do is get it scanned for fault codes as that`ll give you a fair idea..
for what its worth, you might aswell replace the coolant temp sensor anyway if you say its eratic but i think that its the cause due to the symptoms of it starting once it cools down.