Last active
August 29, 2015 14:09
-
-
Save maxistar/8fdd6989560c3a1c7df7 to your computer and use it in GitHub Desktop.
Configuration for serial binding
This file contains hidden or 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
| //add to the beginning of file: | |
| var String ArduinoUpdate = "" | |
| rule "Arduino on update" | |
| when | |
| Item Arduino received update | |
| then | |
| ArduinoUpdate = ArduinoUpdate + Arduino.state.toString.trim | |
| println("ArduinoUpdate: " + ArduinoUpdate) | |
| if (ArduinoUpdate.contains(";")) { | |
| if (ArduinoUpdate.contains("item=Light_GF_Living_Ceiling_1")) { | |
| postUpdate(Light_GF_Living_Ceiling_1, if(ArduinoUpdate.contains("value=ON")) ON else OFF) | |
| } | |
| ArduinoUpdate = "" | |
| } | |
| end | |
| rule "Arduino LED red" | |
| when | |
| Item Light_GF_Living_Ceiling_1 received update | |
| then | |
| sendCommand(Arduino, "set led red " + (if(Light_GF_Living_Ceiling_1.state==ON) "on;" else "off;"))) | |
| ArduinoUpdate = "" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment