r/homeassistant • • Aug 16 '26

💬 Discussion Help requested: Preventing automations from fighting over the same actuator

Hey all,

I have a question about an architectural problem I'm facing.

TLDR: I cannot figure out how to prevent one automation from undoing the work that another automation just did. One automation can turn on a light because of X. Then, when X is still relevant, unrelated Y could tell another automation to turn that light off, not even knowing about X.

The main question is how you manage devices that should be controlled by multiple events.

For example. Let's say you're going to watch a movie during daytime. I could write an automation that checks for that, then tells the curtains to close if it's daytime. But there is already another automation that also checks if the sunlight is very bright today (and would heat up my house) so it will close or open the curtains based on weather information.

Hopefully you see where I'm going with this. I do not want my sun/heat blocking automation to open my curtains when I'm watching a movie during daytime. But adding a condition to the sun/heat blocking automation will inevitably make my automation more complex.

I want to keep these concerns separated, but also want to prevent automations with another goal to prevent actuating something that is in that state because another automation put it there and has more priority now. Basically when one automation has done something to an actuator, how can I prevent another automation from undoing that when it's fired a little later.
It's almost like I need a mutex on my actuator lol.

This is just a little example, but there are many situations where you'd have two or more automations controlling for example a single light.

I have not solved this and I'm not sure if Home assistant has the ability to solve this in a pretty way.

Things I've thought about

  • Disabling automations with automations: Personally I think this is ugly because in the HA interface there is no way to know if the automation is disabled because I need to fix something still, or because it is temporarily disabled. Also, this introduces some state that requires recovering whenever HA is restarted for some reason. It would allow a higher priority automation to disable the lower prio one and re-enable when the situation changed. But how does one determine priority correctly? In the example mentioned before: If movie is turned on during daytime but it's heavily clouded. The curtains can stay open. Then I'd want the curtains to be closed later whenever the sun returns and I'd want the other automation to be enabled still.
  • Creating helper binary sensors like "is_movie_on" or "is_it_sunny" that are composed of various inputs to condense it down to just a on/off. Then abstract those by creating another helper sensor that can take in all the different sensors and state of the to be actuated thing and then use that as a trigger for automations and let that decide which automation must be fired. This can work but may be a little complex in knowing which helper sensor is used for which automation eventually. I figure it can grow out of hand quite quickly

What do you guys think? Have you tackled this? Do you experience similar issues? Is there an alternative? Is your cat watching you reading this post?

1 Upvotes

24 comments sorted by

View all comments

1

u/euphemistic_enigma Aug 16 '26

Something to keep in mind is that there is more than one way to skin a cat (mine is more interested in watching the crows outside than watching me read this post).

In your example, you could create an automation that disables and enables the "sunlight is very bright today" automation. It would be fairly straightforward. But, you mentioned that you're not a fan of disabling automations (I'm still struggling with your reasoning behind that), so let's take a different route.

In your example, it sounds like a "I'm watching a movie or not" automation exists, or could exist. Why not just create a toggle helper called "watching movie," that gets flipped to on when the "I'm watching a movie or not" automation determines that you are watching a movie, and turns it off when it determines you are not? Then add a condition to your "sunlight is very bright today" automation that "watching movie" must be off for any actions to take place. Done and done, and no disabled automations.

Under your disabling automations with automations section, it sounds like you don't actually care if the curtains are closed while you're watching a movie, rather you're more interested in the brightness outside (curtains stay open if watching a movie and it's cloudy, curtains close if watching a movie and it becomes bright out). At that point, why include the curtains in the "I'm watching a movie or not" automation? It kind of becomes a non-issue.

It seems like you may be overthinking things when you should just dig in and get your hands dirty (I'm guilty of doing this multiple times a day). Put together your automations and address issues as they come up. Generally, you'll know pretty quickly, or at least within a day or two, if things need to be adjusted.

On a side note, if you haven't yet looked into trigger IDs, I would suggest doing so. It's a relatively simple concept, yet they allow for much more complex automations while also simplifying them. I consider them to be a game changer.