A bad Nest thermostats integration that uses the web api to work after Works with Nest was shut down (bad Google, go sit in your corner and think about what you did)
This isn't an advertised or public API, it's still better than web scraping, but will never be as good as the original API
- No proper error handling
- Won't work with 2FA enabled accounts
- Will only work the for thermostat, I have no other devices to test with
- Nest could change their webapp api at any time, making this defunct
- Presets don't work (Eco, Away)
badnest:
login_type: nest
email: email@domain.com
password: !secret nest_password
climate:
- platform: badnest
scan_interval: 10
badnest:
login_type: google
issue_token: "https://accounts.google.com/o/oauth2/iframerpc....."
cookie: "OCAK=......"
api_key : "#YOURAPIKEYHERE#"
climate:
- platform: badnest
scan_interval: 10
With many thanks to: chrisjshull from https://github.com/chrisjshull/homebridge-nest/
The values of "issue_token"
, "cookie"
and "api_key"
are specific to your Google Account. To get them, follow these steps (only needs to be done once, as long as you stay logged into your Google Account).
- Open a Chrome browser tab in Incognito Mode (or clear your cache).
- Open Developer Tools (View/Developer/Developer Tools).
- Click on 'Network' tab. Make sure 'Preserve Log' is checked.
- In the 'Filter' box, enter
issueToken
- Go to
home.nest.com
, and click 'Sign in with Google'. Log into your account. - One network call (beginning with
iframerpc
) will appear in the Dev Tools window. Click on it. - In the Headers tab, under General, copy the entire
Request URL
(beginning withhttps://accounts.google.com
, ending withnest.com
). This is your"issue_token"
inconfiguration.yaml
. - In the 'Filter' box, enter
oauth2/iframe
- Several network calls will appear in the Dev Tools window. Click on the last
iframe
call. - In the Headers tab, under Request Headers, copy the entire
cookie
(beginningOCAK=...
- include the whole string which is several lines long and has many field/value pairs - do not include thecookie:
name). This is your"cookie"
inconfiguration.yaml
. - In the 'Filter' box, enter
issue_jwt
- Click on the last
issue_jwt
call. - In the Headers tab, under Request Headers, copy the entire
x-goog-api-key
(do not include thex-goog-api-key:
name). This is your"api_key"
inconfiguration.yaml
.