Help with Template Trigger and multiple entities

Hello,

I need help with a template trigger:

I have a few sensors and if one of those sensors is =<0 the automation should trigger

{{states(“sensor.roborock_s4_max_filter_left”)|int <=0 or
states(“sensor.roborock_s4_max_sensor_dirty_left”)|int <=0 or states(“sensor.roborock_s4_max_side_brush_left”)|int <=0 or states(“sensor.roborock_s4_max_main_brush_left”)|int <=0}}

I have a template like above, but it listens only for the first two entities (probably bc of the OR operator), if i split the template into two it works.

Is there a method to listen to all entities and check if one is <=0 without grouping?
I do not want to group the entities because i would like to know the trigger-entitity for the rest of the automation (or is this still possibly by grouping?)

Is there a way to template multiple entities with OR like i tried?

thanks for helping in advance

Edit: This template works like expected, but it stops to listen to all the following entities after the entity that is true - thanks 123

While that should be possible, isn’t it easier (since it’s only 4) to just make 4 triggers (one for each sensor state = 0), give each one a trigger_id, and then do your automation which includes the trigger_id in the notification (or whatever)?

No trigger template :slight_smile:

I would try to use a condition before actions

It listens to all four entities.

The template has four logically ORed tests which it evaluates in the order they’re written. Whichever one of the four tests evaluates to true will cause the template to cease evaluating the other tests.

So if the first test is false and the second test is true, it won’t evaluate the third and fourth tests. That’s the way logically ORed tests are evaluated.

It always “works”, grouped or not, so you’ll have to define what you mean by “works”.

Clearly you’re after some sort of specific outcome. Is it to ensure all four tests are evaluated even if it’s not necessary to determine if one of them is true?

As @antonio1475 suggests, I personally dont see the need to template here either. Is there a specific reason you want to template instead of simply using 4 triggers?

If using 4 triggers instead then the trigger information would be available to the automation anyway!

thanks! thats the info i needed!!
bc in it only listened to the first 2 entities in the template editor (bc the 2nd entity was true)

Thanks very much and no it can stop the template if only 1 is true

yeah thats also valid, thanks!