PHPackages                             gboudreau/nest-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. gboudreau/nest-api

ActiveLibrary[API Development](/categories/api)

gboudreau/nest-api
==================

This is a simple library that will allow you to monitor and control your Nest Learning Thermostat, and Nest Protect.

1.2.6(5y ago)30177790[22 issues](https://github.com/gboudreau/nest-api/issues)GPL-3.0-or-laterPHPPHP &gt;=5.0

Since Mar 27Pushed 10mo ago53 watchersCompare

[ Source](https://github.com/gboudreau/nest-api)[ Packagist](https://packagist.org/packages/gboudreau/nest-api)[ Docs](https://github.com/gboudreau/nest-api)[ RSS](/packages/gboudreau-nest-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (23)Used By (0)

Unofficial Nest Learning Thermostat API
=======================================

[](#unofficial-nest-learning-thermostat-api)

This is a PHP class that will allow you to monitor and control your [Nest Learning Thermostat](http://www.nest.com/), and Nest Protect.

**Note that since I started this, Nest have started an official [Developer program](https://developer.nest.com/). You might be better served using the official APIs, versus this PHP class here in which you need to store your credentials in plain text, and which use the non-supported APIs used by the mobile &amp; web apps.
i.e. if you're building a serious commercial application, go sign-up into Nest's Developer program. If you just want to build something for yourself, then you're probably fine with this PHP class here.**

Features
--------

[](#features)

- Caching so that it doesn't re-login when it doesn't need to. i.e. faster operations.
- Getters:
    - Current &amp; target temperatures, humidity
    - Time to target temperature
    - Target temperature mode, fan mode
    - AC, heat, and fan status: on or off
    - Manual and automatic away mode
    - Location information
    - Network information (local &amp; WAN IPs, MAC address, online status)
    - Currently active schedule (by day)
    - Next scheduled event
    - Last 10 days energy report
    - Device name, devices list
    - Battery level (voltage)
    - Nest Protect device information
- Setters:
    - Target temperatures (single, or range)
    - Target temperature mode: cool, heat, range
    - Fan mode: auto, on, minutes per hour
    - Fan: every day schedule (start &amp; stop time)
    - Fan: on with timer (stops after X minutes/hours)
    - Eco (Away) mode: on, off, min/max temperatures, Auto-Away
    - Dual fuel: breakpoint (use alt. fuel when outdoor temp is below X), always alt, always primary
    - Safety temperatures (low &amp; high temperatures)
    - Humidity (on, off, %)
    - Turn off HVAC

Usage
-----

[](#usage)

You can just download nest.class.php and require/include it, or use composer: `require "gboudreau/nest-api": "dev-master"`.

See examples.php for details, but here's a Quick Start.

```
