GithubHelp home page GithubHelp logo

rjojjr / nest-controller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bwssytems/nest-controller

0.0 0.0 0.0 52 KB

Java library to utilize for calling the Nest cloud to control your Thermostats and Home status.

License: Apache License 2.0

Java 100.00%

nest-controller's Introduction

nest-controller

Java library to utilize for calling the Nest cloud to control your Thermostats and Home status.

Build

To customize and build it yourself, build a new jar with maven:

mvn install

Another way to include this project is thru the use of jitpack.io to include this as a Maven item:

	<repositories>
		<repository>
	    	<id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

	<dependencies>
		<dependency>
		    <groupId>com.github.bwssytems</groupId>
		    <artifactId>nest-controller</artifactId>
		    <version>1.0.14</version>
		</dependency>
	</dependencies>

Otherwise, downloads are available at https://github.com/bwssytems/nest-controller/releases.

Dependencies

When using this library you will need the following in your maven build or the equivalent jars included with your distribution:

		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.5.1</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpcore</artifactId>
			<version>4.4.4</version>
		</dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.5</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.5</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>log4j-over-slf4j</artifactId>
            <version>1.7.5</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.2.4</version>
        </dependency>

Also, you will need to provide a logging implementation and some choices below:

		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>1.1.5</version>
		</dependency>

OR

		<dependency>
    		<groupId>commons-logging</groupId>
    		<artifactId>commons-logging</artifactId>
    		<version>1.2</version>
		</dependency>

Usage

To start using the controller, the following items need to be done:


		NestSession theSession = null;

		try {
			theSession = new NestSession(username, password);
		} catch (LoginException e) {
			System.out.println("Caught Login Exception, exiting....");
			System.exit(1);
		}

		Nest theNest = new Nest(theSession);

		Set<String> homeNames = theNest.getHomeNames(); /* list of home structures  i.e. MyHouse */
		Home aHome = aHome = theNest.getHome(homeNameFromSet);

		aHome.setAway(Boolean.FALSE); /* either TRUE or FALSE "/

		Set<String> thermoNames = theNest.getThermostatNames(); /* list of thermostats in all structure */
		Thermostat thermo1 = thermo1 = theNest.getThermostat(thermoNameFromSet);

		Float targetTemp = new Float(25.2790765); /* always a float and in celsius */
		thermo1.setTargetTemperature(targetTemp);

		String targetType = "range"; /* heat, cool, range or off */
		thermo1.setTargetType(targetType);

		String fanmode = "auto"; /* on or auto */
		thermo1.setFanMode(fanmode);

nest-controller's People

Contributors

bwssytems avatar mikecroft 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.