Need some help with Nest Integration

Hey guys, first post here! Long story short, I upgraded an old Harmony remote that died an unfortunate death with a new Harmony Home Control remote. Decided to go with SmartThings for a little home automation and have been very happy so far. I have a ZWave wall switch that control my living room lights with the Harmony remote and another that turns my porch lights on and off at dusk and dawn.

Now for my question. I paired my two Nests with ST based on the code I found on here. Everything seems to work perfect so far. What the Nest doesn’t do is automatically change between heat and cool when the temp fluctuates. It’s that time of year where we use heat at night and A/C during the day. Nest does have the Heat/Cool mode but I don’t like how it works, too big of a temp swing. My house typically stays at 73 throughout the night.

What I want to do is have ST automatically change the Nest to heat or cool based on either the current Nest temp or the outside temp, not sure what would be better. So for instance, say I have it set on 73, if it drops to 70 in cool mode, ST changes to heat. My Nest schedule would take care of the temp set points so I just need something to change the mode. Then the next morning once the temp rises to say 76, it should switch back to cool mode.

Another option is to change simply based on outside temp. If outside temp is below 65 change to heat, if above 65 change to cool. I’d have to play with those temps to fine tune, but you get the idea.

Anyone have an recommendations? Note that I’m not a programmer so I can’t write this complicated code…

Here’s the Nest code I’m using.

I think I might have figured it out! First, I installed the Weather Station device published by jnovack@gmail.com. That allowed me to have a virtual temp sensor device.

Then I found a smartapp (Temperature based Thermostat Mode by tslagle13) that does exactly what I was looking to do. I’ve set it up to go to heat below 60 degrees and cool above 65. We’ll see if it works tonight!