Voice Controlling My NEST Thermostat
First, the example:
2 updates since this was written:
- Nest now has a public API
- You don’t need to root your phone to do any of this. I will be updating this guide soon to reflect the above —
NEST, for whatever reason, has yet to publicly release their API. At the moment, it seems like Nest Labs is focusing on giving early access to rich-people-things companies like Control4. There is also the NEST Google Glass app that you can control using your voice. In both cases, I did not feel like shelling out thousands of dollars to beta test something seemingly simple.
I am sure it will be soon that NEST releases the public APl, but at the time of writing, it isn’t so. Luckily, good folks like Scott Baker, have reverse engineered how NEST control works over the internet. I decided to use Scott’s unofficial NEST API and integrate it into the vastly popular automation app Tasker.
- Install the SL4A Framework apk.
You are going to need to install a Python Interpreter in order to be able to able to run the python scripts.
Copy the nest.py and settemp.py to your sdcard’s SL4A/scripts location.
Edit the settemp.py to include your NEST login account name and password. Disclaimer: My password is in plain text. In the future, I will probably salt it.
Import the following Profile and Scene into Tasker.
Test with Autovoice prompt. Command filters are:
“set thermostat to”
and “set thermostat”
Anything else will not work, but feel free to edit the Tasker profile to your liking.
What’s Happening Behind The Scenes?
In a nutshell, Autovoice is listening for the command “set thermostat to” and whatever comes after that is set as a variable (%temp) that is passed on to the python script that interfaces with NEST. Once the python script receives the value for the %temp variable, it then uses Scott’s nest.py to do the legwork of changing the temperature on your NEST.
*Moto X Always Listening- Please note that the Moto X has a low power chip that is always listening to the trigger word ‘OK Google’. I am currently using an Xposed module to integrate Autovoice with Google Now; This allows for custom commands to be picked up by Autovoice from Google Now and passed to Tasker.