If last triggered from specific sensors

Hi all!

Anyone knows how to do this?

Let’s say that I have 10 PIR sensors (sensor.bedroom_pir, sensor.kitchen_pir, sensor.living_pir and so on “all contains PIR as last word of entity”) and I want to make an automation which will run if the sensor is triggered, with the condition one if NOT the last sensor from these 10 PIR sensors, was last triggered.
So, the automation, should know what was the last triggered sensor only between these 10 PIR sensors.

Any idea?

Thank you in advance!

Put all 10 in one automation and call service to set an input_text with the name of the PIR.
Then in this automation you are talking about compare with the input_text

I don’t know if I’m fully understanding your question…

  • You have 10 motion sensors.
  • You want to trigger an automation when any of the sensors detects motion.
  • Don’t execute the action if a different sensor out these 10 detected motion recently.

If that is accurate…
Put all 10 sensors in a group, then use the group state to trigger your automation. The group state will turn “on” when a single sensor detects motion, but won’t turn off until all sensors stop detecting motion.