Dynamic Alarmtext

I guys,

i have all my window contacts in one Group called F_Kontakt.

Now i want to use the window contacts for my alarmsystem.

So i made a rule which works fine:

rule "Alarmanlage"
	when
		
		Item F_Kontakt changed to OPEN
		
	then	
	    if (Alarmanlage.state == ON) {
	    sendMail("email@address.com", " ALARM", "Alarm")
	logInfo("ALARM","ALARM")}
		
end

Is it possibe, to insert the item Name of the contact in the alarmtext which chanded to open?
So i would be able to see which of my contacts triggerd the Alarm

Thx
Vaillan

You’ll want to look into triggering a rule from Member of and then using triggeringItem.name within the rule

Here’s a topic with several links that will help with your rules.

So you mean like this?

rule "Alarmanlage"
	when
		
		member of F_Kontakt changed to OPEN
		
	then	
	    if (Alarmanlage.state == ON) {
	    sendMail("email@address.com", " ALARM", "triggeringItem.name Alarm")
	logInfo("ALARM","ALARM")}
		
end

:woozy_face:

Nearly, but you want to evaluate the item.name term, not send the string “triggeringItem.name”

sendMail("email@address.com", " ALARM ", triggeringItem.name + " Alarm")
logInfo("ALARM", "ALARM " + triggeringItem.name)