New NEST Plugin ready for general use

Plugins that users have built. NOTE: plugins that were developed for Indigo versions older than 2022.1 will have to be updated to work with Indigo 2022.1 (Python 3 - see this blog post for details). If the plugin listed here is not in the Plugin Store (which will show updated plugins) then you will need to ask on the appropriate thread below if it has been updated and where you get get the update.
svenseventy
Posts: 7
Joined: Mon Jul 07, 2014 9:24 pm

Re: New NEST Plugin ready for general use

Post by svenseventy »

I also get, essentially, the same series of "Invalid" messages, after which the plugin hangs and does not update again until restarted. It generally only stays up for ~24 hrs before succumbing again. Sometimes this is associated with very high CPU usage until the plugin is disabled.
svenseventy
Posts: 7
Joined: Mon Jul 07, 2014 9:24 pm

Re: New NEST Plugin ready for general use

Post by svenseventy »

Here's my debug log; YANTP was at 141% CPU persistently after this error.

Aug 14, 2014 2:16:46 PM
Yet Another Nest Thermostat Plugin "auto_away_learning":"ready","hvac_heat_x3_state":false,"compressor_lockout_enabled":false,"hvac_alttype":"cool","hvac_heaterheat":true,"compressor_lockout_gh":24,"hvac_aux_heater_state":false,"h"target_temperature":26.608,"hvac_fan_state":falate":false,"can_cool":true,"$version":"-65920402","$timestam

Yet Another Nest Thermostat Plugin Invalid message: "auto_away_learning":"ready","hvac_heat_x3_state":false,"compressor_lockout_enabled":false,"hvac_alttype":"cool","hvac_heaterheat":true,"compressor_lockout_gh":24,"hvac_aux_heater_state":false,"h"target_temperature":26.608,"hvac_fan_state":falate":false,"can_cool":true,"$version":"-65920402","$timestam

Yet Another Nest Thermostat Plugin events.js:72

Yet Another Nest Thermostat Plugin Invalid message: events.js:72

Yet Another Nest Thermostat Plugin throw er; // Unhandled 'error' event

Yet Another Nest Thermostat Plugin Invalid message: throw er; // Unhandled 'error' event

Yet Another Nest Thermostat Plugin ^

Yet Another Nest Thermostat Plugin Invalid message: ^

Yet Another Nest Thermostat Plugin Error: getaddrinfo ENOTFOUND

Yet Another Nest Thermostat Plugin Invalid message: Error: getaddrinfo ENOTFOUND

Yet Another Nest Thermostat Plugin at errnoException (dns.js:37:11)

Yet Another Nest Thermostat Plugin Invalid message: at errnoException (dns.js:37:11)

Yet Another Nest Thermostat Plugin at Object.onanswer [as oncomplete] (dns.js:124:16)

Yet Another Nest Thermostat Plugin Invalid message: at Object.onanswer [as oncomplete] (dns.js:124:16)
Autobot
Posts: 24
Joined: Wed Jul 30, 2014 4:55 pm

Re: New NEST Plugin ready for general use

Post by Autobot »

So, it seems that the "invalid" messages and the plugin hanging seem to be as a result of network issues.

For example, on a hunch I turned off WIFI on my Mac Mini and plugged in an ethernet cable direct from the router.
Since then, I have not had any further issues with the plugin hanging.
Probably something to do with the "health monitoring" script that maintains the connection to the Nest servers.

However, I'm still having no luck in changing the Setpoint from Indigo - when viewing the debug log, all seems to be OK with the "sending" of the message to change Setpoint but then nothing happens and the next refresh just sets the Setpoint back to what is on the thermostat/Nest server.

Now that the Nest API is public I'm REALLY hoping that Jay and Matt will look into making a built-in plugin for Nest!
Alphaman
Posts: 38
Joined: Sat Jun 07, 2014 11:10 pm

Alphaman

Post by Alphaman »

Autobot said:
For example, on a hunch I turned off WIFI on my Mac Mini and plugged in an ethernet cable direct from the router.
I would not be surprised; this sounds like a very plausible failure mode. My scenario is different, in that my Mini has always been plugged into an Ethernet network, however. The variable connectivity in my case comes from Nest; if you check the Nest forums, you'll find a lot of owners complaining about the frequency that the thermostat goes offline, and the inability of the thermostat to reconnect to the wireless network it was programmed to connect to in the first case — even though the network hasn't changed, nor has it gone anywhere.

You know, rocket science level programming: "If offline, try to reconnect; check to see if offline." :roll: :roll:
svenseventy
Posts: 7
Joined: Mon Jul 07, 2014 9:24 pm

Re: New NEST Plugin ready for general use

Post by svenseventy »

My Mac Mini is also connected to the network via Ethernet (with the above "invalid" messages occurring while so connected.)
Alphaman
Posts: 38
Joined: Sat Jun 07, 2014 11:10 pm

Re: New NEST Plugin ready for general use

Post by Alphaman »

Yeah, just re-read what I posted last. It was in no way meant to disparage this piece of software nor vtmikel's efforts. I love this plugin, and would not have upgraded to Indigo Pro if not for the ability to connect to my thermostat. My dig about "rocket science" was purely directed at Nest's engineers.
<unintentional egg on face> :oops:
Autobot
Posts: 24
Joined: Wed Jul 30, 2014 4:55 pm

Re: New NEST Plugin ready for general use

Post by Autobot »

Alphaman wrote:Yeah, just re-read what I posted last. It was in no way meant to disparage this piece of software nor vtmikel's efforts. I love this plugin, and would not have upgraded to Indigo Pro if not for the ability to connect to my thermostat. My dig about "rocket science" was purely directed at Nest's engineers.
<unintentional egg on face> :oops:
Absolutely agreed. Mike's done a great job with this plugin.
The issue does appear to be the way the thermostat has to connect to the Nest servers to be remotely controlled, as opposed to being able to directly interact with it via Wifi - therefore, if Nest servers flake out a bit, you're out of luck.
I'm no programmer but I wonder if a plugin made using their newly publicized API may work "better"?
Alphaman
Posts: 38
Joined: Sat Jun 07, 2014 11:10 pm

Re: New NEST Plugin ready for general use

Post by Alphaman »

Autobot said:
I wonder if a plugin made using their newly publicized API may work "better"?
Sadly, I don't think that will be the case. The API, as I understand, communicates with the Nest servers before going to your thermostat. A better solution for direct interaction with the thermostat itself would be to root/jailbreak the thermostat. There has been some effort in that vein of late, but nothing that I would bet my house on.

The API will help in many areas, I'm sure. But for a real solution, Nest needs to improve the ability of their programming to gracefully fail and retry establishing the network connection.
vtmikel
Posts: 717
Joined: Fri Aug 31, 2012 12:45 pm
Location: Boston, MA
Contact:

Re: New NEST Plugin ready for general use

Post by vtmikel »

Hi all,

Sorry that I've been out of the mix a bit on this forum. I did do a bit of back-reading to see what problems are going on for you all. A couple of comments-

-- I'm personally having decent performance with my own plugin (figures, since I wrote it!). I do however, have an error trigger that restarts it if there is a problem, and I often do not carefully check my own logs given my busy schedule. There's aways a chance I've experienced the same bugs as you all and not seen it.
-- The "invalid JSON" message that svenseventy observed: I did notice this behavior once before, I've added some debugging logic to my own version of the plugin but I have not been able to reproduce it. Unfortunately, the information that is being sent to the logging screen isn't enough for me to figure this out. The good news is, the error is being properly handled by my plugin, so it's not causing a crash or lockup of the plugin or your indigo. The bad news is, it's missing a update, so it's highly likely that the plugin is now out of sync with the state of your NEST. The one time I reproduced this, resetting the plugin fixed it, and I haven't been able to reproduce it since.
-- I looked into the official NEST API, and it seems that they are simply documenting what we have all reverse engineered in the first place. While I'm sure I could learn a bit from their documentation, I don't think it would substantially change the plugin. At least now we know that NEST is serious about maintaining a publicly available API and documenting the ReST services. Yes, all commands still go to the cloud then back to your local NEST.
-- The person who is having trouble in Austrailia, I'm sure that local NEST servers are the issue. Again, since I had to reverse engineer the API, I used the API URLs that my NEST uses, which is US based. I'd be happy to help if you want to PM me.
-- It seems you have likely found some bugs with my reconnection scheme if your local network comes off the internet. That doesn't surprise me. I have a commercial grade connection, so it hasn't been a problem for me. I'd recommend a error trigger, but I can try to improve my reconnection code. The hangs when this happens is because there is a timer that is waiting to try a reconnect. I'm terrible at Python 2.5 multi-threading, so I think I have a problem with Indigo waiting for me to respond when I'm scheduling a reconnection attempt. I'll try to get around to looking at this.
-- If the NEST goes offline but your Indigo server is online, the commands should be sent to the server and be queued to be sent to the NEST once it's back online, and not affect your plugin.

