jay (support) wrote:[MODERATOR NOTE] moved to the 3rd party Nest Plugin forum.
Thanks Jay - I'll try to help with my impressive zero knowledge of Applescript lol
Anyway - sorry for the delay in replying it's been a busy few days....
I'd check out this post where Jay explained the use of AppleScript and Thermostats - it seemed quite good to me and gave me a starting point to explore your issue
http://forums.indigodomo.com/viewtopic.php?t=7934&f=4I also answered a similar question for another user who was trying to do the same thing and he got it to work this way...
http://forums.indigodomo.com/viewtopic.php?f=170&t=14359#p98838Still rather than just giving you links I had a go with my limited knowledge of AppleScript I got this to work:
- Code: Select all
set currentHeatPoint to heat setpoint of device "Family Room"
set heatSet to value of variable "NESTTemp"
set heat setpoint of device "Family Room" to heatSet
set newHeatPoint to heat setpoint of device "Family Room"
if newHeatPoint * 1.0 = heatSet * 1.0 then
log "The Device Heat Point Is " & newHeatPoint & " The Variable Heat Point Is " & heatSet as text
else
log "The Device Heat Point Is " & newHeatPoint & " AND DOESN'T Equal The Variable Heat Point Which Is " & heatSet as text
end if
A few points:
1. I didn't use the integer part of the command because the NEST API uses float most of the time and I suspect that isn't helping
2. I used (variable*1.0) instead of just variable to make sure that we're comparing one float (x.x) with another
3. The NEST Home will update the Setpoint on the next refresh of the API using this approach. That means that a delay of 5 seconds may or may not be enough for the change to occur and so the result of the condition at the end may or may not be true depending on how long it takes for the refresh to happen. That's one of the issues using the NEST API because they don't like you calling the API more than once a min. In the actual plugin I force an update so the change appears to happen a lot quicker!
However, having added this as an embedded script in my test system I can confirm that the setpoint does change with this code - just not immediately... you need some patience
Hope that helps
Mike