Automation can't modify hvac_mode on Nest

I’ve had my automation setup for my Nest thermostats for awhile now to adjust the hvac_mode from heat_cool to heat and vice versa. Finally got into a warm spell and flipped back. Each time my automation tried to change the mode nothing happened. It would not modify the mode and would not modify the temperature. I could go into the HA overview and manually modify it there, but not via an automation. Debug shows it is sending the proper commands. If there is no mode change (regardless of the mode), the temperature is set correctly.

I saw a similar bug report that was fixed where setting hvac_mode to off fails and was resolved. My guess is there are further bugs with this integration or with Google API. Anyone else having this same problem or should I create a new bug report?

Snippet of my code:

action:
  - choose:
      - conditions:
          - condition: time
            after: '05:00'
            before: '08:00'
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: input_select.outside_relative_temperature
                    state: cold
                sequence:
                  - service: climate.set_temperature
                    data:
                      hvac_mode: heat
                      temperature: 68
                    target:
                      entity_id: climate.downstairs
                  - service: climate.set_temperature
                    data:
                      hvac_mode: heat
                      temperature: 66
                    target:
                      entity_id:
                        - climate.upstairs

If there are no relevant errors in your log, have a look at the automation trace to see what is going on. The part of the config you have shared looks ok to me. Though you could just put both choose conditions at the top level rather than nesting them. Conditions are AND logic by default. Unless there are other choose options you have not shown.

The full automation is quite long. Not sure how to upload that yaml file to show what’s being done.

Try the trace to troubleshoot then, if there are no relevant errors in the log.

This shows the trace of the command that was executed, but it had no effect.

My next steps are to do some testing and narrow down where the bug is at. Could be the API does not like to change the mode and set the temperature at the same time. I can break those down. Furthermore, I could work around the bug by just changing the automation to not modify the mode (which I know works just fine) and adjust temp max and min to keep them from triggering (what I was using hvac_mode for).

Ok, so it’s an issue with the nest integration rather than your automation.

Using the developer tools, I just submitted this service call while my thermostat was set to heat mode:

service: climate.set_temperature
data:
  target_temp_high: 80
  target_temp_low: 60
  hvac_mode: heat_cool
target:
  entity_id: climate.downstairs

Nothing happened. While still in heating mode, I then submitted this service call:

service: climate.set_temperature
data:
  temperature: 60
  hvac_mode: heat
target:
  entity_id: climate.downstairs

Thermostat immediately set itself to 60°. So, yeah, this is a bug. I then tried to simply change the mode to heat_cool using this service call:

service: climate.set_temperature
data:
  hvac_mode: heat_cool
target:
  entity_id: climate.downstairs

Nothing happened. So, it appears any change to hvac_mode is simply not working at this time.

Did some more testing and realized there is a service call for climate.set_hvac_mode:

service: climate.set_hvac_mode
data:
  hvac_mode: heat_cool
target:
  entity_id: climate.downstairs

That worked. Appears there is a conflict in how climate.set_temperature is being used in the integration creating a lot of confusion. I guess that the API does now allow it, but HA/integration thinks it exists.

1 Like

Bug report submitted.

1 Like

Hi there - I’m trying to set up my first automation and it relates to Nest Modes. Can you see what I’m doing wrong here? I want to be notified when the Nests are set to be in conflict with one another, especially if they are “running” in conflict (e.g. heat on downstairs, and cool on upstairs).

alias: Thermo Conflict
description: ""
trigger:
  - platform: state
    entity_id: climate.downstairs
  - platform: state
    entity_id: climate.upstairs
condition:
  - condition: template
    value_template: >-
      {{ states('climate.downstairs') != states('climate.upstairs')
      }}
action:
  - service: notify.email_notification
    data:
      message: >-
        White Downstairs is in {{ state_attr('climate.downstairs',
        'hvac_mode') }} mode, while White Upstairs is in {{
        state_attr('climate.upstairs', 'hvac_mode') }} mode. Please check
        your HVAC system.