If AC is on for more than 30min, switch to eco

Hi, i thought of this automation, which it will set the preset mode of the aircondition to eco if it’s on for 30 minutes and set to default “none” preset mode.

alias: If AC is on for more than 30minutes, switch to eco
description: ""
trigger:
  - platform: state
    entity_id:
      - climate.midea_ac
    for:
      hours: 0
      minutes: 30
      seconds: 0
    to: cool
    attribute: hvac_modes
condition:
  - condition: state
    entity_id: climate.midea_ac
    attribute: preset_mode
    state: none
    for:
      hours: 0
      minutes: 30
      seconds: 0
action:
  - service: climate.set_preset_mode
    data:
      preset_mode: eco
    target:
      entity_id: climate.midea_ac
mode: single

i am doing something wrong though, the service part is good, when i run it manualy it sets the correct preset but with the trigger and condition i think i got it wrong… anybody can have a look?

Remove this:

That attribute is just a list of available modes. The actual current mode is the climate entity state. Which is what you will have once you remove that attribute.

1 Like

yeah my bad, thanks.

Anybody want’s can take advantage of the above.
I thought of that to lower electricity bill by setting your the aircondition to “eco” mode after 30 minutes running in the default preset mode. This way it get’s the room cool and then turns to the eco mode to save electricity.