I made a crappy Nest Thermostat integration that will work as a stopgap until alternatives come out

Hey it gets better!
i have a string in conf yaml to move all sensors to a file.

sensor: !include_dir_merge_list includes/sensor

and in sensor.yaml i have

sensor:
  - platform: badnest

i tried to # that address string and leave the line as you wrote - same error

but! i have a thermostat show as thermostat in services. Thats great!!!

 climate.dining_room_thermostat	heat	hvac_modes: auto, heat, cool, off
min_temp: 7
max_temp: 35
fan_modes: on, auto
preset_modes: none, eco
current_temperature: 25.7
temperature: 24.3
target_temp_high: null
target_temp_low: null
current_humidity: 63
fan_mode: auto
hvac_action: idle
preset_mode: none
friendly_name: Dining Room Thermostat
supported_features: 27

I still have an error with string

        - type: entities
          entitie: 
           -sensor.upstairs_thermostat  

on the Lovelace that Entities should be an array

Also i question - i saw here advices to use
https://github.com/ciotlosm/custom-lovelace/tree/master/thermostat-card
as thermostat card. how do i do that.

Progress! :slight_smile:

I’m just using the standard card for my thermostat, so not use about using a custom card for it.

With the “sensor:” if you have more than one block in your config yaml starting with “sensor:” you have to give them unique names. So for example, I actually have:

sensor nest:

As I also have other sensors in my configuration.yaml, such as:

sensor datetime:
  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'
      - 'date_time_utc'
      - 'date_time_iso'
      - 'time_date'
      - 'time_utc'

Hi everyone. I don’t know what I’m doing wrong but I’m unable to find cookie starting with 0CAK, any hint? All the rest of config seems to be fine

It supposed to be “OCAK”, not “0CAK”.

Anyway, it’s mentioned here multiple times (even in github), use just the :cookie: which is in the last iframe call, doesn’t matter what is at the beginning. After my last refresh mine starts by “SID=”.

Thanks Nath, last is supposed to be the one on top or at the bottom?

My cookie started from
ANID=

so your cookie can also be different

i should used the thermostat entity type

 - type: thermostat
          entity: climate.upstairs_thermostat

all worked well i see all two thermostats and two sensors.
Thank you man, helped me a lot!

1 Like

I can’t seem to get this integration working despite being adamant i’m following the steps to the letter.

  • I’m using “mattsch” repository, installed via HACS
  • I did notice when generating my cookie, the line starts with GoogleAccountsLocale which doesn’t seem to match what others have seen. (screenshot below).

My config.yaml entry:

# Badnest configuration
badnest:
  issue_token: "https://accounts.google.com/o/oauth2/iframerpc?action=issueToken&response.."
  cookie: "GoogleAccountsLocale_session=en; GALX=__kpRhgehy8; SMSV=ADHTe-AHDf-.."xd4XErwkmVK
  region: eu

climate:
  - platform: badnest
    scan_interval: 10

camera:
  - platform: badnest

sensor:
  - platform: badnest

I’ve also tried tweaking the cookie to remove everything before “OCAK” and various other strings that people have mentioned on here. But no joy. So i’m a bit stuck now.

Any pointers, much appreciated!

Sorry for the slightly noob question but what does the sensor element do for this component? Does it allow you to track home/away status via the thermostat?

Try it in Chrome Incognito mode, that should work.

I’m still running the original by RedDragon and all I need to do is occasionally refresh the token and cookie. Until today I used to always get a cookie starting with OCAK, but today it was different, but it still works.

badnest_issue_token: "https://accounts.google.com/o/oauth2/iframerpc?.............F%2Fhome.nest.com"
badnest_cookie: "SMSV=ADHTe-DDksf0N2lB...................ZmvciYlI0C6tQ"

Followed these steps:

  1. Open a Chrome browser tab in Incognito Mode.
  2. Open Developer Tools (View/Developer/Developer Tools).
  3. Click on ‘Network’ tab. Make sure ‘Preserve Log’ is checked.
  4. In the ‘Filter’ box, enter issueToken
  5. Go to home.nest.com , and click ‘Sign in with Google’. Log into your account.
  6. One network call (beginning with iframerpc ) will appear in the Dev Tools window. Click on it.
  7. In the Headers tab, under General, copy the entire Request URL (beginning with https://accounts.google.com , ending with nest.com ). This is your "issue_token" in configuration.yaml .
  8. In the ‘Filter’ box, enter oauth2/iframe
  9. Several network calls will appear in the Dev Tools window. Click on the last iframe call.
  10. In the Headers tab, under Request Headers, copy the entire cookie (beginning OCAK=... - include the whole string which is several lines long and has many field/value pairs - do not include the cookie: name). This is your "cookie" in configuration.yaml .

Thank you so much! That worked perfectly.

Anyone got nest protect work?

To add on to the chorus of does this work, does person detection work with @TheMattS 's version?
I’m very torn if I should switch to Google authentication.
My goal is to get real video from my Nest Doorbell and person detection.
Currently I have person detection with my legacy works with nest integration but I really could use smoother video than the original badnest integration provides, as it’s just frame by frame, I’ve seen some reports of people getting smooth playback.

I was able to successfully integrate my Nest Hello and Nest Protect. I used this repository: https://github.com/mattsch/badnest

However, the video from the Nest Hello is VERY slow. I think it only updates the frame per 10 seconds. Is there anything I can do to speed things up?

1 Like

It seems to work for me in that the devices appear and list their state as ok. I’m using the original RedDragon version still. I haven’t tried burning my house down to test it.

Thanks for the info.
Do you get person detection with your integration?

I’m new to home assistant once I install the repo in hacs, do I have to enable the addon somehow?

I don’t have that integration installed so I’m guessing here.
Normally after adding the repo you would

  • under hacs, click integrations
  • click the + sign
  • search or scroll to the integration
  • configure as needed

It was a custom url, I already added it I think

Now you need to follow the instructions for adding the configuration.yaml entries.