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

It was nest login but no 2FA. It would be hard to get 2FA to work with this. I was using Selenium ChromeDriver to control the browser and read the page source to get the data.

I control my Nest Thermostat via the Assistant Relay integration. Yes, I can’t read the status of the Nest thermostat, but I can send (google assistant) commands to it, to p.e. lower the temperature.

@mhpetiwala, thx this worked when nothing else would

How do I remove this from Home Assistant. I have removed the folder this is stored it but it won’t let me uninstall it from within Home Assistant. It won’t let my Home Assistant load correctly.

Since last update HA can’t initialize BadNest.
I got this notification:

Invalid config

The following integrations and platforms could not be set up:

 [badnest](https://custom-components.github.io/badnest)
 badnest.climate
 badnest.camera
 badnest.sensor

Please check your config and [logs].

Also, in the logs, I get this:

Logger: homeassistant.setup
Source: setup.py:280
Unable to prepare setup for platform badnest.climate: Unable to set up component.

and also this:

Logger: homeassistant.setup
Source: custom_components/badnest/api.py:140
First occurred: 8:24:21 AM (1 occurrences)
Last logged: 8:24:21 AM

Error during setup of component badnest
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
    result = await task
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/badnest/__init__.py", line 43, in setup
    'api': NestAPI(
  File "/config/custom_components/badnest/api.py", line 53, in __init__
    self._get_devices()
  File "/config/custom_components/badnest/api.py", line 140, in _get_devices
    self._czfe_url = r.json()["service_urls"]["urls"]["czfe_url"]
  File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Anyone else experiencing the same?

EDIT: For the benefit of others, it was just the token that was expired. I couldn’t recall how to retrieve it, so here it is (for non migrated accounts):

  1. Go to https://home.nest.com in your browser and log in.
  2. Once that’s done, go to https://home.nest.com/session in your browser, and you will see a long string that looks like this:
{"2fa_state":"not_enrolled","access_token":"XXX","email":"...","expires_in":"...", ...}
  1. Copy your access_token value in your configuration.yaml and you’re done!

@thunder2k it might be worth your time to setup the new nest integration by following these steps

1 Like

My thermostat was working great! I just got the HA blue and when I changed it, the Badnest stopped working. I have removed it and tried to reinstall it, no luck!!! any idea? HELP!

1 Like

There’s a lot they haven’t exposed, like the Nest Protect smoke alarms as well.

Hey :wave:- does anyone have a badnest currently working?

Mine went offline and I couldn’t get it to work with two different branches…

Hej, yes it’s working just had to refresh my token today

Hey guys! want to know if the integration is working for you today??? mine stop working.

Regards,

Hi - mine has stopped working as well… I have tried pulling new login token,cookie. but still not work.

Any advise on how to proceed? Which fork are you using, @shisva ?

1 Like

Small offtopic but since we have here so many Nest users… If you ever start to loose Wifi/Bluetooth signal from your Nest Thermostat, you better not reset it to defaults because then you end-up with basically bricked device (it works, but there is permanently a Download icon on the screen, you won’t be able to add it back to your account due to TD023 error and Google is not helpful whatsoever - i didn’t know it’s a thing until i bricked one of my own).

At least i bough the version with a stand so it’ll be a good paperweight.

Is there some update for this badnest integration ? The first “official” repo is gone (404) maybe there’s a new fork or something ? After the latest 2021.6 upgrade badnest stops working (disabled with ‘invalid config’ error)

I am really surprised that this (Badnest) integration is still be used. It has no future use this guide and migrate to official supported Nest Integration.

I’m not. That guide requires a google account to access Nest. There are a lot of users who stil have not transfered their Nest account to Google. I haven’t.

Genuinely curious to why not migrate? Is because of Google being so pervasive in our lives you feel like holding off on giving access to your thermostat?

It is quite the process so I can understand the hesitance.

Just out of curiosity, why?

Btw: This should be still able to use the native Nest API.

For me it is because the only Nest device I have is the nest protect and that is not supported by the core integration AFAIK.

Afaik this does not work with Home Assistant Operating System.