Advertisement
__Dave__

Untitled

Sep 10th, 2020 (edited)
919
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. rule "RF"
  2. when
  3.   Item RFButton_ changed
  4. then
  5.   if (RFButton_.state == NULL) {
  6.     logInfo("rfbutton.rules", "Item is null, cancelling...")
  7.     return;
  8.   }
  9.   var rfData = transform("JSONPATH", "$.RfReceived.Data", RFButton_.state.toString)
  10.   logInfo("rfbutton.rules", "Received IT Codes: " + rfData)
  11.   switch (rfData) {
  12.     case "28E3F2": {
  13.         if (Shelly1500291f0483f192168070Buero_Relay_Betrieb.state == ON)
  14.           Shelly1500291f0483f192168070Buero_Relay_Betrieb.sendCommand(OFF)
  15.         else
  16.           Shelly1500291f0483f192168070Buero_Relay_Betrieb.sendCommand(ON)
  17.       }
  18.   }
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement