Lockout attribute on switches to prevent automations from triggering

I was thinking that it would be interesting to have a lockout attribute / feature on switches so that if automations run they would be prevented from toggling a switch. This could be useful in many situations and could be used it automations itself. Not sure exactly how this could be implemented but curious if anyone has though of this already. Thanks

You can already shut automations off. Is that what you mean?
Automation YAML - Home Assistant.
Automation services - Home Assistant.

if the scenrio you want is to leave the automations enabled (maybe they do a bunch of other things) but just don’t want it to turn on/off a specific thing… perhaps you could use spook to disable the device. of course this works at the device level, not the entity level… i think the “normal” other way to do this is to create a template switch that wraps the real entity.

I’m dreading all the extra “why won’t my automation work?” posts.

1 Like

No, not to disable the automation but just the switch. In the gui maybe the switch state could show a lock on it indicating it is locked. Maybe if an automation runs and it fails because of the lockout that could trigger for example a notification using an if statement. Now that I’m thinking about this it could be more complicated than I thought origianlly.

Not to be rude, but I think you haven’t thought that through, didn’t you? :slight_smile: :laughing:

You at least need to describe, what you want to do with that “lock” feature. I’m not exactly sure what you mean, that’s why I’m asking, but I’m starting to get the feeling, you want something, that’s already possible. :slight_smile:

If you want to “leave out” a switch (aka locked), you can already do this in an automation by checking the state of said switch and react on it, eg. by using a condition inside the actions block. Or you disable the switch entirely by deactivating it.

Anyway, please describe what you want to achieve and how to get there! Take a daily life example to show, so it gets clearer, what you want. :slight_smile:

Thanks!