Help With a Scene Using Ecobee Thermostats In The Heat/Cool (Auto) Mode

I’m trying to make scenes that can be used during the winter that takes advantage of the Heat/Cool (Auto) mode in my Ecobee thermostats. When I think I’ve got it configured correctly, I test it out and the results are nowhere near what I’ve configured. In my most recent attempt, one of my thermostats changed to heat and set the temperature way higher than I would ever program. The other thermostat didn’t change at all.

Side note, up until this afternoon, every time I tried to toggle the AC in any way within a scene, I’d always be given an error saying the mode (home/away/etc.) is not correct. Not sure why I’m no longer getting this error, but I’ll take what I can get.

I’ve tried to do the configuration using the GUI as well as YAML editing and neither work correctly. This has become rather frustrating and to get spouse approval, I need to get this working otherwise I’m back to changing the air manually like a caveman…thus defeating the purpose of this otherwise wonderful smart home platform.

If anyone has example YAML or debugging suggestions/tips that have worked for you, I’d be forever grateful. Thank you in advance.

If you’re able to, post your code.

Some basic YAML strategies are to intersperse your code with, for example, persistent_notification.create calls, and using them to print the contents of variables.

If you’re using Jinja templates in your code for more than just dereferencing variables, the Template Editor in the Development Tools section of the GUI can be helpful in many instances.

In general, I have found HA’s generic scenes mechanism to be pretty unflexible. You might be better off with a script that checks the state of the thermostat and directly does exactly what you want the thermostat to do.

Yep, here’s what I’ve got at the moment.

id: "1737502543001"
name: Thermostat - Bedtime - Winter
entities:
  climate.office_thermostat:
    hvac_modes:
      - heat_cool
      - heat
      - cool
      - "off"
    min_temp: 44.6
    max_temp: 95
    target_temp_step: 0.5
    fan_modes:
      - auto
      - "on"
    preset_modes:
      - away
      - home
      - sleep
      - away_indefinitely
    current_temperature: 71.6
    temperature: null
    target_temp_high: 64
    target_temp_low: 59
    current_humidity: 31
    fan_mode: auto
    hvac_action: idle
    preset_mode: temp
    fan: "off"
    climate_mode: Sleep
    equipment_running: ""
    fan_min_on_time: 0
    available_sensors:
      - Desk (ddf570677908d68ed1eeae3f429ca57d)
      - Office (b5570a3b37ef96b99d736103de65592e)
      - Office - Thermostat (a432083da1e488af89e79d351467f2bb)
      - Office Lights (a267638eb34cf257981b80d5d8b458dc)
    active_sensors:
      - Desk
      - Office
      - Office - Thermostat
      - Office Lights
    friendly_name: Office - Thermostat
    supported_features: 411
    state: heat_cool
  notify.office_thermostat:
    friendly_name: Office - Thermostat
    supported_features: 0
    state: unknown
  climate.bedroom_thermostat:
    hvac_modes:
      - heat_cool
      - heat
      - cool
      - "off"
    min_temp: 44.6
    max_temp: 95
    target_temp_step: 0.5
    fan_modes:
      - auto
      - "on"
    preset_modes:
      - away
      - home
      - sleep
      - away_indefinitely
    current_temperature: 66
    temperature: null
    target_temp_high: 64
    target_temp_low: 59
    current_humidity: 34
    fan_mode: auto
    hvac_action: heating
    preset_mode: temp
    fan: "on"
    climate_mode: Sleep
    equipment_running: auxHeat1,fan
    fan_min_on_time: 0
    available_sensors:
      - Bedroom (722039988dd48a8b51ba025bf8303035)
      - Bedroom (b62a30152e98460a03c967d675d530e6)
      - Bedroom - Thermostat (057925a274dc68af28e9dc720663db6f)
    active_sensors:
      - Bedroom
      - Bedroom
      - Bedroom - Thermostat
    friendly_name: Bedroom - Thermostat
    supported_features: 411
    state: heat_cool
  notify.bedroom_thermostat:
    friendly_name: Bedroom - Thermostat
    supported_features: 0
    state: unknown
icon: mdi:air-conditioner
metadata: {}

For some context, is that YAML for your scene? If so, did you write it manually or with the scene editor?

I ask because that doesn’t look right as a scene at all: it’s got way too much stuff. Most of it looks like the full output of the state of the climate.office_thermostat entity, something you would get from the States section of the Development Tools. Not criticism; just trying to explain what I need to know to help.