The best hope is that someone builds a native plugin for the NEST using the official API in Python. So far, no one has updated the Python code snippets available via open source to integrate with Nest (see here: https://github.com/smbaker/pynest), they are out of date and even if were upgraded would likely be incompatible with Indigo's Python (which is outdated). I'm afraid I don't have the Python 2.5 skills to do it myself. Mine is built in Node.JS and "linked" through Python to Indigo, the complexity likely causes some of the problems we are seeing.

I personally may move away from the NEST once I'm in a new home. This cloud stuff drives me crazy.

Best,
Mike
Autobot
Posts: 24
Joined: Wed Jul 30, 2014 4:55 pm

Re: New NEST Plugin ready for general use

Post by Autobot »

Hi Mike,

Thanks for the update.
-- I'm personally having decent performance with my own plugin (figures, since I wrote it!). I do however, have an error trigger that restarts it if there is a problem, and I often do not carefully check my own logs given my busy schedule. There's aways a chance I've experienced the same bugs as you all and not seen it.
Do you think you could possibly share the coding for this error trigger - that may help reload the plugin when things go wrong...

-- The person who is having trouble in Austrailia, I'm sure that local NEST servers are the issue. Again, since I had to reverse engineer the API, I used the API URLs that my NEST uses, which is US based. I'd be happy to help if you want to PM me.
I think the problem is that there are no local Nest servers down my way. My local php hack redirects requests for weather.nest.com only. It works well enough that I really can't be bothered to mess around with it any more than I have.

The best hope is that someone builds a native plugin for the NEST using the official API in Python.
Agreed!

I personally may move away from the NEST once I'm in a new home. This cloud stuff drives me crazy.
Double agreed!!

Thanks for your good work!
Autobot
Posts: 24
Joined: Wed Jul 30, 2014 4:55 pm

Re: New NEST Plugin ready for general use

Post by Autobot »

Not trying to spruik another product here, as I am a very happy Indigo user.
However, it's hard not to notice that the new Fibaro HC2 4.0xx Beta firmware appears to have built-in Nest support.
obyone
Posts: 5
Joined: Sat Jan 11, 2014 6:28 pm

Re: New NEST Plugin ready for general use

Post by obyone »

I wonder if anyone could help me. I cannot get the plugin to work and I believe it is because it cannot access the nest.com site. The following is an extract from the log file.

Yet Another Nest Thermostat Plugin About to request: http://127.0.0.1:/?deviceSerial=xxxxxxx ... tyName=all
Yet Another Nest Thermostat Plugin Error Trouble connecting to the NEST proxy, restarting it.
Yet Another Nest Thermostat Plugin Please complete the plugin configuration...
Yet Another Nest Thermostat Plugin About to request: http://127.0.0.1:/?deviceSerial=xxxxxxx ... tyName=all
Yet Another Nest Thermostat Plugin Error <class 'httplib.InvalidURL'>
Yet Another Nest Thermostat Plugin Error Traceback (most recent call last):
File "plugin.py", line 348, in requetURL

I'm running indigo and the plugin on a mac mini which is running Mavericks Server and is connected via an ethernet cable. I can get internet access fine on the machine. The plugin should be accessing the nest site but instead is using 127.0.0.1

Any pointers on what I'm doing wrong would be much appreciated.
User avatar
DaveL17
Posts: 7323
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: New NEST Plugin ready for general use

Post by DaveL17 »

This is a shot in the dark, but try this: In the YANTP plugin configuration menu, look for the Nest HTTP Proxy Port field and enter 13243.

It looks like yours in presently empty.
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
User avatar
DaveL17
Posts: 7323
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: New NEST Plugin ready for general use

Post by DaveL17 »

Hey Mike - should you be collecting future refinements for the code, I have one. I sent a request to turn up the heat and received this message:

Code: Select all

  Yet Another Nest Thermostat Plugin Error send "Thermostat - Downstairs" increase heat setpoint to 67.0 failed
Reloaded the plugin and got the same message. Turns out the heat was off.

I'd suggest catching such exceptions with a descriptive message.

Cheers,
Dave
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
obyone
Posts: 5
Joined: Sat Jan 11, 2014 6:28 pm

Re: New NEST Plugin ready for general use

Post by obyone »

Dave you are a star. It worked perfectly.

Thanks very much.

Now to install the remaining 10 Nest thermostats and get them set up :shock:
Post Reply

Return to “User Plugins”