Google-Nest Offical Device Access Console Finally Released!

Which thermostat card are you using or have you shared it? I am using the HACS Climate thermostat card for my two Nest thermostats. It is close but I was wondering if something else was even better. Thanks

Ok thanks for the feedback. Very strange on my side. I have a fixed image that refreshes every 5 seconds, even set to auto. Can you please send me your card code to display the stream on lovelace?

Thanks.

I’d like to see this too but it looks like this new API doesn’t allow control of hot water yet.

1 Like

I’m still working on things but my panet has two cards currently.
1, The native HA Climate card that I’ve been modifying with vertical and horizontal stacks…

type: 'custom:vertical-stack-in-card'
cards:
  - type: thermostat
    entity: climate.living_room
    style: |
      ha-card {
        color: white;
        box-shadow: none;
        background:
        {% if is_state_attr('climate.living_room', 'hvac_action', 'heating') %}
          #EB6D00
        {% endif %} ;
        background: 
        {% if is_state_attr('climate.living_room', 'hvac_action', 'cooling') %}
          blue 
        {% endif %} ;
        background:
        {% if is_state_attr('climate.living_room', 'hvac_action', 'off') %}
          #373F48
        {% endif %} ;
      }
    theme: iOS Dark Mode
  - type: entities
    entities:
      - entity: sensor.living_room_humidity
        name: Inside Humidity
        icon: 'hass:none'
      - entity: sensor.openweathermap_temperature
        name: Outside Temp.
        icon: 'hass:none'
    style: |
      ha-card {
        color: white;
        box-shadow: none;
        background:
        {% if is_state_attr('climate.living_room', 'hvac_action', 'heating') %}
          #EB6D00
        {% endif %} ;
        background: 
        {% if is_state_attr('climate.living_room', 'hvac_action', 'cooling') %}
          blue 
        {% endif %} ;
        background:
        {% if is_state_attr('climate.living_room', 'hvac_action', 'off') %}
          #373F48
        {% endif %} ;
      }
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        style: |
          ha-card { 
            font-size: 0.8rem
            }
        entity: input_select.hvac_mode
        name: MODE
        show_name: true
        tap_action:
          action: call-service
          service: input_select.select_next
          service_data:
            entity_id: input_select.living_room_hvac_mode
        color_type: icon
        state:
          - operator: template
            value: |
              [[[ return states['climate.living_room'].state === 'off' ]]]
            icon: 'mdi:power'
            color: white
          - operator: template
            value: |
              [[[ return states['climate.living_room'].state === 'heat' ]]]
            icon: 'mdi:fire'
            color: 'rgb(239, 140, 0)'
          - operator: template
            value: |
              [[[ return states['climate.living_room'].state === 'cool' ]]]
            color: blue
            icon: 'mdi:snowflake'
        styles:
          card:
            - background-color: |
                [[[
                  if (states['climate.living_room'].attributes.hvac_action == 'heating') 
                    return '#EB6D00';
                  if (states['climate.living_room'].attributes.hvac_action == 'cooling')
                    return 'blue';
                  else return '#373F48';
                ]]]
            - color: white
        show_state: false
      - type: 'custom:button-card'
        style: |
          ha-card { 
            font-size: 0.8rem
            }
        entity: input_select.preset_mode
        name: ECO
        label: ECO
        tap_action:
          action: call-service
          service: input_select.select_next
          service_data:
            entity_id: input_select.living_room_preset_mode
        color_type: icon
        color: white
        icon: 'mdi:leaf-off'
        state:
          - operator: template
            value: >
              [[[ return states['climate.living_room'].attributes.preset_mode ==
              'eco' ]]]
            icon: 'mdi:leaf'
            color: green
        show_state: false
        show_name: true
        styles:
          card:
            - background-color: |
                [[[
                  if (states['climate.living_room'].attributes.hvac_action == 'heating') 
                    return '#EB6D00';
                  if (states['climate.living_room'].attributes.hvac_action == 'cooling')
                    return 'blue';
                  else return '#373F48';
                ]]]
            - color: white
      - type: 'custom:button-card'
        style: |
          ha-card { 
            font-size: 0.8rem
            }
        entity: climate.living_room
        name: SCHEDULE
        action: url
        navigation_path: 'https://home.nest.com'
        color_type: card
        icon: 'mdi:calendar-clock'
        show_state: false
        show_name: true
        styles:
          card:
            - background-color: |
                [[[
                  if (states['climate.living_room'].attributes.hvac_action == 'heating') 
                    return '#EB6D00';
                  if (states['climate.living_room'].attributes.hvac_action == 'cooling')
                    return 'blue';
                  else return '#373F48';
                ]]]
            - color: white
      - type: 'custom:button-card'
        style: |
          ha-card { 
            font-size: 0.8rem
            }
        entity: climate.living_room
        name: HISTORY
        action: url
        navigation_path: 'https://home.nest.com'
        color_type: card
        icon: 'mdi:progress-clock'
        show_state: false
        show_name: true
        styles:
          card:
            - background-color: |
                [[[                  if (states['climate.living_room'].attributes.hvac_action == 'heating') 
                    return '#EB6D00';
                  if (states['climate.living_room'].attributes.hvac_action == 'cooling')
                    return 'blue';
                  else return '#373F48';
                ]]]
            - color: white

