How to create automation to set ecobee away mode on?

I am creating an automation in which I would like to set my ecobee away mode on. I am good with setting up a trigger. What I don’t know is what I would need in the action in order to set an ecobee to away mode. Can anyone be so kind as to provide some sample code?

I don’t have Ecobee’s but something like this:

- service: climate.set_away_mode
  data:
    entity_id: climate.downstairs
    away_mode: 'True'
1 Like

I can confirm above post is correct …here is a example from my config https://github.com/Vasiley/Home-Assistant-Main/blob/master/packages/mode_main_away.yaml#L79

1 Like

Thank you both for your help!

np glad too

Because you were so much help, I am hoping you can be of assistance one more time to help me take this to the next level. With your help, I configured an input_boolean to set two Ecobee thermostats to away mode when it turns on. To turn off away mode for the thermostats, I know I can duplicate the same and change it to “off”. But I’m pretty certain there is a cleaner way that I can write this one single time for both the on and off actions, using toggle rather than on/off. Any ideas how I would write that?

- id: ac_away_mode_turn_on
  alias: 'AC Away Mode - Turn On'
  trigger:
    - platform: state
      entity_id: input_boolean.ac_away_mode_boolean
      to: 'on'
  action:
    - service: climate.set_away_mode
      data:
        entity_id: climate.upstairs_ecobee
        away_mode: 'on'
    - service: climate.set_away_mode
      data:
        entity_id: climate.downstairs_ecobee
        away_mode: 'on'

action:
- service: climate.set_away_mode
data_template:
entity_id:
- climate.upstairs_ecobee
- climate.downstairs_ecobee
away_mode: >-
{% if is_state(“input_boolean.ac_away_mode_boolean”, “on”) %}
‘on’
{% elif is_state(“input_boolean.ac_away_mode_boolean”, “off”) %}
‘off’
{% else %}
‘off’
{% endif %}

but i have been drinking on and off prolly doesnt need quotes i would test in template editor

1 Like

spacing is off of course i never get that right LOL

Thanks for sharing your experience. I found your codes very helpful.

Hey there!
Why are you calling both climate.set_away_mode and climate.set_hold_mode?

I was always of the understanding that climate.away_mode was used to place the thermostat into away and it would not follow the next scheduled event VS climate.set_hold_mode would set the thermostat to away and the next scheduled event would execute…Is that not correct?

set away is a programmed mode in ecobee and set hold basically is the same …i have ha setting modes that the thermostat will not override …basically i program modes in thermo and ha sets them

I tested the statement that I made above, and verified that:
Setting climate.away_mode: 'on' places the thermostat into away, ignoring the next scheduled event.
Setting climate.set_hold_mode sets the thermostat to away (or whatever mode is chosen) and holds only until the next scheduled event.

So for the example you linked, you are setting away mode to on and then setting it to hold immediately after, which is not necessary.

I’d like to set the thermostat to never change on schedule and only allow HA to control modes, but unfortunately, Ecobee has a tough time keeping the 3rd party API available and often has outages which prevent HA from controlling it. I used to complain about this a lot (and still hate cloud API’s) but then I saw what Nest did to their customers lol.

well mine works fine …ha always set the correct mode

been years since i set up but ecobee never sets the mode Ha always does

I know you asked about setting a specific mode of “away” or “not_away”, but you may also find it easier, depending on your use case, to just make the Ecobee resume its normal program using:

- service: climate.ecobee_resume_program

FYI…

1 Like

I didn’t follow the group in my path but with some research came up with an action of

    - service: climate.set_preset_mode
      data:
        entity_id: climate.dining_room_2
        preset_mode: 'Away'

This put the ecobee in away mode but it says away until 10:00. That is when my ecobee switches to sleep mode. How would I override that? Technically I thought when you “manually” change the ecobee it no longer ran it’s programming until you told it to.

And for reference to resume back to it’s standard programming I did:

    - service: ecobee.resume_program
      data:
        entity_id: climate.dining_room_2
        resume_all: true

Thanks.

JR

EDIT: Is that even possible that away in lowercase puts a hold and Away with an uppercase A sets away until the next activity hits? What I’m seeing right now.

2 Likes

Fast forward to 2024.
There are no more Developer’s Accounts for Ecobee…

Does anyone know how this can be done with the HomeKit integration,
which is now our only option?