Postpone a time-triggered automation

Hi,

I have an automation that at 5am triggers, and turns on the air conditioner for one hour, turning off after that.
The automation works fine, but sometimes, like today, I woke up before 5am and I would like to not run the automation, something like postpone for the next run, tomorrow, but I couldn’t find the option.
What I did today was triggering the automation earlier and then turn off the air conditioner manually, which maybe is suboptimal since I still have to turn on the air.
Anyone knows anyway to cancel the execution just a single time?
Perhaps we could think about a new feature to cancel or postpone time-based execution, which could also have integration with the assistant, like “cancel ac automation”, or “postpone ac automation”.

Please let me hear your thoughts.

Make a new script to turn off the other automation for 1hr then wait for 1hr and turn the other automation back on. Itll work fine unless HA gets restarted during that hour.
If you are worried about HA being restarted during that time you can use an automation to turn on the aircon automation on restart. Pretty soon it’ll be automations all the way down.

I’m using an automation. There is an option to postpone if I’m using a script or a scene?

Get a bed occupancy sensor and put a condition in your automation to only run if the bed is occupied.

Perhaps you could show your automation. If your trigger is 05:00 then you only need to turn the automation off for 1 min

I would add a boolean as condition.
Or you could be smart about it and have the boolean as a choose.
If the automation triggers and the boolean it true then don’t run the AC but turn off the boolean.

1 Like

Here is my automation:

id: '1749759740901'
alias: Ligar ar-condicionado para acordar
description: ''
triggers:
  - trigger: time_pattern
    hours: '5'
    minutes: '0'
    seconds: '0'
conditions:
  - condition: device
    type: is_off
    device_id: d7373b97efbfe7343ef4bdf5f09109ee
    entity_id: 57c807a07969c96d1eea06bd9dd15ba1
    domain: switch
actions:
  - action: climate.set_temperature
    metadata: {}
    data:
      temperature: 21
      hvac_mode: heat
    target:
      area_id: bedroom
      device_id: d7373b97efbfe7343ef4bdf5f09109ee
  - delay:
      hours: 1
      minutes: 0
      seconds: 0
      milliseconds: 0
  - action: climate.turn_off
    metadata: {}
    data: {}
    target:
      area_id: bedroom
      device_id: d7373b97efbfe7343ef4bdf5f09109ee
mode: single

Well that’s not ideal for a start. Do this instead:

triggers:
  - trigger: time
    at: "0:500"

This is also not best practice:

  - delay:
      hours: 1
      minutes: 0
      seconds: 0
      milliseconds: 0

Do not wait in automations for extended periods of time. They can be interrupted, leaving your entities in unwanted states.

Use a 6am time trigger to turn it off instead.

Done.

alias: Ligar ar-condicionado para acordar
description: ""
triggers:
  - trigger: time
    at: "05:00:00"
conditions:

And the new automation:

alias: Desligar o ar depois de 1h
description: ""
triggers:
  - trigger: time
    at: "06:00:00"
conditions:
  - condition: device
    type: is_on
    device_id: d7373b97efbfe7343ef4bdf5f09109ee
    entity_id: 57c807a07969c96d1eea06bd9dd15ba1
    domain: switch
actions:
  - type: turn_off
    device_id: d7373b97efbfe7343ef4bdf5f09109ee
    entity_id: 57c807a07969c96d1eea06bd9dd15ba1
    domain: switch
mode: single

I would do something like this.
Add a boolean that you can toggle on the dashboard and this will reset it if turned on.

alias: Ligar ar-condicionado para acordar
description: ""
triggers:
  - trigger: time
    at: "05:00"
    id: "on"
  - trigger: time
    at: "06:00"
    id: "off"
conditions: []
actions:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.postpone
            state: "on"
        sequence:
          - action: input_boolean.turn_off
            metadata: {}
            data: {}
            target:
              entity_id: input_boolean.postpone
    default:
      - choose:
          - conditions:
              - condition: trigger
                id: "on"
            sequence:
              - action: climate.set_temperature
                metadata: {}
                data:
                  temperature: 21
                  hvac_mode: heat
                target:
                  area_id: bedroom
                  device_id: d7373b97efbfe7343ef4bdf5f09109ee
          - conditions:
              - condition: trigger
                id: "off"
            sequence:
              - action: climate.turn_off
                metadata: {}
                data: {}
                target:
                  area_id: bedroom
                  device_id: d7373b97efbfe7343ef4bdf5f09109ee
mode: single

I think it will work. It’s untested.
I would recommend you keep your automation and just disable it, and add this as a new to test

Don’t specify the seconds. It can (rarely) cause issues. Just: at: "05:00"

Ok. I was using the GUI to create the automation. I will change.

Maybe it works if I keep two automations as suggested, one to turn on, and put the boolean in it, and other to turn off that checks if the ac is on, which I already did.
The problem is: if I turn off the boolean and forget to turn on again for the next day?

I will need a new automation that changes the boolean value after a couple hours.

I’m thinking that a way to single-time cancel a time based automation can be useful, but I don’t know for sure how complex could be developing that.
I think Google Home allows you to cancel an automation without disabling, but I chose put the automation in HA because it can work without Internet (in theory).

The automation I posted is self contained and will reset the boolean by itself every day.
That can of course be changed.
How are you thinking this should work?
Your post lead me to believe it was a one time thing.
If you need longer periods of off time then a schedule helper might be good. Or calendar for even longer periods.

You got it. It’s one-time thing.
Imagine that, like today, I woke up before 5am, and I don’t need the ac turning on, since I turn on to heat the bedroom and make easier to get up, but tomorrow maybe I will wake up after 5am and I need the ac on.

What do you think?

I believe the automation I posted will work then.
You could add a bed sensor to automate the boolean part of it too.

You could automate it based on temperature or humidity rather than deciding when you wake.

I tested with postpone on (it didn’t started AC), in some minutes I will test with postpone off (so should start the AC).

I could, if I had a better temperature sensor than the one present in the AC, but my goal is wake up around this time. Maybe when I start waking up at 5am I will change the start to 4:30am.

The first part worked.
It starts the AC, unless Postpone is enabled. In this case it won’t start.
Now I’m thinking about the turn off option.
It should turn off after one hour just when the air was turned on by the automation, like if I start by myself, I don’t want to turn off.
If we had a cancel option, all the automation would be temporarily turned off so the turn off part wouldn’t happen.
Maybe a second boolean that defines if the AC was turned on manually or using automation?