Giter Club home page Giter Club logo

nerdnest's Introduction

nerdnest

Control your Nest device from the command line

Build Status Go Report Card Github All Releases

Setup

  1. Enable developer mode and allow access to your nest
  1. Register nerdnest with your developer account
  1. Choose the device you want to control
  1. Make sure your settings from step 2 and 3 are saved into your nerdnest.toml file. This file can be in:
  • $HOME/.nerdnest/nerdnest.toml
  • CURRENTDIRECTORY/nerdnest.toml
  • Submit a new issue for additional paths

Usage

Usage:
  nerdnest [command]

Available Commands:
  away        'home' or 'away'
  status      Current Status
  temp        Set target temp
  register    Register with nest
  list        List devices

Flags:
  -h, --help   help for nest

Use "nerdnest [command] --help" for more information about a command.

Current Status

./nerdnest status
Name: Nest
Current Temp: 69
Target Temp: 69
Humidity: 45
State: off
Device ID: KoTA9-raY9xdYrYY036u2rgaeP_lJ-mg
Structure ID: Suha_CVEVHdOreQFLWC-XlHaPXSRHcEwOb8dKkwYIjcVN0XCBSnKLQ

Set away status

No output is sent after the command runs

./nerdnest away home
./nerdnest away home

Set temperature

./nerdnest temp 70
./nerdnest status
Name: Nest
Current Temp: 69
Target Temp: 70
Humidity: 45
State: heating
Device ID: KoTA9-raY9xdYrYY036u2rgaeP_lJ-mg
Structure ID: Suha_CVEVHdOreQFLWC-XlHaPXSRHcEwOb8dKkwYIjcVN0XCBSnKLQ

./nerdnest temp 68
./nerdnest status
Name: Nest
Current Temp: 69
Target Temp: 68
Humidity: 45
State: off
Device ID: KoTA9-raY9xdYrYY036u2rgaeP_lJ-mg
Structure ID: Suha_CVEVHdOreQFLWC-XlHaPXSRHcEwOb8dKkwYIjcVN0XCBSnKLQ

Set default device

./nerdnest setdefault
Nest: raY9xdYrYY036u2rgaeP_lJ
Kitchen: ku34h5kjefhkdsjfhsdf
Enter default device ID from above list: ku34h5kjefhkdsjfhsdf 

./nerdnest status
Name: Kitchen
Current Temp: 69
Target Temp: 70
Humidity: 45
State: heating
Device ID: ku34h5kjefhkdsjfhsdf
Structure ID: Suha_CVEVHdOreQFLWC-XlHaPXSRHcEwOb8dKkwYIjcVN0XCBSnKLQ

./nerdnest status ku34h5kjefhkdsjfhsdf
Name: Nest
Current Temp: 69
Target Temp: 68
Humidity: 45
State: off
Device ID: KoTA9-raY9xdYrYY036u2rgaeP_lJ-mg
Structure ID: Suha_CVEVHdOreQFLWC-XlHaPXSRHcEwOb8dKkwYIjcVN0XCBSnKLQ

Multiple device support

All commands that interact with a Nest can either use the default device from your config file or you can specify a device ID e.g.

./nerdnest temp 70
./nerdnest temp 75 ku34h5kjefhkdsjfhsdf
./nerdnest status
./nerdnset status ku34h5kjefhkdsjfhsdf

To set the default device, even you only have one, run the setdefault command:

./nerdnest setdefault
Nest: raY9xdYrYY036u2rgaeP_lJ
Kitchen: ku34h5kjefhkdsjfhsdf
Enter default device ID from above list: ku34h5kjefhkdsjfhsdf

Configuration keys

accesstoken = "ACCESSTOKEN"

mythermostat = "MYDEVICEID"

units = "[f|F|c|C]"

logfile = "/PATH/TO/OPTIONAL/LOG/FILE"

logformat = "[csv|json]"

Choosing units for temperature

By default nerdnest uses Farenheit for temperature both to display the status and when setting temperature. You can override this behavior by adding a configuration key called units and setting it to either "c" or "C".

For Farenheit you must specify the temperature in whole numbers e.g. 70, 75 For Celcius you can specify half units as well e.g. 19, 20.5, 23.5

Saving a log

If you specify the logfile configuration option, whenever you run ./nerdnest status it will append the information it receives to that file in either csv or json format. You could use this with crontab to record statistics for your Nest over long periods (and even plot them on charts).

Use the logformat configuration option to specify if you want csv or json. The csv format contains fewer fields.

NOTE: If you use this library to create an application for other people, you should read the Nest Developer Terms of Service as there is a specific rule about how long you are allowed to retain the data.

nerdnest's People

Contributors

tturner avatar zpeters avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.