Trying to set Ecobee from Home to Away with Button Toggle

  1. Created boolean button with helper.
  2. Added the button to a dashboard which basically does:
    entity: input_boolean.toggle_ecobee_from_home_to_away when pressed.
  3. Created an automation to turn both thermostats to away mode when toggled. I’ve tried using climate.set_away_mode and climate.set_preset_mode. Both give errors:
alias: Ecobee AC Away Mode - Turn On
description: Ecobee AC Away Mode - Turn On with button
trigger:
  - platform: state
    entity_id: input_boolean.toggle_ecobee_from_home_to_away
    to: "on"
action:
  - service: climate.set_preset_mode
    data:
      entity_id: climate.upstairs
      away_mode: "on"
  - service: climate.set_preset_mode
    data:
      entity_id: climate.main_floor
      away_mode: "on"

But when I press the toggle, the mode shown on the Ecobee card does not change. In fact, it throws the error:

The automation “Ecobee AC Away Mode - Turn On” (automation.ecobee_from_home_to_away_mode) has an action that calls an unknown service: climate.set_away_mode

Does anyone have any suggestions as to why this might not be working?

Also, there must be a more elegant way than writing a second automation to turn it off when switch moved to off postion.

After reading a bit, I found some success. I find that the climate wording has changed. So changed the syntax to:

alias: Ecobee AC Away Mode - Turn On
description: Ecobee AC Away Mode - Turn On with button
trigger:
  - platform: state
    entity_id: input_boolean.toggle_ecobee_from_home_to_away
    to: "on"
action:
  - service: climate.set_preset_mode
    data:
      entity_id: climate.upstairs
      preset_mode: away
  - service: climate.set_preset_mode
    data:
      entity_id: climate.main_floor
      preset_mode: away

And it works. But having two automations, one for the boolean changing off to one, and one for on to off isn’t very elegant. Any solution in ONE automation?