diff --git a/items/HTTP.items b/items/HTTP.items index 76da364..7d954d1 100644 --- a/items/HTTP.items +++ b/items/HTTP.items @@ -1,2 +1,2 @@ -String REMCAM001Record "Aufzeichnung Starten" (gHistory) { http="<[http://10.112.30.31/control/control?read§ion=recording&recording_activ{Authorization=Basic YWRtaW46cnQ4cWZmOHBwa21hODJienhxMnZjeTNtMw==}:60000:REGEX(recording_activ=(.*))] >[enable:GET:http://10.112.30.31/control/control?set§ion=recording&recording_activ=enable{Authorization=Basic YWRtaW46cnQ4cWZmOHBwa21hODJienhxMnZjeTNtMw==}] >[disable:GET:http://10.112.30.31/control/control?set§ion=recording&recording_activ=disable{Authorization=Basic YWRtaW46cnQ4cWZmOHBwa21hODJienhxMnZjeTNtMw==}]" } -String REMCAM002Record "Aufzeichnung Starten" (gHistory) { http="<[http://10.112.30.32/control/control?read§ion=recording&recording_activ{Authorization=Basic YWRtaW46cGRncWE2MnY0ZjRiZDl0cm12cDd6N3Q4OA==}:60000:REGEX(recording_activ=(.*))] >[enable:GET:http://10.112.30.32/control/control?set§ion=recording&recording_activ=enable{Authorization=Basic YWRtaW46cGRncWE2MnY0ZjRiZDl0cm12cDd6N3Q4OA==}] >[disable:GET:http://10.112.30.32/control/control?set§ion=recording&recording_activ=disable{Authorization=Basic YWRtaW46cGRncWE2MnY0ZjRiZDl0cm12cDd6N3Q4OA==}]" } \ No newline at end of file +Switch REMCAM001Record "Aufzeichnung Starten" (gHistory) { http="<[http://10.112.30.31/control/control?read§ion=recording&recording_activ{Authorization=Basic YWRtaW46cnQ4cWZmOHBwa21hODJienhxMnZjeTNtMw==}:60000:REGEX(recording_activ=(.*))] >[ON:GET:http://10.112.30.31/control/control?set§ion=recording&recording_activ=enable{Authorization=Basic YWRtaW46cnQ4cWZmOHBwa21hODJienhxMnZjeTNtMw==}] >[OFF:GET:http://10.112.30.31/control/control?set§ion=recording&recording_activ=disable{Authorization=Basic YWRtaW46cnQ4cWZmOHBwa21hODJienhxMnZjeTNtMw==}]" } +Switch REMCAM002Record "Aufzeichnung Starten" (gHistory) { http="<[http://10.112.30.32/control/control?read§ion=recording&recording_activ{Authorization=Basic YWRtaW46cGRncWE2MnY0ZjRiZDl0cm12cDd6N3Q4OA==}:60000:REGEX(recording_activ=(.*))] >[ON:GET:http://10.112.30.32/control/control?set§ion=recording&recording_activ=enable{Authorization=Basic YWRtaW46cGRncWE2MnY0ZjRiZDl0cm12cDd6N3Q4OA==}] >[OFF:GET:http://10.112.30.32/control/control?set§ion=recording&recording_activ=disable{Authorization=Basic YWRtaW46cGRncWE2MnY0ZjRiZDl0cm12cDd6N3Q4OA==}]" } \ No newline at end of file diff --git a/rules/Cron.rules b/rules/Cron.rules new file mode 100644 index 0000000..947560c --- /dev/null +++ b/rules/Cron.rules @@ -0,0 +1,13 @@ +rule "Funktionsüberprüfung exception ON" +when + Time cron "0 55 12 ? * SAT#1" +then + FunctioncheckSwitch.sendCommand(ON) +end + +rule "Funktionsüberprüfung exception OFF" +when + Time cron "0 5 13 ? * SAT#1" +then + FunctioncheckSwitch.sendCommand(OFF) +end \ No newline at end of file diff --git a/rules/Dienste.rules b/rules/Dienste.rules index b49c500..8dbee93 100644 --- a/rules/Dienste.rules +++ b/rules/Dienste.rules @@ -8,7 +8,7 @@ then 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(FFDienstIUK2,transform("JSONPATH", "$.DIENSTE.D1", jsonString)) postUpdate(FFDienstIUK3,transform("JSONPATH", "$.DIENSTE.E", jsonString)) var String IUKN = transform("JSONPATH", "$.DIENSTE.F", jsonString) if (!IUKN.contains("DIENSTE")) { diff --git a/rules/FFRAlarm.rules b/rules/FFRAlarm.rules index 19f782f..515f78b 100644 --- a/rules/FFRAlarm.rules +++ b/rules/FFRAlarm.rules @@ -34,7 +34,7 @@ then postUpdate(FFAlarmMeldender,transform("JSONPATH", "$.Meldender", FFAlarmJSON.state.toString)) logInfo("FFAlarmJSON","Vor FFAlarmEinsatzmittel") postUpdate(FFAlarmEinsatzmittel,transform("JSONPATH","$.Einsatzmittel",FFAlarmJSON.state.toString)) - logInfo("FFAlarmJSON","Vor ") + logInfo("FFAlarmJSON","Vor Alarmtrigger") postUpdate(FFAlarmTrigger,transform("JSONPATH","$.AlarmTrigger",FFAlarmJSON.state.toString)) end @@ -42,16 +42,20 @@ rule "FFR Alarm Logik" when Item FFAlarmTrigger changed to ON then - if (FFRAlarmTimer === null) { + if (FFAlarmTimer === null) { postUpdate(FFAlarmView,"ON") postUpdate(FHZPush,"ON") - postUpdate(REMCAM001Record,"ON") - postUpdate(REMCAM002Record,"ON") + REMWEBIO001_Ausgang5.sendCommand(ON) + REMWEBIO001_Ausgang6.sendCommand(ON) + // postUpdate(REMCAM001Record,"ON") + // postUpdate(REMCAM002Record,"ON") + sendHttpGetRequest("http://admin:rt8qff8ppkma82bzxq2vcy3m3@10.112.30.31/control/rcontrol?action=sound&soundfile=q96_feuer2&speakerlevel=30") + sendHttpGetRequest("http://admin:pdgqa62v4f4bd9trmvp7z7t88@10.112.30.32/control/rcontrol?action=sound&soundfile=q96_feuer2&speakerlevel=30") FFAlarmTimer = createTimer(now.plusMinutes(60)) [| postUpdate(FFAlarmTrigger,"OFF") postUpdate(FHZPush,"OFF") - postUpdate(REMCAM001Record,"OFF") - postUpdate(REMCAM002Record,"OFF") + // postUpdate(REMCAM001Record,"OFF") + // postUpdate(REMCAM002Record,"OFF") FFAlarmTimer.cancel() FFAlarmTimer = null ] @@ -64,41 +68,55 @@ when then postUpdate(FHZPush,"OFF") postUpdate(FFAlarmView,"OFF") + // postUpdate(REMCAM001Record,"OFF") + // postUpdate(REMCAM002Record,"OFF") end rule "Alarmschleifen Auswertung" when Item FFAlarmSchleife received update then + // val telegramActionProd = getActions("telegramActionProd","telegram:telegramBot:11a46758") + // val telegramActionDEV = getActions("telegram","telegram:telegramBot:a0986dc8") 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)) + sendPushoverMessage(pushoverBuilder("Vollalarm Rembrücken und Heusenstamm").withSound("siren").withPriority(1).withUser("upgb55kps8rx2xotn7dvdg3w2yjpt6")) + // telegramActionProd.sendTelegram("Alarmschleife hat ausgelöst: Vollalarm Rembrücken und Heusenstamm") + // telegramActionDEV.sendTelegram("Alarmschleife hat ausgelöst: Vollalarm Rembrücken und Heusenstamm") } case "57449": { logInfo("Alarmschleife", "Einsatz für den ELW") postUpdate(FFAlarmTrigger,"ON") - sendPushoverMessage(pushoverBuilder("Einsatz für den ELW").withSound("siren").withPriority(1)) + sendPushoverMessage(pushoverBuilder("Einsatz für den ELW").withSound("siren").withPriority(1).withUser("upgb55kps8rx2xotn7dvdg3w2yjpt6")) + // telegramActionProd.sendTelegram("Alarmschleife hat ausgelöst: Einsatz für den ELW") + // telegramActionDEV.sendTelegram("Alarmschleife hat ausgelöst: Einsatz für den ELW") } case "57455": { logInfo("Alarmschleife", "Vollalarm Rembrücken") postUpdate(FFAlarmTrigger,"ON") - sendPushoverMessage(pushoverBuilder("Vollalarm Rembrücken").withSound("siren").withPriority(1)) + sendPushoverMessage(pushoverBuilder("Vollalarm Rembrücken").withSound("siren").withPriority(1).withUser("upgb55kps8rx2xotn7dvdg3w2yjpt6")) + // telegramActionProd.sendTelegram("Alarmschleife hat ausgelöst: Vollalarm Rembrücken") + // telegramActionDEV.sendTelegram("Alarmschleife hat ausgelöst: Vollalarm Rembrücken") + } + case "57451": { + logInfo("Alarmschleife", "Vollalarm Heusenstamm") + sendPushoverMessage(pushoverBuilder("Vollalarm Heusenstamm").withSound("siren").withPriority(0).withUser("upgb55kps8rx2xotn7dvdg3w2yjpt6")) } } end rule "Push Fahrzeugstatus" when - Member of gFHZ changed + Member of gFHZ changed then Thread::sleep(300) if (!lockState.isLocked) { lockState.lock() try { - logInfo("Testing","gNetwork received update") + logInfo("GroupTest","gFHZ 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 && member.state.toString == "3") { @@ -119,6 +137,6 @@ if (!lockState.isLocked) { lockState.unlock() } } else { - logInfo("Testing","Locked, update ignored") + logInfo("Testing","Locked, update ignored") } end \ No newline at end of file diff --git a/rules/REMWEBIO001.rules b/rules/REMWEBIO001.rules new file mode 100644 index 0000000..27967e3 --- /dev/null +++ b/rules/REMWEBIO001.rules @@ -0,0 +1,92 @@ +rule "Steuerung Tor 1" +when + Item REMWEBIO001_Ausgang0 changed to ON +then + Thread::sleep(1000) + REMWEBIO001_Ausgang0.sendCommand(OFF) +end + +rule "MTF 1 (3-19-1) - Status 2" +when + Item FFStatus67641319 changed to 2 +then + if( StartupSwitch.state == ON && FunctioncheckSwitch.state!=ON ) { + REMWEBIO001_Ausgang0.sendCommand(ON) + } +end + +rule "Steuerung Tor 2" +when + Item REMWEBIO001_Ausgang1 changed to ON +then + Thread::sleep(1000) + REMWEBIO001_Ausgang1.sendCommand(OFF) +end + +rule "LF 8/6-1 (3-42-1) - Status 2" +when + Item FFStatus67641342 changed to 2 +then + if( StartupSwitch.state == ON && FunctioncheckSwitch.state!=ON ) { + REMWEBIO001_Ausgang1.sendCommand(ON) + } +end + +rule "Steuerung Tor 3" +when + Item REMWEBIO002_Ausgang2 changed to ON +then + Thread::sleep(1000) + REMWEBIO001_Ausgang2.sendCommand(OFF) +end + +rule "LF 8/6-2 (3-42-2) - Status 2" +when + Item FFStatus67641349 changed to 2 +then + if( StartupSwitch.state == ON && FunctioncheckSwitch.state!=ON ) { + REMWEBIO001_Ausgang2.sendCommand(ON) + } +end + +rule "Steuerung Tor 4" +when + Item REMWEBIO001_Ausgang3 changed to ON +then + Thread::sleep(1000) + REMWEBIO001_Ausgang3.sendCommand(OFF) +end + +rule "MTF 2 (3-19-2) - Status 2" +when + Item FFStatus67641317 changed to 2 +then + if( StartupSwitch.state == ON && FunctioncheckSwitch.state!=ON ) { + REMWEBIO001_Ausgang4.sendCommand(ON) + } +end + +rule "Steuerung Tor 5" +when + Item REMWEBIO001_Ausgang4 changed to ON +then + Thread::sleep(1000) + REMWEBIO001_Ausgang4.sendCommand(OFF) +end + +rule "RW1 (3-51-1) - Status 2" +when + Item FFStatus67641351 changed to 2 +then + if( StartupSwitch.state == ON && FunctioncheckSwitch.state!=ON ) { + REMWEBIO001_Ausgang5.sendCommand(ON) + } +end + +rule "Steuerung Alarmlicht & Gong" +when + Item REMWEBIO001_Ausgang5 changed to ON +then + Thread::sleep(6000) + REMWEBIO001_Ausgang5.sendCommand(OFF) +end diff --git a/rules/SystemStart.rules b/rules/SystemStart.rules new file mode 100644 index 0000000..5e107f1 --- /dev/null +++ b/rules/SystemStart.rules @@ -0,0 +1,11 @@ +var Timer StartupTimer = null + +rule "Startup Message" +when + System started +then + logInfo("SystemStart.rules", "Create timer for Systemstartup & Restore") + StartupTimer = createTimer(now.plusSeconds(30), [| + StartupSwitch.postUpdate(ON) + ]) +end \ No newline at end of file diff --git a/sitemaps/default.sitemap b/sitemaps/default.sitemap index 7733696..176eb2a 100644 --- a/sitemaps/default.sitemap +++ b/sitemaps/default.sitemap @@ -80,6 +80,14 @@ sitemap default label="Feuerwehr Rembrücken" { Text item=FFStatus67641272 label="GW-N (2-64-1) [MAP(status.map):%s]" icon="" valuecolor=["1"="#31CF31", "2"="#31CF31", "3"="#FF8E00", "4"="#840000", "6"="#000000"] } } + Text label="Torsteuerung" icon=garagedoor { + Switch item=REMWEBIO001_Ausgang0 icon=garagedoor + Switch item=REMWEBIO001_Ausgang1 icon=garagedoor + Switch item=REMWEBIO001_Ausgang2 icon=garagedoor + Switch item=REMWEBIO001_Ausgang3 icon=garagedoor + Switch item=REMWEBIO001_Ausgang4 icon=garagedoor + + } Text label="Dienste" icon="kalender" { Text item=FFDienstZVD Text item=FFDienstIUK2 @@ -95,18 +103,20 @@ sitemap default label="Feuerwehr Rembrücken" { Frame label="Anzeige" { Switch item=CamSelection label="Auswahl" mappings=[0="Vorne", 1="Hinten"] Video url="http://admin:rt8qff8ppkma82bzxq2vcy3m3@10.112.30.31/record/current.jpg" encoding="mjpeg" visibility=[CamSelection==0, CamSelection=="Uninitialized"] - Switch item=REMCAM001Record label="Aufzeichung" mappings=[enable="Aktiv", disable="Inaktiv"] visibility=[CamSelection==0, CamSelection=="Uninitialized"] + Switch item=REMCAM001Record label="Aufzeichung" mappings=[ON="Aktiv", OFF="Inaktiv"] visibility=[CamSelection==0, CamSelection=="Uninitialized"] Video url="http://admin:pdgqa62v4f4bd9trmvp7z7t88@10.112.30.32/record/current.jpg" encoding="mjpeg" visibility=[CamSelection==1] - Switch item=REMCAM002Record label="Aufzeichung" mappings=[enable="Aktiv", disable="Inaktiv"] visibility=[CamSelection==1] + Switch item=REMCAM002Record label="Aufzeichung" mappings=[ON="Aktiv", OFF="Inaktiv"] visibility=[CamSelection==1] } Frame label="Sound" { Switch item=CamSoundLocSelection label="Auswahl" mappings=[0="Vorne", 1="Hinten", 2="Beide"] - Selection item=CamSoundTone label="Ton" mappings=["Alarm"="Alarm", "AnsKeyNoFunction"="AnsKeyNoFunction", "AnsMsgBell"="AnsMsgBell", "AnsMsgKeypad"="AnsMsgKeypad", "AnsMsgNoAnswer"="AnsMsgNoAnswer", "Beep"="Beep", "Busy"="Busy", "Cuckooclock"="Cuckooclock", "Default"="Default", "DoorBell"="DoorBell", "Phonering"="Phonering", "Standard"="Standard"] + Selection item=CamSoundTone label="Ton" mappings=["Alarm"="Alarm", "AnsKeyNoFunction"="AnsKeyNoFunction", "AnsMsgBell"="AnsMsgBell", "AnsMsgKeypad"="AnsMsgKeypad", "AnsMsgNoAnswer"="AnsMsgNoAnswer", "Beep"="Beep", "Busy"="Busy", "Cuckooclock"="Cuckooclock", "Default"="Default", "DoorBell"="DoorBell", "Phonering"="Phonering", "Standard"="Standard", "q96_feuer2"="Q96"] Setpoint item=CamSoundVolume label="Lautstärke" minValue=0 maxValue=30 step=1 + Slider item=CamSoundVolume label="Lautstärke" switchSupport minValue=0 maxValue=30 step=1 Switch item=CamPlaySound label="Auswahl" mappings=[ON="Abspielen"] } } + Switch item=REMWEBIO001_Ausgang5 } Frame label="Wetter" { Text label="Blitzkarte" icon="lightning" { diff --git a/transform/presence.map b/transform/presence.map new file mode 100644 index 0000000..15a2f77 --- /dev/null +++ b/transform/presence.map @@ -0,0 +1,2 @@ +OPEN=zu Hause +CLOSED=Unterwegs \ No newline at end of file diff --git a/transform/status_sbi.map b/transform/status_sbi.map new file mode 100644 index 0000000..8ed425d --- /dev/null +++ b/transform/status_sbi.map @@ -0,0 +1,7 @@ +1=Einsatzbereit über Funk +2=Einsatzbereit auf Wache +3=Auf Anfahrt zur E-Stelle +4=An E-Stelle eingetroffen +5=Sprechwunsch +6=nicht einsatzbereit +NULL=Unbekannt \ No newline at end of file