Help for a rule

for a rule with many “when” possibilities I am looking to find out which of these WHEN statements actually became TRUE .

Is there a simple way? ( I would compare all items again below and write the “True” one to a string. But thats probably not a elegant way?)

rule "Mail Notification"
	Item zwave_device_node11_sensor_door changed to OPEN or		
	Item zwave_device_node18_sensor_binary changed to ON	or
	Item zwave_device_node9_sensor_binary changed to ON
				sendMail ("", "ALARM", "Wegen " + REASONFROMABOVE )


thanks for hints :slight_smile:

There is no simple way.

If you have persistence set up and saving each of these Items you can compare their lastUpdate.

var doorLU = zwave_device_node11_sensor_door.lastUpdate
var node18 = zwave_device_node18_sensor_binary.lastUpdate 
var node9 = zwave_device_node9_sensor_binary.lastUpdate
if(doorLU.isAfter(node18) && doorLU.isAfter(node9)) {
    // doorLU is most recently updated so its what triggered the rule
} else if ...