CHECK OUT the NEST Home Plugin (Chameleon)

Posted on
Tue Apr 21, 2015 12:20 pm
RogueProeliator offline
User avatar
Posts: 2506
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: NEST Plugin Development - need Alpha Testers

BTW - We're going to have to come up with a name for the plugin - any ideas?

FWIW, I prefer to name plugins starting with the device/brand name so that users have an easy time finding it within the Plugins menu (and anywhere else). This is under the assumption that most users of your plugin are going to think primarily of the device first when needed -- e.g. "Nest lost communication, let's restart the Nest plugin", regardless of the actual name. So as long as it starts with Nest anything fancy/fun/playful/serious after that wouldn't affect users.

Adam

Posted on
Tue Apr 21, 2015 4:35 pm
Parp offline
Posts: 37
Joined: Dec 03, 2005

Re: NEST Plugin Development - need Alpha Testers

NestLink Chameleon Pro!

Posted on
Tue Apr 21, 2015 9:08 pm
philipbasile offline
Posts: 113
Joined: Jan 08, 2015
Location: NJ

Re: NEST Plugin Development - need Alpha Testers

Question...
I I created a profile for the nest dev program and now it looks like the next step is creating a client. Am I on the right track ? It's asking for a lot of specific information that's going to be hard to make up. Do you remember filling that out ?

Puilip

Posted on
Wed Apr 22, 2015 2:20 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: NEST Plugin Development - need Alpha Testers

I think I like NEST Home - it has a ring to it somehow. Adding Chameleon to the name would do wonders for my ego (I run a company called Corporate Chameleon hence the tag) but it assumes that I'll be doing other plugins... That's definitely not guaranteed yet - this one's been a steep learning curve - but the best way to learn :roll:

Posted on
Wed Apr 22, 2015 3:05 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: NEST Plugin Development - need Alpha Testers

Phillip

I remember well... You should have got on-line as a developer so you're right the next stage is to create a client. It's not as bad as it looks. Mainly you're setting permissions for the plugin to use. The advantage is that you're the only one who's ever going to see the results of this form so you don't have to worry too much. If you we're releasing to other people as a service (e.g. Phone App) then you'd have to be careful in how you described your useage. But as it's just you - so long as you trust yourself you can set whatever you need.

My responses:

Client Name - Something memorable - you'll only ever see it once when you accept the permissions and never again (except as a reference on the NEST site)
I called mine Test for Indigo - very boring I know :)
What it does - I just said it would link to the Indigo system to provide information from all NEST modules
Number of users - I selected 2-100 as I wanted at least 2 to allow for a test bed and and production version
Categories - Home Automation
Support URL - Currently it's sent to my corporatechameleon.co.uk website - but as I'm the only person using the client I could have entered google.co.uk. You do need something tho

For the options I selected:

Away - Read/Write - To allow NEST and Indigo to work together on locations
ETA - not selected at the moment
Postal Code- Read access - To allow NEST to return it's location for planning purposes
Smoke/CO Alarm - Read access - To allow Indigo to support Nest in emergency situations
Thermostat - Read/Write - To support NEST in providing triggers for adjusting personal temperatures and modes

Then Create Client. Remember that's it's only you that will ever see what this generates so don't worry too much.

Once you've created the client you'll get an authorisation URL that you can use to create your unique key! If you follow the instructions on the link I provided yesterday you should be OK - even through you'll have to use Terminal for the final bit. Only tip I can give you is keep a plain text editor open while your switching URLs and Keys back and forth and for editing some of the URLs you'll be playing with. If you copy information into there then you won't have to keep going back to find it on the Nest Pages :)

Hope that helps a bit

Let me know if you get stuck with the process - I'm writing a step by step guide later in the week to support the Alpha release.

Mike

Posted on
Wed Apr 22, 2015 6:06 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: NEST Plugin Development - need Alpha Testers

Chameleon wrote:
... Hope that helps a bit ...

Hi Mike,
That was very helpful - I am all set up now :)

