#Automation toggle with another automation - Review please?

1 messages · Page 1 of 1 (latest)

gritty kayak
#

I have just made an automation which allows me to turn on and off another automation and indicates the set state using a light. I do not like how I have to create a temporary scene which then gets deleted, so was wondering if there's a better way of achieving this?

solemn apex
#

Can you post the yaml on dpaste.org? I can’t open this on mobile.

cedar pier
#

If you want to be able to restore the light state as before the indication then there is no easier way then to use a scene.
And personally I'm not a fan of turning on/off an automation by an automation. I rather use a helper and leave turning on/off the automation as a final manual override in case I need it.

vale prairie
# gritty kayak I have just made an automation which allows me to turn on and off another automa...

Just don't turn automatons on and off. That usually goes badly Automatons have triggers and conditions. They are there to make the listed actions happen or not. If you are trying to run actions on demand that are stored outside of your automation, that's called a script. Scripts are a thing with their own GUI editor and are basically an automation WITHOUT a trigger. Those run when you tell them to run. Use that instead.
Another comment, you are creating a scene on the fly. There should be no need to delete it. Scenes created by scene.create will delete themselves when HA restarts.
Personally I use a random scene name for things like this to make sure the old data is gone, but what you have here can work if you keep the mode as single.
https://community.home-assistant.io/t/creating-unique-names-for-scene-create-persistant-notification-or-anything-else/742873