Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Nest Thermostat plug-in

Questions and comments specific to a particular plugin should go here.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Nest Thermostat plug-in

Post by krambriw »

Sorry, mistake, just delete the line with pass, not needed for the moment, it will actually make the script not working
abuttino
Experienced User
Posts: 144
Joined: Sun Jun 02, 2013 4:01 am

Re: Nest Thermostat plug-in

Post by abuttino »

I am getting a lot of these when I start EG

Exception in thread Thread-25:
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 161, in Polling
self.save_status(True)
File "C:\Program Files (x86)\EventGhost\plugins\Nest Thermostat\__init__.py", line 242, in save_status
shared = self.status["shared"][self.serial]
AttributeError: 'Nest' object has no attribute 'status'

I have to change the device ID to get it to log in..
abuttino
Experienced User
Posts: 144
Joined: Sun Jun 02, 2013 4:01 am

Re: Nest Thermostat plug-in

Post by abuttino »

Also..

Code: Select all

rel_hum = str(eg.plugins.Nest.get_object(38))
eg.plugins.AutoRemote.SendMessage(u'Razr-MAXX', u'http://goo.gl/***', u'*****', u'rel_hum', u'', u'', u'', u'')
Isn't working. I have NO idea why. It prints the value ok.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Nest Thermostat plug-in

Post by krambriw »

Well, I do not use this plugin myself and I do not have any nest device.

What is not working? Please provide more details...

But I think get_object(38) is for current temperature, not relative humidity. For that I would use eg.plugins.Nest.get_object(36)
abuttino
Experienced User
Posts: 144
Joined: Sun Jun 02, 2013 4:01 am

Re: Nest Thermostat plug-in

Post by abuttino »

ya, sorry. was a little frustrated last night.

Inserting the variable into the automessage. it just sends "currenttemp" or whatever the variables name is.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Nest Thermostat plug-in

Post by krambriw »

yes but I think I see the problem

You have written:

Code: Select all

eg.plugins.AutoRemote.SendMessage(u'Razr-MAXX', u'http://goo.gl/***', u'*****', u'rel_hum', u'', u'', u'', u'')
Try instead:

Code: Select all

eg.plugins.AutoRemote.SendMessage(u'Razr-MAXX', u'http://goo.gl/***', u'*****', rel_hum, u'', u'', u'', u'')
abuttino
Experienced User
Posts: 144
Joined: Sun Jun 02, 2013 4:01 am

Re: Nest Thermostat plug-in

Post by abuttino »

The programmer of the plug-in suggested this:

timetotarget = str(eg.plugins.Nest.get_object(151))
eg.plugins.EventGhost.Wait(1.0)
print timetotarget
timettp = u'timett=:='+timetotarget
eg.plugins.AutoRemote.SendMessage(u'Razr-MAXX', u'http://goo.gl/****', u'*********',timettp, u'', u'', u'', u'')

Which works PERFECTLY.. I see that you had the same idea :)

I really should learn another programming language other than DOS. If this had DOS Scripting I would be awesome at it, lol.. Dead language.

Anyway.. Do you know what could be wrong with the plug-in? or is it just not responding in time?

Thank you very much for all your help.. Getting closer to putting this system all together into some awesomeness.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Nest Thermostat plug-in

Post by krambriw »

The problem is indicated in this message:
File "C:\Program Files (x86)\EventGhost\plugins\Nest Thermostat\__init__.py", line 242, in save_status
shared = self.status["shared"][self.serial]
AttributeError: 'Nest' object has no attribute 'status'
I believe there is a variable (named status) that might be accessed before it is defined. Maybe easy to solve but I have not looked into it (is better if the author checks this out first).

Best, Walter
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Nest Thermostat plug-in

Post by krambriw »

The problem is, I believe, that the plugin fails to logon and to get status. That has to be solved first.

Best, Walter
abuttino
Experienced User
Posts: 144
Joined: Sun Jun 02, 2013 4:01 am

Re: Nest Thermostat plug-in

Post by abuttino »

What about a timeout? Could you increase that?

The funny thing is, it only happens on my laptop connected DIRECTLY to the router. (Core i7) it doesn't happen on my main EG "server" which is core i3 which is uses MoCA for internet/LAN.

I'd say that the error fixing itself after you change device IDs is probably indicative of something else..
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Nest Thermostat plug-in

Post by krambriw »

What about a timeout? Could you increase that?
This is just experimental but you can try to:

- Change the line below to delay the first login attempt

Code: Select all

		poll = Timer(2, self.Polling)
If you you change the number to 10 it will take 10 seconds until it tries first time
Dragon470
Experienced User
Posts: 205
Joined: Thu Feb 10, 2011 2:16 am

Re: Nest Thermostat plug-in

Post by Dragon470 »

You are correct that this is a login failure. I have now added some checks first, so you will no longer get the errors, but it will tell you that you have to restart the plugin. you can change the initial timer to a larger value. This will help ensure you have a usable network connection when the plugin starts. This can be a particular problem for wireless connections. After a stable connection is established, the plugin can be restarted and it should login fine. Since I see this could become a big problem, I have added triggers on errors. This means you can automate an enable and disable of the plugin.
abuttino
Experienced User
Posts: 144
Joined: Sun Jun 02, 2013 4:01 am

Re: Nest Thermostat plug-in

Post by abuttino »

Were you able to add the "setAway" on and off?
Dragon470
Experienced User
Posts: 205
Joined: Thu Feb 10, 2011 2:16 am

Re: Nest Thermostat plug-in

Post by Dragon470 »

Set away is now implemented.

I also added another trigger when the plugin logs in to the nest. This could be used to enable a folder structure with all the commands.
abuttino
Experienced User
Posts: 144
Joined: Sun Jun 02, 2013 4:01 am

Re: Nest Thermostat plug-in

Post by abuttino »

Do you have any idea what unit the time to target temperature is in?

it's too long of a reading for milliseconds

*edit... just found out it's in long Javascript format
new Date(1326039444 * 1000).toString()

How in the world would I create that in a python script to be usable?
Post Reply