Habe selber gerade eine Logik gemacht, die nur bei positiver Flanke am Eingang eine Nachricht sendet.
Code: Alles auswählen
{
"Level": [
// Levels allgemein
["$c0","int",0],
["$c1","int",1],
["$c2","int",2],
["$c3","int",3],
["$c4","int",4],
["$c5","int",5],
["$c6","int",6],
["$c7","int",7],
["$c8","int",8],
["$c9","int",9],
["$c10","int",10],
["$sdummy","string",""],
["$xfalse","bool",false],
["$xtrue","bool",true],
["$xMelder","bool",false],
["$xMelder_aktiv","bool",false],
["$xMelder_1","bool",false],
["$xMelder_2","bool",false],
["$xMelder_3","bool",false],
["$xMelder_4","bool",false],
["$xMelder_5","bool",false],
["$xMelder_6","bool",false],
["$xMelder_7","bool",false],
["$xMelder_8","bool",false],
["$xMelder_9","bool",false],
["$xMelder_10","bool",false],
["$sTitel","string",""],
["$sTitel_1","string",""],
["$sTitel_2","string",""],
["$sTitel_3","string",""],
["$sTitel_4","string",""],
["$sTitel_5","string",""],
["$sTitel_6","string",""],
["$sTitel_7","string",""],
["$sTitel_8","string",""],
["$sTitel_9","string",""],
["$sTitel_10","string",""],
["$sNachricht","string","Bewegung erkannt!"],
["$sBenutzer","string"," "],
["$sBenutzer_1","string"," "],
["$sBenutzer_2","string"," "],
["$iMelder","int",0],
["$iBenutzer","int",0],
["$VAR<Inhibit?>", "bool", false]
],
"Module": [
["Latch","$xfalse","$xMelder","$xtrue",0], // xMelder zunächst auf false setzen um nur Flanke zu erhalten
["Latch","$c0","$iMelder","$xtrue",0], // iMelder wieder auf 0 schreiben, um nur Flanken zu erkennen
// Auswertung welcher Melder aktiv
["Latch","$c1","$iMelder","$xMelder_1",1],
["Latch","$c2","$iMelder","$xMelder_2",1],
["Latch","$c3","$iMelder","$xMelder_3",1],
["Latch","$c4","$iMelder","$xMelder_4",1],
["Latch","$c5","$iMelder","$xMelder_5",1],
["Latch","$c6","$iMelder","$xMelder_6",1],
["Latch","$c7","$iMelder","$xMelder_7",1],
["Latch","$c8","$iMelder","$xMelder_8",1],
["Latch","$c9","$iMelder","$xMelder_9",1],
["Latch","$c10","$iMelder","$xMelder_10",1],
["Multiplexer",["$xfalse","$xtrue"],"$xMelder","$iMelder"], // Sofern iMelder >0, dann xMelder auf true
// Wenn kein Melder aktiv Logik beenden
["Break", ["$VAR<Inhibit?>","-$xMelder"]],
// Fehlermeldung selektieren
["Multiplexer",["$sdummy","$sTitel_1","$sTitel_2","$sTitel_3","$sTitel_4","$sTitel_5","$sTitel_6","$sTitel_7","$sTitel_8","$sTitel_9","$sTitel_10","$sdummy"],"$sTitel","$iMelder"],
["Multiplexer",["$sBenutzer_1","$sBenutzer_2"],"$sBenutzer","$iBenutzer"]
],
"Input": [
["Melder 1","Melder 1","$xMelder_1","c"],
["Melder 2","Melder 2","$xMelder_2","c"],
["Melder 3","Melder 3","$xMelder_3","c"],
["Melder 4","Melder 4","$xMelder_4","c"],
["Melder 5","Melder 5","$xMelder_5","c"],
["Melder 6","Melder 6","$xMelder_6","c"],
["Melder 7","Melder 7","$xMelder_7","c"],
["Melder 8","Melder 8","$xMelder_8","c"],
["Melder 9","Melder 9","$xMelder_9","c"],
["Melder 10","Melder 10","$xMelder_10","c"],
["Titel 1","Titel 1","$sTitel_1","u"],
["Titel 2","Titel 2","$sTitel_2","u"],
["Titel 3","Titel 3","$sTitel_3","u"],
["Titel 4","Titel 4","$sTitel_4","u"],
["Titel 5","Titel 5","$sTitel_5","u"],
["Titel 6","Titel 6","$sTitel_6","u"],
["Titel 7","Titel 7","$sTitel_7","u"],
["Titel 8","Titel 8","$sTitel_8","u"],
["Titel 9","Titel 9","$sTitel_9","u"],
["Titel 10","Titel 10","$sTitel_10","u"],
["Benutzer 1","Benutzer 1","$sBenutzer_1","u"],
["Benutzer 2","Benutzer 2","$sBenutzer_2","u"],
["Benutzer Auswahl","Benutzer Auswahl","$iBenutzer","u"],
["Inhibit", "INHIBIT", "$VAR<Inhibit?>", "u" ]
],
"Output": [
["Titel","Titel","$sTitel","a"],
["Nachricht","Nachricht","$sNachricht","a"],
["Benutzer","Benutzer","$sBenutzer","a"]
]
}
// Der Schöpfer dieser Custom Logik überträgt die Nutzungsrechte gemäß der TOLL ("Timberwolf Open Logikblock License") die unter https://wrgt.news/TOLL zum Download zur Verfügung steht."
Melder 1-10 sind die Eingänge bei denen auf True regiert wird.
Titel 1-10 der Titel der über Pushover gesendet wird.
Die Nachricht selbst ist bei mir fest hinterlegt in " ["$sNachricht","string","Bewegung erkannt!"],"
Die könnte man auch flexibel gestalten, habe ich in einer anderen Logik drin.
Derzeit kann ich zwei Benutzer angegeben die umgeschalten werden können, kann man aber auch abändern.
Logik ist noch nicht ganz fertig, macht aber prinzipiell mal das was du möchtest:
Nachricht bei positiver Flanke und ansonsten wird nichts gesendet.