Actually, before doing anything with the code, can you tell me what version your hub is running? There was an HTTP GET regression recently and one of the recent updates fixes it. I can't say for sure that issue would have affected my app, but I think it very likely.
If you're between version .142 and .152, update to the latest version. I'd probably remove the thermostat device and have the app try and recreate it.