Nest Schedule Controller - saved to Google Spreadsheet
- Clone this repository and install dependencies
git clone https://github.com/webcerebrium/nest2spreadsheet
cd nest2spreadsheet
npm install
- Copy
.env.example
into.env
and put your actual Nest credentials, IFTTT webhook key and credentials to access Google Spreadsheet.
NEST_EMAIL=
NEST_PASSWORD=
IFTTT_WEBHOOK_KEY=
GOOGLE_SPREADSHEET_KEY=
GOOGLE_SERVICE_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----
GOOGLE_SERVICE_CLIENT_EMAIL=spreadsheets@spreadsheet-editor-XXXXXX.iam.gserviceaccount.com
GOOGLE_SPREADSHEET_KEY
is the ID of the spreadsheet in the URL, which you can see while opening it in browser:
https://docs.google.com/spreadsheets/`GOOGLE_SPREADSHEET_KEY`/edit
Providing google spreadsheet and service credentials is optional, without them it will just display data (with warnings)
Setup Instructions
- Go to the Google Developers Console
- Select your project or create a new one (and then select it)
- Enable the Drive API for your project
- In the sidebar on the left, expand APIs & auth > APIs
- Search for "drive"
- Click on "Drive API"
- click the blue "Enable API" button
- Create a service account for your project
- In the sidebar on the left, expand APIs & auth > Credentials
- Click blue "Add credentials" button
- Select the "Service account" option
- Select "Furnish a new private key" checkbox
- Select the "JSON" key type option
- Click blue "Create" button
- your JSON key file is generated and downloaded to your machine (it is the only copy!)
- Update
GOOGLE_SERVICE_PRIVATE_KEY
, andGOOGLE_SERVICE_CLIENT_EMAIL
from that JSON file in your environment config.env
- Share the spreadsheet with your service account using the email
GOOGLE_SERVICE_CLIENT_EMAIL
noted above. Otherwise you will receive - Your spreadsheet MUST have 1 row set up, containing EXACTLY these column names:
time
,current_temp
,target_temp
,humidity
. - Extra rows should be manually deleted
One-time call: npm run start
Watch mode (refreshes every 30 seconds) npm run watch
Clone repositort and set up variables. Then start docker service
docker-compose up -d
To Stop the service:
docker-compose down