How are you invoking the scene–via the GUI, or via an automation or script or something of the sort?

Thank you for your quick replies! This is the YAML from one of the scenes I created using the scene editor. I’ve got an automation that uses this scene. I agree it looks noisy. For reference here is YAML from one of my original scenes which is working. I’m not sure why the first code I posted is referencing available_sensors for example, while the code below does not.

id: "1720272804080"
name: Thermostat - Bedtime - Spring, Summer & Fall
entities:
  climate.bedroom_thermostat:
    hvac_modes:
      - heat_cool
      - heat
      - cool
      - "off"
    min_temp: 44.6
    max_temp: 95
    target_temp_step: 0.5
    fan_modes:
      - auto
      - "on"
    preset_modes:
      - away
      - home
      - sleep
      - away_indefinitely
    current_temperature: 69.1
    temperature: 64
    target_temp_high: null
    target_temp_low: null
    current_humidity: 53
    fan_mode: auto
    hvac_action: cooling
    preset_mode: temp
    fan: "on"
    climate_mode: Sleep
    equipment_running: compCool1,fan
    fan_min_on_time: 0
    friendly_name: Bedroom - Thermostat
    supported_features: 411
    state: cool
  notify.bedroom_thermostat:
    friendly_name: Bedroom - Thermostat
    supported_features: 0
    state: unknown
  climate.office_thermostat:
    hvac_modes:
      - heat_cool
      - heat
      - cool
      - "off"
    min_temp: 44.6
    max_temp: 95
    target_temp_step: 0.5
    fan_modes:
      - auto
      - "on"
    preset_modes:
      - away
      - home
      - sleep
      - away_indefinitely
    current_temperature: 71.7
    temperature: 64
    target_temp_high: null
    target_temp_low: null
    current_humidity: 51
    fan_mode: auto
    hvac_action: idle
    preset_mode: temp
    fan: "off"
    climate_mode: Sleep
    equipment_running: ""
    fan_min_on_time: 0
    friendly_name: Office - Thermostat
    supported_features: 411
    state: cool
  notify.office_thermostat:
    friendly_name: Office - Thermostat
    supported_features: 0
    state: unknown
icon: mdi:air-conditioner
metadata: {}

To be honest, I’m surprised that the second scene you posted works at all. I also have an Ecobee with HA, and trying to set the HVAC Mode to “heat” just now by setting the “hvac_mode” attribute of the climate entity did not do anything.

Regardless of that, many of the attributes your scene is trying to set are not ones that make sense for a user to set. For example, “hvac_modes” is something that is provided by the integration – it is a list of the valid settings for the “hvac_mode” attribute. It’s possible that you’re setting a combination of attributes that the Ecobee integration does not understand or otherwise misinterprets.

My suggestion is to use actions to control the ecobee directly in your automation, to tell it to do exactly what you want and no more. You can do that with the automation editor in the GUI, but, for example, you can set the target temperature with something like:

- action:  climate.set_temperature
  target:
    entity_id: climate.bedroom_thermostat
  data:
    temperature: 64

You can also control whether the HVAC mode is “off” or “heat” or “cool” or “auto” with something like

- action:  climate.set_hvac_mode
  target:
    entity_id: climate.bedroom_thermostat
  data:
    hvac_mode: heat

Unfortunately, the actions available for “climate” entities seem not to be that well documented. Here you can probably get some help from the GUI, which I think tells you what actions might be available for an entity like your climate.bedroom_thermostat. Happy to help, too, if you’re not sure.

Awesome thank you for your suggestion. I’ll give it a whirl and report back.

I configured the automation using climate based actions as suggested (I can’t believe I didn’t know this was here already lol). Unfortunately, it doesn’t seem to be changing my thermostats when testing. Here’s my YAML. Thank you in advance and thank you for your feedback thus far. :slight_smile:

alias: Thermostats - Winter
description: ""
triggers:
  - at: "05:30:00"
    id: Chan
    trigger: time
  - at: "06:45:00"
    id: Brian
    trigger: time
  - at: "08:00:00"
    id: Morning
    trigger: time
  - at: "19:30:00"
    id: Bedtime
    trigger: time
