Page 5 of 14
Re: Nest Thermostat plug-in
Posted: Sat Sep 14, 2013 3:04 pm
by Dragon470
if you wanted to, you could test the long term use of The original time_to_target and the TTT_Testing. To see if one stays more accurate than the other. The older one I see a problem that the timestamp could be updated and the time_to_target is not and is not 0. This would give the wrong output.
Re: Nest Thermostat plug-in
Posted: Sat Sep 14, 2013 3:17 pm
by abuttino
I'll test it now..
I edited on the previous page and didn't see it created a new page...
"When the thermostat says "IN 1 HR 5 MIN"
It's not that accurate. These times from the plugin are EXTREMELY accurate. I am talking, down to the minute.
I wish I knew a little more about Python, I would love to build a plugin for my Android Nest widget.. Instead of having someone do a search and replace on my scripts for the AutoRemote API, I could have them enter the API info in the plugin configuration."
Re: Nest Thermostat plug-in
Posted: Sat Sep 14, 2013 3:22 pm
by abuttino
My Script:
Time to Target Temp Temp to Phone
1379172012810
1379172012
970
00:16:10
New Object 196:
Python Script
1379172982 seconds
1379172982
With my script:
Time to Target Temp Temp to Phone
1379173500 seconds
1379173500
1379173
1377794327
382720:38:47
Thermostat TimeToTarget: 20MIN
Code: Select all
def humanize_time(secs):
mins, secs = divmod(secs, 60)
hours, mins = divmod(mins, 60)
return '%02d:%02d:%02d' % (hours, mins, secs)
nowm = str(eg.plugins.Nest.get_object(196))
#nowm = str(eg.plugins.Nest.plugin.Values_timestamp)
projected = int(eg.plugins.Nest.plugin.Values_time_to_target)
print nowm
now = int(nowm)
now = now/1000
print now
if projected == "0":
print "no data"
else:
ttt = projected-now
print ttt
print humanize_time(ttt)
ttt1 = humanize_time(ttt)
timettp = u'timett=:='+ttt1
Re: Nest Thermostat plug-in
Posted: Mon Sep 16, 2013 10:51 pm
by abuttino
I've found this error a couple times:
Exception in thread Thread-6:
Traceback (most recent call last):
File "threading.pyc", line 532, in __bootstrap_inner
File "threading.pyc", line 736, in run
File "C:\Program Files (x86)\EventGhost\plugins\Nest Thermostat\__init__.py", line 217, in Polling
self.save_status()
File "C:\Program Files (x86)\EventGhost\plugins\Nest Thermostat\__init__.py", line 333, in save_status
setattr(self, "Values_timestamp_TTT", Values_timestamp)
NameError: global name 'Values_timestamp' is not defined
One when it was a Leaf threshold and now this. Just figured I would let you know
Re: Nest Thermostat plug-in
Posted: Mon Sep 16, 2013 11:35 pm
by Dragon470
Are you using the beta version I posted, because I had added the variable in the startup, to prevent this. If not just add the line:
Values_timestamp = 0
in the __start__ (around line 190)
Re: Nest Thermostat plug-in
Posted: Wed Sep 18, 2013 11:00 pm
by abuttino
Code: Select all
def __start__(self, index, logging, loglocation, username, password):
self.serial = None
self.index = index
self.logging = logging
self.loglocation = loglocation
self.username = username
self.password = password
self.logtype = "new"
self.interval = 15
self.abort = False
self.Values_timestamp_TTT = 0
self.Values_timestamp = 0
poll = Timer(2, self.Polling)
poll.start()
This is the beta from line 180-193.
You that line where? (lol, that's what she said) It looks as if it already has one with the self. attribute
Re: Nest Thermostat plug-in
Posted: Thu Sep 19, 2013 8:24 pm
by abuttino
I guess nest changed something??
Error in Action: "Nest Thermostat: Set Heat/Cool Mode: 3"
Traceback (most recent call last) (1640):
File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
return self(*args)
File "C:\Program Files (x86)\EventGhost\plugins\Nest Thermostat\__init__.py", line 633, in __call__
res = urllib2.urlopen(req).read()
File "urllib2.pyc", line 126, in urlopen
File "urllib2.pyc", line 397, in open
File "urllib2.pyc", line 510, in http_response
File "urllib2.pyc", line 435, in error
File "urllib2.pyc", line 369, in _call_chain
File "urllib2.pyc", line 518, in http_error_default
HTTPError: HTTP Error 400: Bad Request
Re: Nest Thermostat plug-in
Posted: Thu Sep 19, 2013 9:01 pm
by Dragon470
I think they did do something, I will have to trace it using wireshark and the web gui. If I find the change immediately I will update, but this might take some time. I did hear that Tony Fadell, CEO of nest, will be a keynote speaker at CEDIA Expo later this month. Some think he will be unveiling a true API for the nest line. That would be amazing.
Re: Nest Thermostat plug-in
Posted: Fri Sep 20, 2013 2:40 pm
by abuttino
I contacted Tony for my Nest Widget
The errors in this plugin stop (or make it unstable) from updating/reporting after the first error..
Exception in thread Thread-5:
Traceback (most recent call last):
Nest.target_temperature '23.3'
File "threading.pyc", line 532, in __bootstrap_inner
File "threading.pyc", line 736, in run
File "C:\Program Files (x86)\EventGhost\plugins\Nest Thermostat\__init__.py", line 217, in Polling
self.save_status()
File "C:\Program Files (x86)\EventGhost\plugins\Nest Thermostat\__init__.py", line 333, in save_status
setattr(self, "Values_timestamp_TTT", Values_timestamp)
NameError: global name 'Values_timestamp' is not defined
Not exactly sure what to do here. I don't have a known backup of a working version (other than from when you added Away).
Re: Nest Thermostat plug-in
Posted: Fri Sep 20, 2013 3:51 pm
by Dragon470
I must have uploaded the wrong beta version last time, It is fine now. I still have no solution for the target_temperature_type. I checked over everything and nothing changed in this function or the others affected. Set fan is also affected.
Re: Nest Thermostat plug-in
Posted: Fri Sep 20, 2013 4:37 pm
by abuttino
Thanks!
Re: Nest Thermostat plug-in
Posted: Fri Sep 20, 2013 4:50 pm
by abuttino
Ya, you would expect that if they changed something, the app for Android and iPhone would have been updated. I watch those closely.
Re: Nest Thermostat plug-in
Posted: Fri Oct 11, 2013 6:33 pm
by abuttino
Did you ever figure out what the problem was? Did anyone else? Or did they all stop and wait for the real API?
Re: Nest Thermostat plug-in
Posted: Sat Oct 12, 2013 8:43 pm
by Dragon470
They did change some of their coding and probably will change some more before they release their api. I have fixed mine at least for now. What happened was they have much stricter input now on some of the items that can be set remotely. This is really a good thing, but this is something a real api would have let everyone know.
I have signed up with Nest developer site, so lets hope they do contact me.
Re: Nest Thermostat plug-in
Posted: Wed Oct 23, 2013 3:46 pm
by abuttino
I've also signed up.
Their PR guy was impressed with my Widget..
So, hopefully between us, we can get in the API.