Anpassung der letzten Tage
This commit is contained in:
@ -1,13 +1,21 @@
|
||||
rule "DWD Warnungen"
|
||||
rule "Abruf Dienste"
|
||||
when
|
||||
//Time cron "0 */30 * ? * *" //every 30 Minutes
|
||||
Time cron "0 * * ? * *" //every 1 Minute
|
||||
// Time cron "0 * * ? * *" or
|
||||
Time cron "0 0 19 ? * MON-FRI" or
|
||||
Time cron "0 0 7 ? * SAT,SUN"
|
||||
then
|
||||
logInfo("HTTPGET", "Abfragr Erfolgt")
|
||||
logInfo("HTTPGET", "Abfrage Erfolgt")
|
||||
sendPushoverMessage(pushoverBuilder("Abfrage Erfolgt").withSound("siren").withUser("u8s32g4yym8xbk7yqn66cokjys13mf"))
|
||||
var String jsonString = sendHttpGetRequest("https://fms.ffhstm.de/dienste_lesen_json.php")
|
||||
postUpdate(FFDienstZVD,transform("JSONPATH", "$.DIENSTE.C", jsonString))
|
||||
postUpdate(FFDienstIUK2,transform("JSONPATH", "$.DIENSTE.D", jsonString))
|
||||
// postUpdate(FFDienstIUK3,transform("JSONPATH", "$.DIENSTE.F", jsonString))
|
||||
postUpdate(FFDienstIUK3,transform("JSONPATH", "$.DIENSTE.E", jsonString))
|
||||
var String IUKN = transform("JSONPATH", "$.DIENSTE.F", jsonString)
|
||||
if (!IUKN.contains("DIENSTE")) {
|
||||
postUpdate(FFDienstIUKN,IUKN)
|
||||
} else {
|
||||
postUpdate(FFDienstIUKN,"")
|
||||
}
|
||||
|
||||
postUpdate(FFSperrungen,transform("JSONPATH", "$.SPERRUNG", jsonString))
|
||||
end
|
||||
|
@ -2,7 +2,7 @@ import java.util.concurrent.locks.ReentrantLock
|
||||
var ReentrantLock lockState = new ReentrantLock()
|
||||
var Timer FFAlarmTimer = null
|
||||
|
||||
rule "FFAlarmRuleJSON"
|
||||
rule "Auswertung Alarm JSON"
|
||||
when
|
||||
Item FFAlarmJSON changed
|
||||
then
|
||||
@ -38,31 +38,59 @@ then
|
||||
postUpdate(FFAlarmTrigger,transform("JSONPATH","$.AlarmTrigger",FFAlarmJSON.state.toString))
|
||||
end
|
||||
|
||||
rule "FFAlarmTrigger OF"
|
||||
rule "FFR Alarm Logik"
|
||||
when
|
||||
Item FFAlarmTrigger changed to ON
|
||||
then
|
||||
postUpdate(FHZPush,"ON")
|
||||
postUpdate(REMCAM001Record,"ON")
|
||||
postUpdate(REMCAM002Record,"ON")
|
||||
FFAlarmTimer = createTimer(now.plusMinutes(60)) [|
|
||||
postUpdate(FFAlarmTrigger,"OFF")
|
||||
postUpdate(FHZPush,"OFF")
|
||||
postUpdate(REMCAM001Record,"OFF")
|
||||
postUpdate(REMCAM002Record,"OFF")
|
||||
FFAlarmTimer.cancel()
|
||||
FFAlarmTimer = null
|
||||
]
|
||||
if (FFRAlarmTimer === null) {
|
||||
postUpdate(FFAlarmView,"ON")
|
||||
postUpdate(FHZPush,"ON")
|
||||
postUpdate(REMCAM001Record,"ON")
|
||||
postUpdate(REMCAM002Record,"ON")
|
||||
FFAlarmTimer = createTimer(now.plusMinutes(60)) [|
|
||||
postUpdate(FFAlarmTrigger,"OFF")
|
||||
postUpdate(FHZPush,"OFF")
|
||||
postUpdate(REMCAM001Record,"OFF")
|
||||
postUpdate(REMCAM002Record,"OFF")
|
||||
FFAlarmTimer.cancel()
|
||||
FFAlarmTimer = null
|
||||
]
|
||||
}
|
||||
end
|
||||
|
||||
rule "FFAlarmTrigger OF"
|
||||
rule "FFAlarmTrigger OFF"
|
||||
when
|
||||
Item FFAlarmTrigger changed to OFF
|
||||
then
|
||||
postUpdate(FHZPush,"OFF")
|
||||
postUpdate(FFAlarmView,"OFF")
|
||||
end
|
||||
|
||||
rule "Fahrzeug Status 3"
|
||||
rule "Alarmschleifen Auswertung"
|
||||
when
|
||||
Item FFAlarmSchleife received update
|
||||
then
|
||||
logInfo("Alarmschleife", "Alarmschleife wurde aktualisiert")
|
||||
switch(FFAlarmSchleife.state.toString) {
|
||||
case "57459": {
|
||||
logInfo("Alarmschleife", "Vollalarm Rembrücken und Heusenstamm")
|
||||
postUpdate(FFAlarmTrigger,"ON")
|
||||
sendPushoverMessage(pushoverBuilder("Vollalarm Rembrücken und Heusenstamm").withSound("siren").withPriority(1))
|
||||
}
|
||||
case "57449": {
|
||||
logInfo("Alarmschleife", "Einsatz für den ELW")
|
||||
postUpdate(FFAlarmTrigger,"ON")
|
||||
sendPushoverMessage(pushoverBuilder("Einsatz für den ELW").withSound("siren").withPriority(1))
|
||||
}
|
||||
case "57455": {
|
||||
logInfo("Alarmschleife", "Vollalarm Rembrücken")
|
||||
postUpdate(FFAlarmTrigger,"ON")
|
||||
sendPushoverMessage(pushoverBuilder("Vollalarm Rembrücken").withSound("siren").withPriority(1))
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
rule "Push Fahrzeugstatus"
|
||||
when
|
||||
Member of gFHZ changed
|
||||
then
|
||||
@ -73,14 +101,18 @@ if (!lockState.isLocked) {
|
||||
logInfo("Testing","gNetwork received update")
|
||||
val member = gFHZ.members.filter[d | d.lastUpdate("jdbc") !== null].sortBy[lastUpdate("jdbc")].last
|
||||
val name = member.label.toString
|
||||
if (FFAlarmTrigger.state == ON && FHZPush.state == ON && member.state.toString == "3") {
|
||||
if (FFAlarmTrigger.state == ON && member.state.toString == "3") {
|
||||
logInfo("GroupTest", "Member "+ name +" to " + member.state )
|
||||
sendPushoverMessage(pushoverBuilder(name + " ist aus zur E-Stelle").withSound("siren").withUser("upgb55kps8rx2xotn7dvdg3w2yjpt6"))
|
||||
if (FHZPush.state == ON && member.state.toString == "3") {
|
||||
sendPushoverMessage(pushoverBuilder(name + " ist aus zur E-Stelle").withSound("siren").withUser("upgb55kps8rx2xotn7dvdg3w2yjpt6"))
|
||||
}
|
||||
sendPushoverMessage(pushoverBuilder(name + " ist aus zur E-Stelle").withSound("siren").withUser("u8s32g4yym8xbk7yqn66cokjys13mf"))
|
||||
}
|
||||
if (FFAlarmTrigger.state == ON && FHZPush.state == ON && member.state.toString == "4") {
|
||||
if (FFAlarmTrigger.state == ON && member.state.toString == "4") {
|
||||
logInfo("GroupTest", "Member "+ name +" to " + member.state )
|
||||
sendPushoverMessage(pushoverBuilder(name + " an der E-Stelle angekommen").withSound("siren").withUser("upgb55kps8rx2xotn7dvdg3w2yjpt6"))
|
||||
if (FHZPush.state == ON && member.state.toString == "4") {
|
||||
sendPushoverMessage(pushoverBuilder(name + " an der E-Stelle angekommen").withSound("siren").withUser("upgb55kps8rx2xotn7dvdg3w2yjpt6"))
|
||||
}
|
||||
sendPushoverMessage(pushoverBuilder(name + " an der E-Stelle angekommen").withSound("siren").withUser("u8s32g4yym8xbk7yqn66cokjys13mf"))
|
||||
}
|
||||
} finally {
|
||||
|
Reference in New Issue
Block a user