Monday 17 February 2020

My Home Assistant Server Feb 2020

My Home Assistant Server Feb 2020


I have lots of tech at home, loads and loads in fact.
I recently purchased my daughter a Raspberry Pi 4, 4GB with the intention of teaching her some coding and maybe picking up some useful skills for myself.
My first proper project after playing around a bit with retropie was a Home Assistant server:
https://www.home-assistant.io/
This would allow me to combine all the tech I have at home including the 40 odd hue light bulbs, Ring floodlight, 2 Nest cams, Yale smart alarm, 2 sonos speakers, 2 Google Hubs a google mini and a robot smart vacuum all into one neat interface.

Most of this was pretty straight forward, though one of the biggest challenges i have faced with all this tech is the headache caused by Nest and Google merging, Nest had a very good works with Nest program which allowed developers to easily integrate and come up with weird and wonderful solutions. For a long time now I have used my Nest thermostat which was the first piece of smart tech I purchased as a sort of presence sensor, this works very well and has done for a long time.

Google in their infinite wisdom decided to do away with this program and force users to use their google account for all nest products, this in itself would have been fine were it not for the fact they decided to stonewall any loyal GSuite users, myself included. this has meant no end of fun and games setting up standard google accounts to access my nest items and the fun and games trying to get things like my lifetime photo collection to sync with the otherwise amazing Google Nest Hub Max we recently purchased.

The reason i mention the above is that there is actually a workaround to get the Nest products to "talk" to the home assistant but this involves some clever addins developed in the the form of Badnest  the reason for this blog post is to document the process to renew the cookie token that is required for this to work, the token only seems to be valid for a couple of weeks then needs renewing

Heres a step by step how to get the token:

The values of "issue_token" and "cookie" 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).
  1. Open a Chrome browser tab in Incognito Mode (or clear your cache).
  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.