Exposing Google Home/Away mode to Home Assistant

Overview: This guide explains how I exposed the Google Away/Home mode that is updated using nest thermostats presence sensing, Nest Yale Lock and Google Cameras, but is not exposed by the crapstatic new Nest API.

In the works with Nest day, it was possible to get this status from the Thermostate mode, that was set to away automatically by Google Home, but now this is not update anymore, there is an eco preset but it is not set when Google home transition to away, now the only value that is changed is the temperature preset (thanks Google!)

Requirements:

  • Working connection between Home Assistant and Google home, this could be achieved by using Nabu Casa or by connecting to it manually (more info here)

Guide:

  1. Create an input_boolean helper:

  2. Expose this helper variable to google home. With Nabu Casa you do that by going to Settings, Home Assistant Cloud, Google Assistant, Manage Entities

image

  1. Check in the Google Home app if the toggle shows as a switch device.
  • If not change it by long pressing the item in the Google Home dashboard, clicking the cog icon on the upper right corner and them changing Device Type to Switch
  1. Update/Create Home and Away Google Home routines to update the exposed input_boolean helper

Please, if anyone knows a less cumbersome way of doing this let me know :slight_smile:

Why I did this: I am using this info to complement my House Occupancy binary sensor, which is based on cellphone location and people entering and leaving the house. That way if me and my wife leaves the house and we have some guests staying with us they will not freezy during the nice Canadian winters.

Example of the Occupancy sensor from my configuration.yaml

# Templates
template:
  # Sensors
  # House Occupancy
  - trigger:
      - platform: homeassistant
        event: start
      - platform: event
        event_type: event_template_reloaded
      - platform: state
        entity_id: group.occupancy_owners_phones
      - platform: state
        entity_id: sensor.front_door_entering_or_leaving
        to:
        - entering
        - leaving
      - platform: state
        entity_id: input_boolean.google_home_mode
        
    binary_sensor:
    - name: "House Occupancy"
      device_class: occupancy
      state: >
        {% if (is_state('group.occupancy_owners_phones', "home")) %}
            on
        {% elif ((is_state('group.occupancy_owners_phones', "not_home")) and (is_state('sensor.front_door_entering_or_leaving', "entering"))) %}
            on
        {% elif ((is_state('group.occupancy_owners_phones', "not_home")) and (is_state('input_boolean.google_home_mode', "on"))) %}
            on
        {% else %}
            off
        {% endif %}
3 Likes

I don’t think there is. I actually did this to see how it would work. It drives me crazy because I can’t even seperate the two nest presence routines (upstairs/downstairs nests). It’s all or nothing.

The only way for you to do that is to create 2 Google Home “houses” one upstairs and one downstairs, as Google uses other sensors for defining presence.

So far what I could figure out is that it uses the Nest Yale lock, Nest Thermostats and Person Detection for the indoor Nest Cameras.

I don’t (and haven’t enabled location) presence from google for presence. Only the nests. I am not sure, in that cirumstance how they even turn off their own presence. I guess I’ll find out if they ever do. lol

Hi.
Does this this approach still work or has google broken?

I’ve jsut attmpted to follow this guide but it failed…

I’ve created the input boolean, and exposed it to G.A through my HA nabu casa settings, but it won;t show up in the list of entities in the Google Home app Routines->Actions list.

This Home app Actions page only shows my other ‘Lights’ devices that are formally linked into Assistant e.g my LIFX light, and none of my HA entities.

My H.A entities (and this boolean) are visible in other parts of the google Home/Assistant under the ‘Linked to you’ category.

It is still working. I use Nabu Casa to expose the input boolean as a switch, and it appears on my list of switches in google home and in the home and away routine. If it appears in other places, try editing the Device Type (Long press the item in the Google Home dashboard, click the cog icon on the upper right corner and Device Type.

1 Like

@gmlupatelli
Thanks so much for this! I’ve got it working now. :smiley:

Once i edited the entity in the Google Home app it then showed up straight away!
I’m kicking myself as I never realised you can manually change the device type for an entity in the GH app. Doh!

It may be worth adding that additional line to the instructions above.
No onwards to start building some automations based on this setting…

Cheers!

This a great idea, thanks for sharing! My wife’s iPhone drives me nuts but it seems that Google home keeps fairly good track of it.

Thank you for this guide, I’m considering following it. However, do you know if Google Home/Away mode corresponds 1 on1 with Home/Away status of my Nest thermostat? Because it’s actually the Home/Away status of my thermostat that I would like to disclose in HA.

Thanks!