#Sync status of doors to status light

1 messages · Page 1 of 1 (latest)

rustic coyote
#

Hello!

I am still relatively new to HA, but I do have some moderate programming background/experience, so please feel free to use slightly more technical concepts.

I've been messing around with automations, and while I understand the conceptuality of what I want to do, I'm struggling to understand the syntax and context of how HA wants me to accomplish this.

For the sake of simplicity, I have two doors and a single RGB "status light" I am attempting to sync together based on the states of the doors. If both of the doors are open, I want the light to be red, if only one is open, set a color for those doors individually, and if both are closed, turn the light off. Currently, I have this working using building blocks and individual state checking based on each door but this feels messy, is several separate automations, and often desyncs with itself. It is my understand that I should be able to set up some kind of custom sensor with states (using Helpers?), such as 1-4, to combine the various states of other entities. I haven't been able to get it to actually work, and the UI for setting things up is a bit confusing when you don't already know the exact term/method you're looking for.

As an aside, my status light is the LED bar on one of my Inovelli switches, and I'd also like some kind of monitoring if it gets turned off for any reason to be able to check the status of the doors without one of their states requiring a change, if possible. A quirk of the switch seems to be any of the multi-tap inputs will just turn off the LED bar, which is kind of annoying.

random jay
#

Everything in HA is based on something occuring. In some cases you don’t really need to think about it in that way, but under the hood everything is structured that way.

If you want to do this all in a single automation (with no helper entities) you’d need to think about all the various things that could happen that could cause the LED to change. That would be:

  • door 1 opens or closes
  • door 2 opens or closes
  • led turns off
  • (maybe?) HA starts up

Those would each be added as triggers to the automation.

Then in the actions section you can use a choose action to configure the conditions under which the led should change. Option one could have the conditions:

  • door 1 is open
  • door 2 is open
    And then the actions for that option 1 would be
  • turn on light to red color
rustic coyote
#

That all matches my understanding, but the part I'm struggling with is how to combine all that in to a single coherent automation that doesn't rely on 3 separate configurations. Is it far to say that triggers are all "independant" and I can just stack as many as I want?

tiny scarab