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

I’ll second that this works perfectly. I had done that already before reading this thread because I saw that using the old Nest API was not supported in HA and I have resisted with all my will to not move to Google’s API and all the baggage that comes with it (as well as the difficulty in setting it up).

I actually got all the way through the Google API setup with the $5.00 fee and getting all the tokens, holy crap what a nightmare, but didn’t actually migrate my Nest to Google - I was saving that as a last resort if nothing else worked.

Having worked with Homebridge quite a bit I decided to see if I could get that to work first, so I spun up a Homebridge instance (takes < 5 minutes), added the Nest and I was fully up and running in HA with my Nest in no time, then used the HomeKit Accessory integration to read in my thermostat and was so happy when everything just worked.

So if you’re like me and just want to avoid Google at all costs, this is a great workaround (until they eliminate the Nest API entirely, and who knows when that will happen). This worked out for me anyway because I have a “backup Pi” around in case something happens to my HA Pi, so this is a good use for it.

How are you accessing the Nest Guard and Nest Detects?

I made an app that acts as a proxy for the Nest devices which gets the data for the devices via a browser and the nest web interface. Take the nest door/window sensors. The app logs into my nest account via the web and then checks the nest website, where you can see all your devices and control them, for their status and relays it via MQTT. You can do the same with Nest Guard and almost all other devices. You can even set the Nest Guard mode via a hacky trick by toggling the nest built-in Home/Away mode. You have to use the hacky trick as there is no proper way to set the Nest Guard mode via the web interface. It’s for security reasons.

I would share it, but I’m not home for many more months and don’t have access to it atm. But if you know how to program, it shouldn’t be hard for you to create this. The selenium webdrivers library makes it very easy to do and is available for many languages, including python.

Hello,

I can read a lot of Github repositories so now, what is the right one to use please?

Because I have the same error as @candleonaflame and I use the following repository: https://github.com/therealryanbonham/badnest

I tried multiple times and ensure token and cookie were correct, putting them in " and without.

I am totally lost with Bad Nest :frowning_face:

I have A Nest Thermostat E (EU) so the only one which won’t be supported by the Nest API unfortunately so I cannot choose the resignation and pay :slight_smile:

Forget about badnest, even the original author dumped it (not to mention some users had issues with NestE via badnest anyway). If you’re not able to use the official integration then try this which i’ve mentioned few post above yours.

Hello,

I have installed and configured Homebridge.

In my Home Assistant integrations, it is displayed as discovered in my network so I click Configure.
After that, the installation progress stays to 50% and never finish.

What do I do wrong?
Of course I did it after succeeding in adding my thermostat.

Can the homebridge method write humidity targets? this is the one thing that badnest has going for it over the new google API.

I am using this ability w/ badnest in order to automate my humidifier attached to my furnace.

@Nardol Unfortunately i use HOOBS so i have no idea, sorry.

@krock Checked my setup and doesn’t look like so. At least homebridge-nest plugin, there is also homebridge-google-nest(haven’t tried this one though).

I still haven’t “migrated” my Nest thermostats to the “new” method. If I do that, will I be required to use this kind of workaround?

No problem, finally I read better the documentations about Nest APIs and all my certitudes fortunately felt, EU thermostats with head link are compatible with SDM (the latest Nest API) so I paid 5$ which looks like to be the price of a really better health for my brain :slight_smile: I was confusing with the old Works with Nest API which cannot be used with my EU thermostat with head link.
With the Home Assistant Nest Integration I have not the temperature from the head link but it is a good compromise for me.

Had a look at the traits for the new API access, and it looks like they haven’t made any of the hot water controls available though it. So no being able to access boost or change between running on schedule or turning off the water heater functionality of the thermostat via the new integration.
I’m still interested in what Google are doing with the Nest Protects too - no development in ages, they aren’t supported by the new API either, and they don’t meet current legislation to install in Scotland. Feels like they are being left behind.

new integration set up and working but I dream of the day I can return to using Hassio to turn my hot water cylinder heating on and off like I could with badnest without needing to open a seperate app :frowning:

Thank you for your response. Are you doing this with Google login or Nest login? Also, do you have 2FA enabled?

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