SCHEDULE and HISTORY are just URL links to Nest.

  1. This custom:thermostat_card. Orange and blue dials work as does temp up/down but no Mode control or Eco Leaf display as his code currently tests for off/away not none/eco. I am going to replace it into my first card when I get a moment or two!:
type: 'custom:thermostat-card'
entity: climate.living_room
chevron_size: 100
hvac:
  states:
    'off': 'off'
    cooling: cool
    heating: heat
  attribute: hvac_action
away:
  sensor:
    sensor: sensor.living_room_eco_mode

I’ve been trying to decipher the python code but I am a beginner at python.

On the first card,
My Mode and Eco controls are using these helpers:


I created them from yaml in an effort to try to automate creating them but no success yet.
You can use the UI to create them like this (changing the naming of course):

and the input_select.living_room_preset_mode Options would be none and eco and icon mdi:leaf
Plus two automations to trigger off of the input_selects:

alias: Living Room - HVAC Mode
description: ''
trigger:
  - platform: state
    entity_id: input_select.living_room_hvac_mode
condition: []
action:
  - service: climate.set_hvac_mode
    data:
      hvac_mode: '{{ states.input_select.living_room_hvac_mode.state | lower }}'
    entity_id: climate.living_room
mode: single
alias: Living Room Preset Mode
description: ''
trigger:
  - platform: state
    entity_id: input_select.living_room_preset_mode
condition: []
action:
  - service: climate.set_preset_mode
    data:
      preset_mode: '{{ states.input_select.living_room_preset_mode.state | lower }}'
    entity_id: climate.living_room
mode: single

I’ve integrated the custom:thermostat-card:

.Still more fixes to do…

3 Likes

Apologies, couldn’t test it out earlier. Gave it another shot today - removed integration from HA, manually removed all ‘badnest’ devices, removed the truant thermostat from my Google account, did a factory reset of the thermostat, added it back to my account, and then added the native integration again. And this time it worked!!

Do not know what part of the above process fixed it for me. Maybe the combination of removing from my account, factory reset and adding it back again did the trick.

Thank you for the help folks, especially James’ step by step guide.

Interesting, i haven’t run into that. Is this heplful?

Is this happening due to C to F conversions?

I think I recall seeing that Nest uses C internally but when user selects F the thermostat converts it to F using (# °C × 9/5) + 32 = # °F . I just switched my Nest to F. No change in HA until I restarted the integration then I saw 71 C (kinda warm!) then changed HA from metric to imperial and I don’t see a rounding problem…

You could template it and use the templated sensor in the climate card.

Original number:            {{ states.sensor.garage_sensor_air_temperature.state }}
Round to nearest 0.5:       {{ (states.sensor.garage_sensor_air_temperature.state|float * 2)| round / 2 }}
Add 0.5 and to nearest 0.5: {{ ((states.sensor.garage_sensor_air_temperature.state|float + 0.5) * 2 )|round / 2 }}

2 Likes

Nice work. Thank you so much. I have implemented your custom vertical stack card using the custom thermostat-card for my two thermostats. This is great, getting much closer to what I am looking for. I will be happy to implement any improvements which you make. I would like to contribute in some way but I am not a python programer either.

I’m still using the original Works With Nest API. Is there any reason I should switch to this one?

type: picture-glance
title: Front Door
image: camera.front_door
entities:
  - entity: camera.front_door
camera_image: camera.front_door
entity: camera.front_door

Hello,

now I have also the Climate entities :slight_smile:
But the t° not change, if I restart the integration it’s change but not automaticly.
I use the last update release 2020.11.0.

Any idea ?

I’m having success all the way up to HA seeing any entities. I have successfully done the integration- but the integration card just says “configuration.yaml” underneath and I have no entities found. Did I miss a step somewhere? Do I need to add something to the config file?

I’m having the same issue. Not sure how similar your setup is to mine but I’m adding details below.

Followed Maarten’s directions above and had no errors. Nest integration seemed to work and I allowed access but no devices or entities are displaying in HA.

nest

When I look at the logs I’m seeing the following:

2020-11-21 19:47:07 ERROR (MainThread) [homeassistant.components.climate] Error while setting up nest platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/nest/climate.py", line 18, in async_setup_entry
    await async_setup_sdm_entry(hass, entry, async_add_entities)
  File "/usr/src/homeassistant/homeassistant/components/nest/climate_sdm.py", line 83, in async_setup_sdm_entry
    device_manager = await subscriber.async_get_device_manager()
  File "/usr/local/lib/python3.8/site-packages/google_nest_sdm/google_nest_subscriber.py", line 97, in async_get_device_manager
    return await self._device_manager_task
  File "/usr/src/homeassistant/homeassistant/components/nest/camera.py", line 18, in async_setup_entry
    await async_setup_sdm_entry(hass, entry, async_add_entities)
  File "/usr/src/homeassistant/homeassistant/components/nest/camera_sdm.py", line 35, in async_setup_sdm_entry
    device_manager = await subscriber.async_get_device_manager()
  File "/usr/local/lib/python3.8/site-packages/google_nest_sdm/google_nest_subscriber.py", line 97, in async_get_device_manager
    return await self._device_manager_task
  File "/usr/src/homeassistant/homeassistant/components/nest/sensor.py", line 19, in async_setup_entry
    await async_setup_sdm_entry(hass, entry, async_add_entities)
  File "/usr/src/homeassistant/homeassistant/components/nest/sensor_sdm.py", line 36, in async_setup_sdm_entry
    device_manager = await subscriber.async_get_device_manager()
  File "/usr/local/lib/python3.8/site-packages/google_nest_sdm/google_nest_subscriber.py", line 97, in async_get_device_manager
    return await self._device_manager_task
  File "/usr/local/lib/python3.8/site-packages/google_nest_sdm/google_nest_subscriber.py", line 106, in _async_create_device_manager
    devices = await self._api.async_get_devices()
  File "/usr/local/lib/python3.8/site-packages/google_nest_sdm/google_nest_api.py", line 46, in async_get_devices
    devices = response_data["devices"]
KeyError: 'devices'

I added Climate: to my configuration.yaml but this didn’t help. Can’t tell if I need any other files for HA to recognize the nest integration.

I made a change to fails more gracefully/silently when this happens, but the main problem is the api is not returning any devices for your requests. You authorized a decide in the oauth consent flow?

Julek found the solution and posted in the comments of the blog post:

Thank you for this. Really helpful!
The only thing I was missing is that I needed to enable the “Smart Device Management API” to get it to work.

From https://developers.google.c…

Thumbnail

Then

Thumbnail

2 Likes

I too was using the Works API, but decided to changed over as eventually this solution will have a heck more functionality that the Nest Works approach. I’d suggest you update HA to the latest release as this support most of what you’ll require relative to Refresh token execution.

I got a lot of guidance watching a video https://youtu.be/_Wex2SLmEJ8?t=278 from @mostlychris to attain the prerequisites in setting up the requirements for entering into configuration.yaml. This integration brings us closer to the way it should be. Shout out to @allenporter!!

Anyone had this kind of error…

Authorization Error
Error 403: access_denied
The developer hasn’t given you access to this app. It’s currently being tested and it hasn’t been verified by Google. If you think you should have access, contact the developer ([email protected])

Did all the steps from the instruction, passed the screen with the massage “This integration is not tested and approved by Google for commercial bla bla”, choose my email account and then i got this massage above :frowning:

I believe you have to click Advanced and then proceed anyway to indicate that you’re ok with it.

No Advanced button or any kind of button on error page unfortunately

Ah sorry I was thinking of the Chrome warning. I’d double check all the steps, and also make sure you’re using the right account.