Ist ja nur eine Info und sowas ignoriert man doch einfach, oder?
Code: Alles auswählen
2020-02-25 22:58:19.961 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'MQTT.rules', using it anyway:
List is a raw type. References to generic type List<E> should be parameterized
Unreachable expression.
Code: Alles auswählen
import java.util.List
var List timers = newArrayList
var Timer shutoffTimer = null
var lastRun = now.minusMinutes(2)
rule "Sonbas Motion changed from OFF to ON 3 times in a minute"
when
Member of gBW changed from OFF to ON
then
if(AlarmAussen.state == OFF) {
logInfo("bw_alarm","Alarmanlage aus, Rule Ende!")
return;
val mailActions = getActions("mail","mail:smtp:c1a3d968")
mailActions.sendMail("xxx@gmail.com","Alarm "+ triggeringItem.name, "Bewegungsmelder " + triggeringItem.name.toString + " hat ausgelöst")
}
if(shutoffTimer !== null) {
logInfo("bw_alarm","Alarm schon aktiv, Rule Ende!")
return;
}
if(lastRun.isAfter(now.minusMinutes(2))) {
logInfo("bw_alarm","letzter Alarm vor weniger als 2 Minuten, Rule Ende!")
return;
}
if(timers.size < 3) {
val t = createTimer(now.plusMinutes(1), [ |
timers.remove(0) ] )
timers.add(t)
}
if(timers.size == 3) {
val mailActions = getActions("mail","mail:smtp:c1a3d968")
mailActions.sendMail("xxx@gmail.com","Sirene aktiviert ", "Sirene wurde aktiviert")
Steckdose54.sendCommand(ON)
lastRun = now
while(timers.size > 0) {
timers.get(0).cancel
timers.remove(0)
}
shutoffTimer = createTimer(now.plusSeconds(10)) [|
Steckdose54.sendCommand(OFF)
logInfo("Alarmrule", "Sirene Ende")
shutoffTimer = null
]
}
end