Visitors Temp Setup for Nest Thermostat
This one was a lot more of a pain to get working than I had thought it would be.
My situation is that I have two Nest thermostats. One is upstairs where my guest room is that I do not use very often. So I normally leave it much warmer up there. What I wanted was to have the temp setting to automatically change based on when my parents were in town visiting, which they do once a month or so.
My plan was to have a virtual switch that could be turned on manually if needed, but normally to be controlled by IFTTT that I put on my mother’s phone that would turn the switch on when she comes within 40 miles or so of my city, and off when she exits that geo fencing.
The piston would monitor the virtual switch and when it is changed adjust the upstairs thermostat settings.
I used to handle this with two routines that would set the heating and cooling temps based on the virutal switch, but I have been trying to move most of my automation to webCoRe as it is easier to work with.
The first issue I had was that when I am in Away Mode the Nest is set into Eco and you can not change the temp. I tried using the controling the presence and mode directly on the Nest, but with the NST Manager constantly watching the Location Mode this was not working to well. So I had to set up a condition to change the mode temporarily to Away-Nest On which the NST Manager is set to change the Nest to Home on.
Then I had to wait until the mode showed changed on the Nest, and that the temp setpoint on the Nest was not 0. It is set to 0 when in Away mode and in Eco.
Next I found that even though there is a listing for setCoolingPoint, and setHeatingPoint, there is not such method in the NST device handler anymore. I tried changing it with levelUpDown and passing in the degree change, but it would only change it one degree at a time.
So I finally had to check for the mode to be cool or heat and then run the levelUp or levelDown in a loop based on the degree change, plus I made sure to add a wait for the temp change to register to make sure the commands were not lost.
Finally if I started in Away mode I wanted to set it back to Away when finished.
After a while of testing I now have the piston working perfectly on the virtual switch change. It does take a little time to run completly, but that was not an issue for me as it is automated anyways.
Now I just have to hope the IFTTT works to trigger the virtual switch properly.
Maybe this can help somebody else how is working on trying to control a Nest thermostat. It was not as straight forward as I had thought it would be. For one there are methods exposed that are not in the device handler, so I was spending time reading the device handler code to figure out how it worked. Also there are no explinations of what each setting or method is or does. I will also attach a few settings I had looked up.
Settings in Home Mode on Nest
79 - Cooling Set Point
idle - thermostat operation state
79 - setpoint
77 - temperature
cool - thermostatMode
ONLINE - $status
72.0 - lockedTempMax
68.0 - lockedTempMin
false - tempLockOn
present - presence
Settings in Away Mode on Nest and in Eco
79 - Cooling Set Point
idle - thermostat operation state
0 - setpoint
77 - temperature
auto - thermostat mode
ONLINE - $status
72.0 - lockedTempMax
68.0 - lockedTempMin
false - tempLockOn
not present - presence