Hi,
I’m struggling…
I have setup two rules that seem to be the same to me. One is working, the other is not.
I have two contact groups for windows (G_windows) and doors (G_Doors) (Yes, one uppercase, one lowercase…):
The groups work correctly.
If I open a door or a window, the icon immediately changes from closed to open, if at least one door/window is open.
So far so good.
I added two settings items and two rules to send notifications, when doors/windows are opened as follows.
For the windows:
val mailActions = getActions("mail","mail:smtp:XXX")
rule "Window Monitor"
when Member of G_windows changed from CLOSED to OPEN
then
logInfo("Windows", "Fenster " + triggeringItem.label + " wurde geöffnet. (Notifications: " + Settings_WindowNotifications.state + ")")
if (Settings_WindowNotifications.state == ON) {
var report = ""
G_windows.allMembers.filter([state == OPEN]).forEach([ContactItem item | report = report + "\n" + item.label ])
val message = "Diese Fenster sind geöffnet:\n" + report
mailActions.sendMail("me@...", "Fenster " + triggeringItem.label + " wurde geöffnet", message)
pushsafer("...", message, "Fenster " + triggeringItem.label + " wurde geöffnet", "", "81", "", "")
}
end
For the doors:
val mailActions = getActions("mail","mail:smtp:XXX")
rule "Door Monitor"
when Member of G_Doors changed from CLOSED to OPEN
then
logInfo("Doors", "Tür " + triggeringItem.label + " wurde geöffnet. (Notifcations: " + Settings_DoorNotifications.state + ")")
if (Settings_DoorNotifications.state == ON){
var report = ""
G_Doors.allMembers.filter([state == OPEN]).forEach([ContactItem item | report = report + "\n" + item.label ])
val message = "Diese Türen sind geöffnet:\n" + report
mailActions.sendMail("me@,,,", "Tür " + triggeringItem.label + " wurde geöffnet", message)
pushsafer("...", message, "Tür " + triggeringItem.label + " wurde geöffnet", "", "81", "", "")
}
end
Both settings that configure, whether notifications should be sent or not are set to true
When I open a window, I get both the pushsafer notification, as well as the mail.
As well, the initial logInfo is added.
When I open a door nothing happens at all.
Not even the initial logInfo message.
To me, the rules look exactly the same.
The G_doors group itself is working, as the icon changes as soon as the first door is opened.
I’m out of ideas
Can someone see, what I have overlooked???
Thanks a lot for your help!