conditions: []
actions:
  - if:
      - condition: trigger
        id:
          - Chan
    then:
      - action: climate.set_temperature
        metadata: {}
        data:
          hvac_mode: heat_cool
          target_temp_low: 67
          target_temp_high: 74
        target:
          entity_id:
            - climate.bedroom_thermostat
            - climate.office_thermostat
  - if:
      - condition: trigger
        id:
          - Brian
    then:
      - action: climate.set_temperature
        metadata: {}
        data:
          hvac_mode: heat_cool
          target_temp_high: 74
          target_temp_low: 69
        target:
          entity_id:
            - climate.bedroom_thermostat
            - climate.office_thermostat
  - if:
      - condition: trigger
        id:
          - Morning
    then:
      - action: climate.set_temperature
        metadata: {}
        data:
          hvac_mode: heat_cool
          target_temp_high: 74
          target_temp_low: 69
        target:
          entity_id:
            - climate.bedroom_thermostat
            - climate.office_thermostat
  - if:
      - condition: trigger
        id:
          - Bedtime
    then:
      - action: climate.set_temperature
        metadata: {}
        data:
          hvac_mode: heat_cool
          target_temp_high: 64
          target_temp_low: 59
        target:
          entity_id:
            - climate.bedroom_thermostat
            - climate.office_thermostat
mode: single

The place to start this would be to just run one of the “then” blocks, without any conditions and without any “if,” to verify that you’re using the correct action.

At first glance, I think you’re overlooking that you need both a climate.set_temperature action and a climate.set_hvac_mode action, something like this:

      - action: climate.set_hvac_mode
        data:
          hvac_mode: heat_cool
        target:
          entity_id:
            - climate.bedroom_thermostat
            - climate.office_thermostat

      - action: climate.set_temperature
        data:
          target_temp_low: 67
          target_temp_high: 74
        target:
          entity_id:
            - climate.bedroom_thermostat
            - climate.office_thermostat

I don’t think you need the metadata.

Try running those actions directly and see if the thermostat does what you expect.

If not, could you confirm that after you wrote the YAML code, you reloaded the automations and didn’t see an error?

Does anything show up in Settings → System → Logs when you (1) reload automations, or when the set_hvac_mode and set_temperature actions run?

1 Like

It’s working!! Thank you so much for your help! I REALLY appreciate it and my wife thanks you lol!

Here’s the final YAML in case you’d like to use any of it for yourself.

alias: Thermostats - Winter
description: ""
triggers:
  - at: "05:30:00"
    id: Chan
    trigger: time
  - at: "06:30:00"
    id: Brian
    trigger: time
  - at: "19:30:00"
    id: Bedtime
    trigger: time
conditions: []
actions:
  - if:
      - condition: trigger
        id:
          - Chan
    then:
      - action: climate.set_hvac_mode
        metadata: {}
        data:
          hvac_mode: heat_cool
        target:
          entity_id:
            - climate.bedroom_thermostat
            - climate.office_thermostat
      - delay:
          hours: 0
          minutes: 0
          seconds: 5
      - action: climate.set_temperature
        metadata: {}
        data:
          hvac_mode: heat_cool
          target_temp_low: 67
          target_temp_high: 74
        target:
          entity_id:
            - climate.bedroom_thermostat
            - climate.office_thermostat
  - if:
      - condition: trigger
        id:
          - Brian
    then:
      - action: climate.set_hvac_mode
        metadata: {}
        data:
          hvac_mode: heat_cool
        target:
          entity_id:
            - climate.bedroom_thermostat
            - climate.office_thermostat
      - delay:
          hours: 0
          minutes: 0
          seconds: 5
      - action: climate.set_temperature
        metadata: {}
        data:
          hvac_mode: heat_cool
          target_temp_high: 74
          target_temp_low: 69
        target:
          entity_id:
            - climate.bedroom_thermostat
            - climate.office_thermostat
  - if:
      - condition: trigger
        id:
          - Bedtime
    then:
      - action: climate.set_hvac_mode
        metadata: {}
        data:
          hvac_mode: heat_cool
        target:
          entity_id:
            - climate.bedroom_thermostat
            - climate.office_thermostat
      - delay:
          hours: 0
          minutes: 0
          seconds: 5
      - action: climate.set_temperature
        metadata: {}
        data:
          hvac_mode: heat_cool
          target_temp_high: 64
          target_temp_low: 59
        target:
          entity_id:
            - climate.bedroom_thermostat
            - climate.office_thermostat
mode: single