Posted on
Wed Apr 22, 2015 8:17 am
Rocco offline
Posts: 35
Joined: Oct 11, 2013

Re: NEST Plugin Development - need Alpha Testers

Thanks everyone-

I'm looking forward to expanded functionality!

Posted on
Wed Apr 22, 2015 9:00 am
Cheezmo offline
Posts: 24
Joined: Dec 30, 2012

Re: NEST Plugin Development - need Alpha Testers

I would like to participate. I have two first gen nests, and am most interested in fan control.

Posted on
Wed Apr 22, 2015 12:52 pm
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: NEST Plugin Development - need Alpha Testers

Adam I agree so NEST Home it is... or something that starts with NEST anyway :)

BTW - the NEST API is pretty stable from what I can tell - soak test and no obvious errors so far. I'm sure you'll all find some tho :-)

What will be really useful for me is how to make the coding more efficient/better because that's my objective from this. When I first started in computers (no PCs in those days) I had to use the George 3 computer in Manchester - a mainframe. My programmes couldn't be larger than 256K and I had to swap code and data in and out of memory as the programme ran. Nowadays memory is cheap and leads to inefficient coding - or at least it does for me. So the deal is that I work on the plugin and you all help me find ways of coding it better. Can't wait!

Posted on
Wed Apr 22, 2015 1:19 pm
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: NEST Plugin Development - need Alpha Testers

I started with COBOL and Assembler on an IBM 360 :!:

If you want any help or suggestions on the plugin framework, I am happy to discuss/help. :)

I have found that isolating the actions from the processing using queues and threads can be quite helpful. In some of my plugins I run separate threads for: polling devices, handling commands to send to devices, handling response from devices and running timers.

Looking forward to trying this out :D

Posted on
Wed Apr 22, 2015 3:51 pm
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: NEST Plugin Development - need Alpha Testers

Jon

Now we're reaching the limits of my knowledge. I've just started looking at threads with queue management next so your support on that would be good. I can see that parallel threads with priorities would be a major step forward. Building the functionality first then making it run more efficiently would be a great learning opportunity so I'll probably take you up on it

Mike

Posted on
Sat Apr 25, 2015 7:35 pm
philipbasile offline
Posts: 113
Joined: Jan 08, 2015
Location: NJ

Re: NEST Plugin Development - need Alpha Testers

Chameleon,

Looks like the PIN code is only valid for a day and the access token is really what your after.

Why do they make it so difficult. They (nest) have all the info why don't they just create the link for you ?

I'm all token'd up and ready to test!

Philip

Posted on
Sun Apr 26, 2015 12:43 am
Chameleon158 offline
Posts: 11
Joined: Jan 28, 2015

Re: NEST Plugin Development - need Alpha Testers

My error... I misunderstood the question. The authorisation token is what the plugin uses and that lasts for 10 years I think :D

Posted on
Sun Apr 26, 2015 1:15 am
BassMint offline
Posts: 105
Joined: Dec 24, 2013

Re: NEST Plugin Development - need Alpha Testers

I'd be interested. I have multiple Nest Thermostats.
Should already have a Dev Account with Nest.

Posted on
Mon Apr 27, 2015 3:12 am
Chameleon158 offline
Posts: 11
Joined: Jan 28, 2015

UPDATE: NEST Home Development - Alpha

UPDATE - NEST Home ready for Alpha

I thought an update would be in order as we're nearly ready to start. First I've settled on the name NEST Home. It was a good suggestion, and as one of you noted, makes it easier for people to find once it goes fully live. It has a nice ring about it. Second, Indigo 6.1 is rock solid and the new access to HTTPS sites is working well :). While we're on the subject - Indigo Touch 2.0 rocks - when I get time I'll change my pages.

