NestSDM
A plugin for PG3/PG3x that interfaces with the Google Nest SDM API to allow IoX to access and control Nest
thermostats, doorbells, and cameras. For support and feedback on the plugin, please use the UD Forums
here.
NOTE:THIS PLUGIN REQUIRES AT LEASTÂ IoX FIRMWARE v5.8.3 and its associated platform updates (PG3x,
UDx, Python 3.11, etc.). In some cases, users have had to go to IoX 5.8.4.
Instructions for use:
- Before getting started, make sure your Nest devices are setup under your account in Google Home.
- From the Polyglot V3 Dashboard, install the NestSDM Standard Edition plugin from the Plugins Store.
- Optionally, you can add/modify the following parameters under Configuration in the Dashboard for the
plugin:
Advanced Configuration:
- key: shortPoll, value: interval for periodic polling of state for thermostats and clearing of
detection events for cameras and doorbells (default 60 seconds)
- key: longPoll, value: interval for periodic testing of API connection and generation of heartbeat
(AWAKE) commands from structure node (default 600 seconds)
Custom Configuration Parameters:
- key: tempunit, value: "FAHRENHEIT" or "CELCIUS" - overrides temperature scale for reporting
temperatures from thermostats to IoX (optional - defaults to thermostat setting)
Be sure to restart the plugin after making any changes to the configuration parameters.
- Once the plugin has started (give a minute), click the "Authenticate" button in the Polyglot V3
Dashboard for the plugin to authorize access to your Google Nest devices by the plugin. You will be redirected
to the Google Authentication page to log in and authorize access to your devices to the UD Nest SDM Plugin
project. Be sure yo use the same user ID (email address) you used to setup your devices in your Google Home
account. After successful authentication, you will be redirected back to the plugin in PG3x.
- After authenticating, click the "Discover" button in the Polyglot V3 Dashboard for the plugin to
initially populate nodes in IoX for your Nest Structures, Thermostat, Doorbell, and Camera devices. If you
add additional Nest devices to your Google Home profile, or if you want to restore devices previously
deleted from IoX, you can come back to the PG3x Dashboard and perform discovery again in order to regenerate
the node list.
Notes for latest version (v1.0.7):
- When starting or restarting the plugin, it waits until the first shortpoll event after Authentication and
Discovery to poll the Google Nest service and initially update all the state values. This is implemented this
way to reduce the number of API calls and prevent hitting rate limits. However, this means that, after a
restart (or authentication and/or discovery), it may take up to 60 seconds before the device states are
reflected correctly. Also, if a state change event is received before the initial states are set, the state
values may go pear shaped, since the node doesn't have a current state vector. It should all settle in after
the first shortpoll event.
- If you are updating to v1.0.7 from v1.0.6, you need to delete your nodes and rediscover for the first
(primary) Structure node to start tracking the plugin status.
- There is currently around a 2 second delay after sending a command from IoX before the corresponding state
changes are received from the Google Nest service and updated in the Admin Console, so if you are
making adjustments in the AC, please be patient and allow a few seconds for the state to settle
down after each command before trying again or moving to another command.
- When using the "Fan On" command with or without a runtime, there is a delay of 5 to 6 seconds before the
state change is reflected and this progression often exhibits some weird, out-of-sequence state change
behavior. I believe this is some type of bug in the Google Nest service.
- This version is built to run against the UD Nest SDM Plugin project, but you may still use your personal
Device Access project in your Google Developer sandbox if you wish. To use your personal Device Access project
add/modify the following required Custom Configuration Parameters under Configuration:
- key: projectid, value: Project ID from Google Device Access Console (GUID string)
- key: gcpprojectid, value: GCP Project ID from Google Cloud→Overview→Dashboard (string)
- key: oauthclientid, value: Client ID for OAuth Client from Google Cloud→APIs &
services→Credentials (GUID string)
- key: oauthclientsecret, value: Client Secret for OAuth Client from Google Cloud→APIs &
services→Credentials (string)
- key: oauthendpoint, value: "https://nestservices.google.com/partnerconnections/<project id>/auth"
with "<project id>" replaced with the Device Access Project ID (NOT the GCP Project ID)(URL
string)
Once the Custom Configuration Parameters are set for an alternate Device Access project, the user must
re-authenticate with the Goolge oAuth service from the PG3 Dashboard before re-discovering devices using
the Discover button. If you wish to switch from your personal Device Access project back to the UD Nest SDM
Plugin project, the plugin must be uninstalled and reinstalled. Detailed instructions for setting up a
compatible Device Access projet in your Google Developer sandbox can be found
here.
Version history:
1.0.7 - Fixes (2024-08-20)
- fixed bug in processing state change events before initial state vector is established
- added manual timeout of detection events (person, motion, sound) for legacy devices
- added plugin status tracking to primary (first) structure node
1.0.6 - Production (2024-08-14)
- fix parsing "wrapped" event messages from UD's Google Device Access project
v0.2.5 - Ready for UD Device Access Project (2024-08-07)
- implement support for UD's Google Device Access project
- added node hierarchy with structure at the top
- added both state values and commands for motion/person/sound detection for all cameras
v0.1.4 - Multiple fixes (2024-04-26)
- implemented a thread-safe and load-order safe OAuth module
- added better node name generation from room and device type
- deletes the events subscrition on plugin stop
- fixed clearing "Fan Only" HCS when fan timer turns off
- changed each node individually updating its own state on create to single updateAll on next shortpoll
- fixed error from non-"updateable" events from legacy Nest devices
v0.1.3 - Beta Testing Version (2024-04-05)
- Added configuration parmaters for custom OAuth configuration for user Sandbox Device Access projects
- Implemented new udi_interface OAuth module
- improved error reporting and notifications, especially around OAuth configuration and authentication
0.0.2 - Testing Release (2024-03-19)
- changeover to UD's production Device Access project
- add fixes and new features
0.0.1 - Initial Release (2024-02-15)