Service call: automation.delete

Occasionaly I want to have an automation that runs only once. For example.:

You go out to dinner and know you’ll be home at 21:00 - Set an action at 20:30 so you return to a warm house
Send a reminder in 1 hour to check the oven

Effectively, the automation should run and then remove itself.

A blueprint (e.g. Wth: one shot timer - #16 by 123) can be used to do most of the job. What is missing is a way to ‘remove itself’.

For this, I propose adding a service call automation.delete.

You probably have your use case but I don’t get the point.
So next time you go for diner, you’ll recreate a new automation?
You’re not going out very often :slight_smile:

Is it that bugging you that the automation remain but just disabled?
At the end of the automation, you can just call the service

service: automation.turn_off
      data: {}
      target:
        entity_id: automation.my_automation_when_I_go_out

Therefore, next time, you can enable it with a toggle switch and take an input_datetime helper to adjust the time you come back home, or even better, the device_tracker that detect that you’re back within X miles from home.

I think you’re missing the whole point of ‘one time’.
There is no ‘next time’ in a forseeable future so why bother with disabled automations?

1 Like

I got it, don’t be harsh.

My thoughts are that creating an automation for a one time run is time consuming and I’d be happy to keep it “just in case”.
I would find as easy to delete it manually when I really doesn’t need it anymore, ever.
It would not require more time than to add the action to delete the automation at the end anyway.

Only benefits would be to have a “clean” list of automations but as I’m never looking there, it can be a mess, I don’t care.

By contrast, having Automations & Scenes to open without the disabled automations (like in the Devices & Services tab) would definitely get my vote.

I was just looking for this same feature today. I went out of town for two days and armed my alarm. Someone is coming to my house tomorrow at 7am to do some work so I need the alarm to turn off at 7am then I have no need for the automation. It would be nice to have an automation.delete service.

2 Likes