Possible to use same trigger in multiple automations?

Is it possible to use the same one trigger in a few different automations? I have a door sensor that when triggered it needs to do different things based on different conditions.

Here is what I have now and wondering if there is a better way.

  1. Front door opens then turn on another group of lights if my template sensor for need indoor lights is true.
  2. Front door opens then turn on input_boolean if same input_boolean is off.
  3. Front door opens then flash a group of lights. No conditions.
  4. Front door opens then turn on the porch light only if it’s dark and the porch light is off.

I’m finding that not all automations are being triggered. For example, this morning it was dark out based on the sun condition before sunrise but 4 didn’t fire. 3 did. If I remove number 3 then 4 will work. That’s what makes me think I can’t use the same trigger for different automations.

I can post the code of my current automations if needed. I was just wondering how you all would handle something like I have.

I have not tested so many automations being triggered by the same event.

Alternatively you could make 4 scripts and call them from a single automation. If timing is not critical it could work ok

You can also use other alternatives, like node-red or appdaemon

Heck, I’m still trying to wrap my head around HA and automations. I’m not ready to dive in to nose-red or appdaemons yet.

I’m going to try looking at this from a different angle. Maybe I can combine things based on if it’s dark or not. Not sure but I think it’s timing that’s my problem. I don’t think the porch light came on because another condition is if the porch light is off but the porch light was turned on by the porch motion sensor.

1 Like

I have 4 automations triggered by my doorbell. I haven’t tested that all work simultaneously as that would involve me running between the ground floor and third floor to test it out, but I know that at least 3 work.

I have my lights flashing as one of my automations, and it works -but I do that via IFTTT.

If you try node-red you (probably) will not go back to yaml automations, but all the thinks you are asking can be done very easily in node-red, or with the solution to call multiple scripts.

Beware of overlapping automations, they can be very frustrating!

Good luck !

Would I be better off using conditions in the actions?

You can have up to a zillion automations triggered from the same state change. :wink: JK! As far as I know, there are no practical limits.

If you’re having issues with your automations, post them and we can all help you look for what might be wrong.

I’ve got a number of automations that share a common trigger, but have different conditions. You can absolutely do that.

Thanks guys. I didn’t think using the same trigger in multiple automations would be a problem. At the very least this helps me confirm where my actual problem is.

I’m using some old X10 stuff running heyu. I believe the problem is the delay in heyu sending the on commands and me using light on conditions. I have a porch motion sensor that also turns the porch light on at night but only if the light is off. The front door also turned the porch light on at night but only if the light was off. I think when heyu turned on the security lights (also x10) there was a delay in turning on the porch light. That delay is probably long enough for me to step outside and the motion sensor see the light was off and also send the command to turn on the light. This meant the porch light didn’t turn on till I was outside, closed the door and walking away.

I’ve simplified things for a test. Instead of one automation flashing the indoor security lights and disabling the chime anytime the front door is opened, I changed it to do it only during the day. Then I made a second to activate only at night that turns on the porch light, flashes the security lights and disables the chime.

This should turn the porch light on first which is more important (WAF), then the security lights and disable the chime. I ran these manually and they worked. I then reversed the automation conditions temporarily and triggered the front door sensor and it worked.

So now the real test will be tomorrow morning to see if I get yelled at again because the porch light didn’t turn on before she stepped outside.

If it doesn’t work it may be time to scrap the old X10 stuff and finish moving on.

Found my problem. For night I was using the sun condition with both before sunrise and after sunset checked. Well, that doesn’t work because it can’t be both at the same time.

I use the configurator in the frontend and forgot it only supports and for conditions. I originally used the sun condition in case I needed to use offsets. I’ll forgo the offsets for now and use the sun state below_horizon instead. Now it works perfect.

1 Like