Created
November 14, 2019 17:35
-
-
Save miller45/474c0dfb7420bec01691bf8a08bce264 to your computer and use it in GitHub Desktop.
RfBridge Funkschalter Beispiel Regeln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// item fuer die RfBridge... hier weiss ich noch nicht wie man das fuer mehrer Schalter machen kann | |
String RfBridge "RfKey [%s]" {mqtt="<[mosq:tele/sonoff/30/RESULT:state:default]"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rule "rfSwitch2" | |
when | |
Item RfBridge received update | |
then | |
if (RfBridge.state == Uninitialized){ | |
logInfo("rf.rules","Item RfBridge still null") | |
return | |
} | |
// dieser Transform muss evtl angepasst werden wenn es nicht mit RfKey endet beispielsweise | |
val rfKey = transform("JSONPATH","$.RfReceived.RfKey",RfBridge.state.toString) | |
if (rfKey=="11") { | |
Bathroom.members.forEach[item | sendCommand(item,OFF)] | |
Kitchen.members.forEach[item | sendCommand(item,OFF)] | |
Living.members.forEach[item | sendCommand(item,OFF)] | |
} | |
if (rfKey=="12") { | |
Bathroom.members.forEach[item | sendCommand(item,ON)] | |
Kitchen.members.forEach[item | sendCommand(item,ON)] | |
Living.members.forEach[item | sendCommand(item,ON)] | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment