Turn this automation off

I’m trying to convert a few of my automations to blueprints so they aren’t duplicated many times - got them working aside from one issue. How do I refer to the automation itself? - e.g. can I read the automation’s entity_id into a variable?

At the end of the automation I want to turn that automation off.

Obviously can’t add it to the inputs as it doesn’t exist when you create it

e.g. something like this:- where this.id is replaced with the actual automations’s id?

  - service: automation.turn_off
    data: {}
    target:
      entity_id: > 
        {{ this.id }}

I don’t have an answer to your question, but if you want to turn off the automation after it ran, I’d think there is a flaw in the logic.

What are you trying to achieve?

Couple of different things…

The first is “When the outside temp is less than the inside, open the window”. This is triggered manually on heatwave days when we’ve deliberate chosen not to open the windows. Rather no go though all the extra steps of adding input helpers to drive this stuff.

The second is to get an alert when a device reaches a certain location, but never again until I choose to flip it on again - mainly do alert x when I get home / at the supermarket.

Simple when you know how - in the Blueprint I added the following action (as the last one) and this turns the Automation off when it runs.

  - service: automation.turn_off
    data: {}
    target:
      entity_id: > 
        {{ this.entity_id }}
1 Like