Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New V2 Nest driver
#1
I've implemented a new Nest driver. It's completely new, based on the new and supported interface, and of course V2 compliant. This is part of the latest 4.8.1 drop, the installer comments will indicate it includes a new Nest driver, so you'll know you have the right one. Quite a bit of underlying functionality was added to support this driver, so it can't be released as just a driver pack.

http://www.charmedquark.com/Web2/Downloa..._4_8_1.exe

Things to keep in mind about this driver:
  • It gathers names and such from your configured info, so there's no configuration required.
  • It works through their cloud interface, so of course it depends on the network interface and won't work if your connection is down.
  • It supports thermos, cameras, and smoke/CO stuff, which is really all that is available.
  • Fan mode is not exposed via this interface, but we have to support it for V2 compliance. So there is a single fan mode, Auto, so that's what it always will show up as and that's the only value you could write to it. In terms of operating mode, it shows as on when the thermo's operating mode indicates it's running and off when the thermo mode is off.
  • It has different (single) points for heat and cool vs auto mode (heat/cool) which has two. That causes issues because the V2 scheme is that a pair of set points is available. So, if you are in heat/cool, it will show you the other set point from auto mode, and if you write to that other SP, it just remembers it and sets it when you switch back to auto mode. I can't see any way to really make it work smoothly within the V2 world.
  • You have to authorize the driver to access your stuff, which is described below.
  • This driver uses the 'streaming REST' interface. So it talks to the cloud server during setup to get the info about the devices. Then it sets up a persistent connection over which the server will send notifications, so it should react quickly to changes, as long as the server passes them on in a timely fashion, which most of the time it seems to. And it will involve mininmal traffic, only when something changes.
  • However, the server sends ALL information any time anything changes, which is stupid, but you have to subscribe to a scope in the data that contains all of the stuff you want, and we want to know about any changes, so that means every time even a single thing changes, it sends the info for all devices. Oh well...
  • Cameras have both sound and motion sensors. We treat them both as motion sensors, so that we can send out standard motion triggers to report them. The name can be used to differentiate them if you need to.

Authentication

You have to give our driver permission to access your system. For now our 'app' is in development mode, so the number of users is limited, but it's enough for our testing purposes. Later, once everyone agrees everything is right, we can get it approved. That will put it in the 'Works with Nest' store. But, all that really does is just invoke a URL for you when you select the 'app', which is this:

https://home.nest.com/login/oauth2?clien...StateStuff

When you run this, you will log in to your account and it'll show you a page where it says what the 'app' wants to do. We require access to most everything, so you'll see that being indicated. If you approve it, then you will be presented with a PIN code. We have to use that to generate your own authentication code that the driver will use to access your stuff. To do this you open the CQC Command Prompt and run this command:

CQCIdGen NestToken [PINcode]

So you provide the PIN code that you got from the page above. The program will spit out a long string. Mark that and store it somewhere safe. It will be good until you cancel it. When you install the driver, it will ask you for this code, so paste it in.

Camera Snapshot URL

Each camera has a snapshot field. It will contain a URL that will retrieve a snapshot image captured at the time of the last motion or sound event. However, you have to sign up for their "Nest Away with Video History" in order to have those available. Apparently they store the images on the server and they charge you for that service. If you don't have that, then the cameras will be marked as not supporting it and the URL will never be filled in.

In order to access these images, you have to provide the authentication token. The driver can't do that for you since the images will be getting pulled down by field based web image widgets (set to monitor the above snapshot URL field.) It could append the token as a query parameter on the URL, e.g. ?auth=xxxx, but that would mean that the token would be visible in the fields. So as to avoid that, I've updated the web image widget so that you can define one or two header lines that will be passed with the HTTP request to get the image. Enable one of them and set the key to Auth and the value to your authentication token. This way it's never exposed.

Rate Limiting

There is a limit on the amount of traffic to the server via this interface. In terms of getting the status of the devices it's not a problem, since we use the above mentioned streaming interface. So we don't poll at all, we get notifications of changes (and pings if nothing has happened.) But it would apply to outgoing commands, each of which is a separate one shot HTTP operation. They don't say what those limits are, but they imply it's pretty low. I can't really figure out what exactly they mean in practical terms. They indicate in the section below that you should "limit requests to one per minute maximum", which is obviously stupid and I can't believe they really mean that. Maybe they are referring to if you are polling, which we aren't.


This was a fairly complex driver, and all had available for development was their 'home simulator'. So of course I may not have seen all there is to see and there may be some quirks that we need to work out, so just let me know if you see anything that seems wrong.
Dean Roddey
Explorans limites defectum
Reply
#2
so far it's working great for me. i get all important info from my thermostat and protects.

one little thing i ran into - when you paste your token to the add driver wizard, you need to remove all whitespace.