This weekend I decided to run the system fully live and encountered a couple of issues. The first was my biggest surprise and that was the the Google Nest Test environment differs to the Live environment significantly. Mainly there are additional fields in Live that simply don't appear in Test and that took me best part of a day to resolve. The second issue was getting key information from the PluginPrefs file. Until now I'd been able to test externally from indigo (because I find coding so much easier in a proper IDE where I can use the debug features (PyCharm)) and had hard-coded key information into the initiation process for authorisation keys, etc... It took me the best part of a day to understand a stupid thing I'd done with the self.pluginPref command but that's finally sorted and the plugin is now working inside indigo.

Oh and there were two last things. My system doesn't like self.sleep(time) as suggested in the SDK and completely ignored the command so my concurrent thread must have hit the server a few hundred times in just a few seconds before it returned HTTP 429 error (too many requests). Replacing it with time.sleep(time) worked better. Anyone know why the first option wouldn't work? and Second, I spent the best part of an hour wondering why a new API field I'd added wouldn't work until I remembered that color is how Google would spell colour :roll:

Anyway - after a frustrating weekend (I hate it when a programme works great in my IDE and then falls over when I take it to live) my python knowledge has increased exponentially and I finally have an Alpha system in Live testing for release later this week. All of you who have responded will get a mail from me with an access link to my dropbox account. You'll also get a PDF Read Me file that should help you get set up and running. Matt/Jay - I assume you'll want to be on the list.

A few things to be aware of:

Good
    The plugin can manage multiple NESTs successfully :shock:
    NESTs can be mixed in any ratio of Thermostats and Protects including single devices :shock:
    There seems to be limit of 32 NESTs of a single type in one system (NEST limitation) and I've had 10 Thermostats and 10 Protects operating in test without issue :shock:
    Refreshing data only takes one call to the API to save bandwidth
    Print & Save NEST Map options are provided as separate menu item and include the latest update from installed sensors
    The system refreshes its NEST map independently of other processes so that physical changes in the infrastructure are recognised immediately
    At Matt & Jay's suggestion the plugin contains both devices (Thermostat and Protect) rather than separating them out into two plugins so now they can communicate
    Non-device specific information (Country, Post Code/ZIP Code, Away Status and Time Zone) are all available to read
    Any field can be used as a trigger from a NEST
    NESTs can be grouped so that one NEST setting can be applied to all (e.g. temperature) :D
    Plugin automatically manages target temperature setting for heating or cooling only and heat/cool systems and apply the correct temperature scale even if your thermostats use different units (C or F)
    Code is now fully commented for ease of understanding (well for me anyway :D)
    Being released to Alpha later this week after soak test (I need to make sure that HTTP 429 errors don't start again - it looks like you can poll around 30 seconds)
    Plugin uses UK English spellings for error codes :wink:

Bad
    Test and Live environments differ - Test doesn't have last_connection (for thermostats or protects) or fan_timer_timeout(actually neither Test or Live have this field) :evil: However, you can configure the Plugin as a Test system and it overcomes this problem :)
    There's nothing in the API that allows direct Fan Control although fan_timer_active may work for this
    Although the Protect senses motion there isn't a field in the API that provides this information. However, all is not lost as the ui_color_status field at night changes to white (pathlight) when movement detected - so that's something :D
    Not sure if Generation 1 nests will have the same API and I don't have one to test - However, software_version is a field and this could be used to differentiate between them. This would be worth investigating once we're in Alpha testing and I suspect that the API is device independant
    Limited to target_temperatures, hvac_mode and fan_timer_active for write access (NEST limitation) :(
    Temperature scale is read only so you have to set the temperature scale on each device separately
    I haven't got the knowledge to code around HTTP 307 redirects so I've had to use cURL to write data - hopefully one of you gurus can help resolve that in Alpha (reading data - no problem).
    Haven't worked out a way of targeting humidity in the plugin as humidity is read only. However, I think it could be managed outside of the plugin with the plugin providing inputs
    Plugin uses UK English spellings for error codes :wink:

Hope that helps you understand where I am. Look forward to working with all of you.

Mike

Who is online

Users browsing this forum: No registered users and 10 guests