This is a custom component for Home Assistant to integrate a wide range of Nest devices using an unofficial web API (combining REST streaming and Protobuf). It serves as an alternative to the official Nest integration, providing support for devices not available through Google's official Smart Device Management (SDM) API, such as the Nest Protect, Nest x Yale Lock, and Nest Heat Link.
This integration provides real-time updates for most sensors and controls by maintaining persistent connections to the Nest API.
The official Home Assistant Nest integration uses Google's Smart Device Management (SDM) API, which has a limited set of supported devices and requires a one-time $5 fee. This Nest Legacy integration uses the same unofficial APIs that the Nest mobile and web apps use, offering several key advantages.
| Feature | Nest Legacy (This Integration) | Official Nest Integration (SDM API) |
|---|---|---|
| API Used | Unofficial Nest Web API (REST & Protobuf) | Official Google SDM API |
| Cost | Free | $5 USD one-time fee required by Google |
| Authentication | Access Token (Nest Account) or Cookies (Google Account) | OAuth2 with Google Cloud Project |
| Supported Devices | Wider range, including Nest Protect, Nest Temp Sensors, Nest x Yale Locks, and Nest Heat Link. | Limited to newer Thermostats, Cameras, and Doorbells. |
| Data Updates | Push-based (Subscriber/Observer) | Push-based (Pub/Sub) |
| Stability | Relies on an unofficial API that could change or break without notice. | Officially supported by Google, more stable long-term. |
In short, use this integration if you want to:
- Integrate Nest Protects, Temperature Sensors, Locks, or Heat Links.
- Avoid the $5 Google API fee.
- Access features not exposed by the official API (e.g., Protect component health tests, Heat Link boost, controlling Thermostat via specific Temp Sensors).
This integration supports a wide variety of Nest devices:
- Nest Thermostats (1st, 2nd, 3rd gen, Thermostat E, 2020 mirror edition)
- Nest Protect (1st and 2nd gen, both wired and battery)
- Nest Temperature Sensors (Kryptonite)
- Nest Cameras (Cam Indoor, IQ Indoor, Outdoor, IQ Outdoor)
- Nest Doorbells (Wired 1st gen)
- Nest x Yale Locks
- Nest Heat Link (for UK/EU hot water control)
This integration creates a rich set of entities for your Nest devices based on their capabilities.
- Climate: Full control over temperature, HVAC modes (Heat, Cool, Heat/Cool, Off), and Presets (None, Eco). Supports Target Humidity if a humidifier/dehumidifier is present.
- Fan: Independent control of the fan (On/Off, Speed/Percentage). You can also run the fan for a specific duration using the
nest_legacy.set_fan_timeraction. - Sensors: Current Temperature, Target Temperature, Humidity, Target Humidity, Backplate Temperature, Filter Runtime, HVAC Stage (which heating or cooling stage is running).
- Binary Sensors: Occupancy, Leaf status (Eco indicator), Filter Replacement Needed.
- Switches: Temperature Lock, Dehumidifier State.
- Number: Dual Fuel Breakpoint, the outdoor temperature below which the alternate heat source is used instead of the heat pump. Only on dual fuel systems.
- Select: Dual Fuel Breakpoint Override (None, Always alternate heat, Never alternate heat). Only on dual fuel systems.
- Sensors: Current Temperature, Battery Level.
- Switch: Control Thermostat (Active Sensor). Turning this switch on forces the associated thermostat to use this sensor's reading for climate control.
- Binary Sensors: Smoke Status, CO Status, Heat Status.
- Diagnostic Binary Sensors: Battery Health, Line Power (wired only), Occupancy (wired only), Removed from Base status.
- Component Tests: Sensors indicating pass/fail for Speaker, Smoke, CO, WiFi, LED, PIR, Buzzer, and Humidity sensors.
- Sensors: Battery Level (%), Replace By Date, Last Manual Test time, Last Audio Self-Test time.
- Switches: Nightly Promise (Green LED), Heads-Up Alerts, Steam Check, Night Light enable.
- Select: Night Light Brightness (Low, Medium, High).
- Camera: Live streaming entity.
- Switches: Streaming Enabled, Audio Recording, Indoor Chime (Doorbell), Visitor Announcements (Doorbell), Night Vision (IR), Status LED, Video Rotation.
- Events:
evententities that trigger on Motion, Person, Sound, Face Detection, and Doorbell Chime. - Media Browser: Browse, play, and see thumbnails for historical camera events directly in the Home Assistant Media Browser.
- Lock: Lock and unlock control.
- Sensors: Battery Level, Last Actor (who locked/unlocked: Keypad, Manual, Remote, Voice, etc.).
- Binary Sensor: Tamper detection.
- Switch: Auto-Relock enable/disable.
- Number: Configure the Auto-Relock duration (seconds).
-
Water Heater: Control hot water heating.
-
Operation Modes: Supports
off,schedule, and several boost durations (boost,boost_30m,boost_1h,boost_2h). -
Boost Mode: Activates hot water for a specified duration (default 30 minutes for
boost). The reported operation mode will dynamically update to reflect the remaining boost time (e.g., switching fromBoost (2h)toBoost (1h)as time passes). Once the boost timer expires, the device automatically reverts to the previous mode (e.g.,schedule). -
Features: Set target temperature (only when the Heat Link has a hot water sensor).
-
Switch: Home/Away Assist, the Nest setting that lets Home/Away Assist switch hot water off while you are away.
-
Attributes:
boiler_active,hot_water_schedule_active,away_active(whether Home/Away Assist is suppressing hot water right now),next_transition_time(when the schedule next changes), andboost_timer_endwhile a boost runs. -
Automation: You can trigger a boost via automation using the
water_heater.set_operation_modeaction:automation: triggers: - trigger: time at: "07:15:00" actions: - action: water_heater.set_operation_mode target: entity_id: water_heater.nest_heat_link data: operation_mode: boost_1h # Boost for 1 hour
- Select: Set the structure mode (Home, Away, Sleep, Vacation).
This integration provides several custom actions for advanced functionality.
Lists all guests configured on your Nest structures. This action returns a list of guests, which can be viewed in the Home Assistant trace or used in scripts with response data.
- Data:
config_entry_id(Optional): The config entry of the Nest Legacy integration. Required if you have multiple Nest Legacy entries.
Gets the access schedule for a specific user on a lock. This action returns the schedule details.
- Data:
device_id(Required): The lock device to target.user_id(Required): The user or guest resource ID (e.g.,GUEST_1234).
Sets the access schedule for a user on a lock.
- Data:
device_id(Required): The lock device to target.user_id(Required): The user or guest resource ID (e.g.,GUEST_1234).days_of_week(Optional): The days of the week when access is allowed (e.g.,monday,tuesday).start_time(Optional): The time of day when access starts (e.g.,14:00:00).duration(Optional): The length of the daily access window (e.g.,04:00:00).start_timebox(Optional): The date and time when access begins.end_timebox(Optional): The date and time when access expires.
Deletes the access schedule for a user on a device.
- Data:
device_id(Required): The lock device to target.user_id(Required): The user or guest resource ID (e.g.,GUEST_1234).
Sets the thermostat fan to run for a specific duration.
- Target: The
climateentity of your Nest Thermostat. - Data:
duration(Required): The length of time the fan should run (e.g.,00:15:00for 15 minutes).
This integration is included in the default HACS repository.
- Open HACS in Home Assistant.
- Search for "Nest Legacy" in the Integrations section and click download.
- Restart Home Assistant.
- Go to Settings > Devices & Services > Add Integration > Search for "Nest Legacy".
After installation, the integration can be configured via the Home Assistant UI.
You will be asked to select your account type. Follow the instructions below based on your account.
For accounts migrated to Google, or created after August 2019. You will need to copy an issue_token and cookies from your browser.
Sign in fresh, copy the values, then close the window without signing out. A Firefox private window is the easiest way to do this: closing it throws away the browser's copy of the session without signing you out of Google. A browser window that stays signed in keeps using the same session, and signing out of home.nest.com or Google invalidates the credentials immediately.
Once set up, the integration saves the cookies Google rotates while it runs, so the credentials survive Home Assistant restarts.
The Nest Token Extractor browser extension captures the credentials for you.
- Install the extension in Firefox. Use v1.0.7 or newer; older versions could pick up the cookies of your regular Firefox windows while extracting from a private window.
- Open a private window (Ctrl+Shift+P, or Cmd+Shift+P on macOS). If the extension icon is missing there, go to
about:addons, open Nest Token Extractor and set Run in Private Windows to Allow. - In the private window, click the extension icon, choose your environment, and click Open Nest & Start Extraction.
- Sign in with Google and wait for the green checkmark on the extension icon.
- Click the extension icon again and copy the Issue Token and Cookies into Home Assistant.
- Close the private window. Do not sign out.
If the Cookies field stays empty, click the Shield icon in the address bar on home.nest.com, turn off Enhanced Tracking Protection, and restart the extraction.
(Instructions adapted from the homebridge-nest project).
- Open a Firefox private window (Ctrl+Shift+P, or Cmd+Shift+P on macOS).
- Open Developer Tools (F12) and select the Network tab. In its settings (gear icon), check Persist Logs.
- Go to
home.nest.com. Click the Shield icon in the address bar and turn off Enhanced Tracking Protection for the site. Private windows use strict tracking protection, which can block the Google sign-in frame and leave you in a sign-in loop. - Click Sign in with Google and sign in.
- In the Network filter box, enter
issueToken. One request,iframerpc, will appear. - Right-click it and choose Copy Value > Copy URL. This is your
Issue token. - Click the request and, in the Headers panel under Request Headers, right-click the
Cookieheader and choose Copy Value. This is yourCookies. Don't select the text by hand, since that can cut it short. It must includeSID=. - Paste both values into the Home Assistant configuration form.
- Close the private window. Do not sign out.
In Safari, enable Settings > Advanced > Show features for web developers, open a private window and use Develop > Show Web Inspector with Preserve Log checked. The iframerpc request shows the URL under Summary and the Cookie header under Request. Quit Safari when you are done, without signing out.
For older, non-migrated Nest accounts. You will need to obtain an access_token. The Nest Token Extractor can also get it for you, in any browser.
- Go to
https://home.nest.comin your browser and log in. - Once logged in, open a new tab and go to
https://home.nest.com/session. - You will see a long string of text. Find
"access_token": "..."near the beginning. - Copy the value inside the quotes (it's a long sequence of letters, numbers and punctuation beginning with
b). This is yourAccess token. - Paste this value into the Home Assistant configuration form.
- Do not log out of
home.nest.com, as this will invalidate your credentials. Just close the browser tab.
If you are part of the Google Field Test program, check the "Use Field Test environment" box during setup.
Once set up, you can click "Configure" on the integration entry to tweak settings:
- Camera Event Poll Interval: How often to check for new camera events (default: 5 seconds). Set it to 0 to disable polling.
- Protobuf Options: Enable/Disable the use of the newer Protobuf API for specific device types (Protects, Structure, Cameras). Thermostats, Temperature Sensors, Heat Links and Locks always use the Protobuf API.
- Authentication Errors: If you receive authentication errors, your cookies or tokens may have expired. You will need to re-fetch them using the steps above and use the "Reconfigure" option in the integration.
- Credentials stop working after a few hours: They were most likely copied from Chrome or Edge, or from a browser window that stayed signed in. Get them again in a Firefox private window, following the steps above, and close the window right after.
- "No active session found" / Invalid authentication on setup: If your debug logs show
BadCredentialsException('No active session found.'), the cookies you provided did not contain a valid Google sign-in session. Usually the cookie value was cut short while copying (use Copy Value), was copied from a different request thaniframerpc, or Enhanced Tracking Protection blocked the Google sign-in frame. Turn off Enhanced Tracking Protection forhome.nest.comand try again, or use the Nest Token Extractor extension. - Missing Devices: Ensure your devices are visible in the Nest app. Some newer Google Nest devices (like the 2021+ battery cameras) are exclusively on the Google Home app and may not appear here, or may have limited functionality via the legacy API.
This integration would not be possible without the extensive research and work done by these projects:
- https://github.com/chrisjshull/homebridge-nest
- https://github.com/n0rt0nthec4t/homebridge-nest-accfactory
- https://github.com/iMicknl/ha-nest-protect
This is a personal hobby project and is not affiliated with Google or Nest. It uses an unofficial API that could be changed or discontinued by Google at any time, which may cause this integration to stop working. It is provided "as-is," with no warranty whatsoever. Use at your own risk.