i had to paste it into notepad and make sure the entire thing was across a single line or it throws an 'unauthorized' error when connecting. it's probably a limitation of the size of my command prompt window when i 'marked' it for copying, but im sure others will run into it.
do the needful ...
Hue | Sonos | Harmony | Elk M1G // Netatmo / Brultech
Reply
#3
I should probably just spit it out to a text file or something, or spit it out and put it on the clipboard at the same time.
Dean Roddey
Explorans limites defectum
Reply
#4
Anyone else tried this guy?
Dean Roddey
Explorans limites defectum
Reply
#5
I have a Nest arriving tomorrow, so will try it. Will hopefully get it installed over the weekend.
Reply
#6
OK, so I fired the Nest thermostat up and created a cloud account. Then loaded the new Nest driver. All is showing as connected, but no fields are appearing in the field browser, just the $[xxx] diagnostic fields:

$LoadTime
$LostCommRes
etc

My Nest cloud account is getting the correct info from the thermo, and can alter it. Just no usable fields in teh driver.

Any ideas?
Reply
#7
Flush the logs, put it into verbose mode, and do a reconfigure on it so that it tries to connect, then take it out of verbose mode and post a log dump. Let's see what it's saying. Have you named the various doodads at the Nest level? The driver uses the names you have given.
Dean Roddey
Explorans limites defectum
Reply
#8
When you say 'named', do you mean given a 'Label' in the 'Where' section of the thermostat config? If so, I hadn't, but I've now added a label, and still no fields.

There only the one Nest device right now, a single thermo.

I've captured the logs with verbosity set to high, and this seems not to show much either :

01/14 19:04:40-HTPC, CQCServer, CQCDrv_NestThread9
{
CQCKit, CQCDriver_DriverBase.cpp.3358, Status/App Status
Driver 'Nest' is beginning initialization
}
01/14 19:04:40-HTPC, CQCServer, CQCDrv_NestThread9
{
CQCKit, CQCDriver_DriverBase.cpp.3505, Status/App Status
Driver 'Nest' is trying to get its comm resource
}
01/14 19:04:40-HTPC, CQCServer, CQCDrv_NestThread9
{
CQCKit, CQCDriver_DriverBase.cpp.3544, Status/App Status
Driver 'Nest' has its comm resource
}
01/14 19:04:40-HTPC, CQCServer, CQCDrv_NestThread9
{
CQCKit, CQCDriver_DriverBase.cpp.3562, Status/App Status
Driver 'Nest' is trying to connect to its device
}
01/14 19:04:40-HTPC, CQCServer, CIDOrbSrvWorkThread_1
{
CQCServer, CQCServer_DriverCtrl.cpp.226, Status/App Status
Reconfigure of driver Nest is completed
}
01/14 19:04:49-HTPC, CQCServer, CQCDrv_NestThread9
{
CQCKit, CQCDriver_DriverBase.cpp.3604, Status/App Status
Driver 'Nest' has connected to its device
}
Reply
#9
Did you do the reconfigure after changing the names? The driver doesn't know you've done this, so you need to do a reconfigure to make it sync back up again. The above indicates nothing is going wrong, so I think it would just be that it didn't find anything it could use.

I don't know exactly where the name gets entered, so someone else will have to maybe speak to that. I think that the 'where' is the structure name, right?
Dean Roddey
Explorans limites defectum
Reply
#10
Yes, I performed a reconfigure. Just stepped through as the authentication key was still present, and got the confirmation dialogue that the reconfigure had been accepted.

Under 'where, you select a location description from a number of presets, and have the option to put a Label in here too. This is where I've set the label (just set to LivingRoom for now).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Marantz receiver driver (IP) dlmorgan999 6 97 05-15-2020, 03:32 PM
Last Post: dlmorgan999
  Pentair driver tom 3 191 04-26-2020, 11:03 AM
Last Post: tom
  Variables Driver Client gReatAutomation 4 147 04-25-2020, 12:46 PM
Last Post: gReatAutomation
  Reconfig of Driver Causes Built In Triggers to Fire gReatAutomation 2 138 03-25-2020, 04:09 PM
Last Post: gReatAutomation
  Lutron RadioRA2 Driver and Lutron Visor Control gReatAutomation 29 3,622 03-19-2020, 01:03 PM
Last Post: gReatAutomation
  Timers Driver / Field Time Image / Seconds gReatAutomation 1 156 03-16-2020, 05:48 PM
Last Post: Dean Roddey
  Problem with Accesssing Variables Driver Client Interface kblagron 5 323 03-05-2020, 02:24 PM
Last Post: kblagron
  ISYv2 Driver - FanLinc simplextech 4 468 02-04-2020, 06:55 PM
Last Post: simplextech
  SMS Driver / Sending MMS gReatAutomation 2 313 02-02-2020, 05:57 PM
Last Post: simplextech
  ISYv2 Driver - IOLinc Support simplextech 7 760 02-01-2020, 07:18 PM
Last Post: simplextech

Forum Jump:


Users browsing this thread: 1 Guest(s)