[SOLVED] Nest thermostat status home/away

Hi there, i’ve configured my Nest thermostat and it’s working fine. But i wonder if it is possible to show and use the home/away status.

I’ve set up our phones to interact with the nest. And when we are all away the nest switches to status away.

But in HA i can’t find a way to retrieve this status. I can change the status from HA but it doesn’t seem to read the status from the nest. Which would be useful for automations.

In the Nest developer account i did set permissions which imply that the status is 2 way traffic.

Does anyone know if it is possible to retrieve the home/away status from the Nest thermostat?!

I am using the nest thermostat, and have been for the past year with good luck. Go to the states tab on the front end (first circle), and you should see something like climate.downstairs . In the second column is the state of the device (in my case heat), and the third column has the state attributes. You can access all of these things and control most of them with automations.

Here’s a snippet of an automation I have that sets the heat to away mode once I’ve left work.

  condition:
	condition: and
	conditions:
	  - condition: time
		after: '13:30:00'
	  - condition: state
		entity_id: input_boolean.heat_on_daily
		state: 'off'    
	  - condition: state
		entity_id: group.all_devices
		state: not_home
		#checks if thermostat is off (summer)
	  - condition: template
		value_template: "{% if not is_state('climate.upstairs', 'off') or not is_state('climate.downstairs', 'off') %}true{% else %}false{% endif %}" 
  action:
	#preferable to call this way, so that device names don't matter. All climate.
	- service: climate.set_away_mode
	  data:
		away_mode: 'off'

If you add climate.downstairs (or whatever) you should see a control panel that looks like this once you click on it:

Thanks for the clear explanation. It’s not quite what i want though. I can set the thermostat to home/away from HA. I would like to see in HA what the current status is on my thermostat (so the other way around).

image

This unfortunately doesn’t show the current status off the thermostat.

Look into setting up a template sensor using the “away_mode” attribute.

then you can show that sensor status on the frontend.

1 Like

Thanks, i will take a look but i haven’t made any templates yet… Are you referring to “SENSOR STATES”?

yes, sort of…

You should be able to modify the first example there to your requirements and then display the resulting sensor on your frontend.

1 Like

Or in a similar fashion, a template binary sensor, if you want the sensor to be “on” or “off.”

Ok, took me some time to figure this out but this works:

# Nest away status
  - platform: template
    sensors:
      away_mode:
        friendly_name: "Thuis"
        value_template: "{{ states.climate.downstairs.attributes.away_mode }}"

But how do i change what i see in the webUI. It now says either off or on. I would like it to say away or home.

1 Like

did you put it under sensor: or binary_sensor: ?

It is under sensor.

go to the link i posted above & scroll a little further down until you see “renaming sensor output”. That should get you where you want to be.

I did try that, but as i have no clue as to what i’m doing it kept saying ‘home’ even when i set the thermostat to away :slight_smile:
I’m not sure what to replace sun.sun with?!

      {% if is_state('sun.sun', 'above_horizon') %}
        up
      {% else %}
        down
      {% endif %}

try replacing it with:

states.climate.downstairs.attributes.away_mode

like this:

{% if is_state('states.climate.downstairs.attributes.away_mode', 'off') %}
  Home
{% else %}
  Away
{% endif %}

assuming it is off when mode is home…

1 Like

If i run that in templates (in the webUI) and change off to on (or the other way around) the outcome is away…

What does the attribute actually say if you look at your states page under that entity?

switch between home and away and you should see it change.

Also capitalization is important too. You need to see exactly what it says and put that into your template.

on (which is away) and off (which is home) are the available states.

away_mode: off

I’m sorry I may have mixed up your entity id with @Dolores

What is your entity_id for the thermostat?

Can you post a screen shot of you states page showing the entity the way they did?

climate.downstairs

Like this:

So it’s the same as dolores is?

I guess, lack of imagination :slight_smile:

1 Like