Author Topic: Nest Thermostat Device Driver (IronPython)  (Read 7180 times)

jleonar

  • Newbie
  • *
  • Posts: 5
    • View Profile
Nest Thermostat Device Driver (IronPython)
« on: July 16, 2012, 05:06:47 pm »
It seems that a lot of people want an API for the Nest Thermostat.  One guy did a read only version in .Net but his code is pretty fragile from what I can see.  And I don't know a good way to improve his code in .Net as the libraries for scraping don't seem to be nearly as good as python ones.  I plan to implement a python library that does all the heavy lifting for interacting with the Nest website.  Once I have that done, I plan to use IronPython to integrate it into a Elve device driver.  It won't ever be able allowed to be an official driver due to it using python but I thought some people might be interested.

Either way, I am absolutely going to open source the python Nest code.  Just seeing if people would also be interested in the Elve driver when I get around to it. 

Other caveats, I don't plan to initially support more than 1 nest thermostat per account.  More than one would complicate matters and I want to keep it simple less than desirable to start off. 

Is there any interest?  I would also mention that I just began throwing it together this evening.  I have a python script that can login and read the thermostat temp.  I need to do some inspection of HTTP POSTS to determine how to set the temp but it shouldn't be very difficult.  Once I have that, I will need to expand to reading status and things like that. 

When all those basic features are done, I will start looking at an Elve driver.  From my reading, it looks pretty simple to integrate my python code with the device driver using IronPython.  It just needs that I will have to load some DLLs to make it happen. 

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2851
    • View Profile
    • Codecore Technologies
Re: Nest Thermostat Device Driver (IronPython)
« Reply #1 on: July 18, 2012, 03:07:37 pm »
That sounds interesting. You mention scripting... I assume the other driver is using web screen scraping?  If so, as you probably already know, if Nest changes the web page then the scraping could fail.

Does the Nest device not provide a web service?
John Hughes
Codecore Technologies

jleonar

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Nest Thermostat Device Driver (IronPython)
« Reply #2 on: July 19, 2012, 07:32:53 am »
That sounds interesting. You mention scripting... I assume the other driver is using web screen scraping?  If so, as you probably already know, if Nest changes the web page then the scraping could fail.

Does the Nest device not provide a web service?

Yep, I was going to use the python mechanize library which functions as a web browser so unless they radically change their page, I could be safe with most assumptions. The bad news is that Nest does not provide a public api or services for their thermostat.  However, there is even better news

Someone who has an iphone decided to integrate SiriProxy with the nest thermostat.  He did data capture between the Nest iPhone app and the Nest Website.  The guy found that they have a RESTful api.  It just isn't published.  This is the API the iphone app and the android app use.  It would likely be relatively stable because otherwise they would need to coordinate changing out apps simultaneously. 

Additionally, I found a person who implemented those RESTful calls in python.  With it being so simple, I am likely going to ditch python all together and implement completely in .NET so the driver will be native for Elve. 

Now, I just need to brush up on .NET and get to work because it should be really simple to implement.   

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2851
    • View Profile
    • Codecore Technologies
Re: Nest Thermostat Device Driver (IronPython)
« Reply #3 on: July 19, 2012, 03:18:56 pm »
Great! If you can use the RESTful web service that would be ideal... and is usually relatively simple compared to screen scraping.
John Hughes
Codecore Technologies

randy.andrade

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Re: Nest Thermostat Device Driver (IronPython)
« Reply #4 on: May 16, 2013, 04:20:12 am »
Hi there,

Just wondering if any of the described driver development ever took place. I picked up a Nest thermostat a couple months ago, and have so far been very happy with it, but I was curious whether there was any way to integrate it with the rest of my Elve setup. Lo and behold, I found this thread, so I'm just curious if anything ever came of it.

Thanks,

Randy

diginerve

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: Nest Thermostat Device Driver (IronPython)
« Reply #5 on: September 27, 2013, 05:17:45 am »
Offtopic - but Nest opened their API at CEDIA yesterday. control4 are first out the door with support.
-d

Jonathan B

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: Nest Thermostat Device Driver (IronPython)
« Reply #6 on: July 21, 2014, 08:10:30 pm »
I am working on a few Elve drivers of which one of them uses the new Nest API and incorporates real-time push updates from the Nest server for changes so any changes made directly to the thermostat or changes made by any other application (iPhone App, the Nest web site) etc. are updated immediately. Screenshot is attached.

For those technically inclined, I had to write a C# asynchronous implementation of the "Server Side Events" client but the nice part is that since it is asynchronous it doesn't consume any threads while waiting for updates to be pushed down. Sending commands just uses normal JSON HTTP requests to Nest server.

The one issue right now is authentication. Nest uses OAUTH v2 which means going to a special URL, getting a token string and pasting it into the driver. I'm hoping to find a way to make that less complex and error prone. Once you have the token in the driver it is good for 10 years though!

I will post the link to the Github source and compiled DLL once it is stable.

Proteus189

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Nest Thermostat Device Driver (IronPython)
« Reply #7 on: November 27, 2014, 02:43:41 pm »
Jonathan,

Did you ever get this finished and posted to Github?

GeorgeHarthups

  • Hero Member
  • *****
  • Posts: 2580
    • View Profile
6ukqdipv
« Reply #8 on: August 29, 2017, 10:36:49 am »
https://bitbucket.org/snippets/scottiedurrett1999f1/4LAz7x/
https://bitbucket.org/snippets/merrilljbt1981x1/pLq94r/
 
Download the latest version of Messenger and either open a group conversation, Download this app from Microsoft Store for Windows 10, Windows 10 Mobile.
https://bitbucket.org/snippets/harveybeamer1966r7/X8Lg8A/
https://bitbucket.org/snippets/isaiasehk1974n3/LLMbpq/
 
Visuels " pour écouter ou télécharger gratuitement des livres audio. Comme real player.
https://bitbucket.org/snippets/staceyeye1984m5/GGMBKe/
https://bitbucket.org/snippets/carterseibel1990d1/rLXbo5/
 
The newest and most social free internet card game! Hoyle Casino Games 2012. bidding systems, including Standard American, 2/1 Game Forcing, Kaplan-Sheinwold, ACOL, for card play and Borel simulations for bidding GIB also includes a free copy of the American Mac OS 10.8 and later.
http://ukfreehosts.co.uk/showthread.php?tid=55&pid=24423#pid24423
http://tosdiscord.com/viewtopic.php?f=10&t=44700&p=138595#p138595
http://upek.com.pl/showthread.php?p=3106524&posted=1#post3106524
http://13.redline.od.ua/viewtopic.php?f=5&t=644&p=4102#p4102
http://www.oprezentach24.pl/index.php?topic=531402.new#new
 
http://google.com/q=xsd7ykrv