-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Change Mode Functionality #4
Comments
The mode is set at the structure context, not the device context. Use /v2/put/shared. for the url. The valid modes are cool, heat, range, and off.
|
Randy, Thank you so much for that hint. Not being a python programmer certainly All I wanted to do was to create a feature that the Nest folks left out. I In other words, switch between my heating and cooling schedules instead of smbaker and/or Randy, I have attached the nest.py.rhy (rhy is my initials) that contains my */20 * * * * /root/bin/nestAPI >> /var/log/nest.log # run this every 20 Thank you so much for all the contributor's help! It was fun adding Ron Regards, Ron Young +++++++++++++++++++ On Sun, Nov 25, 2012 at 6:24 PM, RandyLevensalor
|
Just submitted this pull request #10 based on this issue abemassry@89d3713 It's working just like @RandyLevensalor shows |
I am trying to periodically run with cron a script that will change my Nest from heat to cool and back based on logic using current set point and current temp.
I can read the current temp and change the set point with this code but cannot get the mode change working with the hacked code that I am trying. I have added this section to the code I downloaded:
I get this when I try to run it from the command line on my CentOS box that does have curl installed as a module and with yum:
./nest.py --user mylogin@wherever.com --password notmypassword setmode off
Traceback (most recent call last):
File "./nest.py", line 261, in ?
main()
File "./nest.py", line 245, in main
n.set_mode(args[1])
File "./nest.py", line 157, in set_mode
res = urllib2.urlopen(req).read()
File "/usr/lib64/python2.4/urllib2.py", line 130, in urlopen
return _opener.open(url, data)
File "/usr/lib64/python2.4/urllib2.py", line 364, in open
response = meth(req, response)
File "/usr/lib64/python2.4/urllib2.py", line 471, in http_response
response = self.parent.error(
File "/usr/lib64/python2.4/urllib2.py", line 402, in error
return self._call_chain(_args)
File "/usr/lib64/python2.4/urllib2.py", line 337, in _call_chain
result = func(_args)
File "/usr/lib64/python2.4/urllib2.py", line 480, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 400: Bad Request
Can you help me get this working from the command line please?
Ron
The text was updated successfully, but these errors were encountered: