Hi All,
I wanted to share my Nest config for everyone. Seems some people are having some issues with the new methods that the climate component uses, and hopefully this helps someone out or gives them some ideas.
Let me know if you have any questions, improvements, etc to this.
## Nest package - Includes base Nest thermostat configuration, away mode switch and sensor,
## Runtime for the day and month, and manual fan control.
nest:
# Set Client ID
client_id: !secret nest_client_id
client_secret: !secret nest_secret
# Define Binary Sensor Options
binary_sensors:
monitored_conditions:
- 'fan'
- 'target'
- 'has_leaf'
- 'online'
- 'is_using_emergency_heat'
- 'eta'
sensor:
# Nest Away Mode sensor. This is optional, but useful.
- platform: template
sensors:
nest_thermostat_away_mode:
friendly_name: "Nest Thermostat Away Mode"
value_template: >
{% if is_state_attr('climate.nest', 'preset_mode', 'away') %}
Away
{% else %}
Home
{% endif %}
# HVAC Run Time Today Senson. This utilizes the
- platform: history_stats
name: HVAC Run Time Today
entity_id: binary_sensor.nest_fan
state: 'on'
type: time
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'
# HVAC Run Time This Month Sensor
- platform: history_stats
name: HVAC Run Time This Month
entity_id: binary_sensor.nest_fan
state: 'on'
type: time
start: '{{ now().replace(month=now().month).replace(day=1).replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'
switch:
# Switch to control Nest Away Mode. This utilizes the new climate implimentation to set away mode.
- platform: template
switches:
nest_away_mode:
friendly_name: "Nest Away Mode"
value_template: "{{ is_state_attr('climate.nest', 'preset_mode', 'away') }}"
icon_template: >-
{% if is_state_attr('climate.nest', 'preset_mode', 'away') %}
mdi:walk
{% else %}
mdi:home
{% endif %}
turn_on:
service: climate.set_preset_mode
data:
entity_id: climate.nest
preset_mode: away
turn_off:
service: climate.set_preset_mode
data:
entity_id: climate.nest
preset_mode: none
# This switch can also be defined using the nest.set_away_mode functionality.
# - platform: template
# switches:
# nest_away_mode:
# friendly_name: "Nest Away Mode"
# value_template: "{{ is_state_attr('climate.nest', 'preset_mode', 'away') }}"
# icon_template: >-
# {% if is_state_attr('climate.nest', 'preset_mode', 'away') %}
# mdi:walk
# {% else %}
# mdi:home
# {% endif %}
# turn_on:
# service: nest.set_away_mode
# data:
# away_mode: away
# turn_off:
# service: nest.set_away_mode
# data:
# away_mode: home
fan:
# Creates a template fan to be able to control the HVAC fan independently of heating and cooling.
- platform: template
fans:
nest_fan:
friendly_name: "Central Air Fan"
value_template: "{{ states('binary_sensor.nest_fan') }}"
turn_on:
service: script.turn_on
data:
entity_id: script.nest_fan_on
turn_off:
service: script.turn_on
data:
entity_id: script.nest_fan_off
script:
# HVAC fan on script for template fan
nest_fan_on:
alias: Nest Fan On
sequence:
- service: climate.set_fan_mode
entity_id: climate.nest
data:
fan_mode: 'on'
# HVAC fan on script for template fan
nest_fan_off:
alias: Nest Fan Off
sequence:
- service: climate.set_fan_mode
entity_id: climate.nest
data:
fan_mode: 'auto'