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
| rule "Initialize light states" | |
| when | |
| System started | |
| then | |
| Lights?.members.forEach(light| | |
| light.postUpdate(if(Math::random > 0.7) ON else OFF) | |
| ) | |
| end |
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
| rule "Turn light on" | |
| when | |
| Item Door changed to OPEN | |
| then | |
| postUpdate(Light, ON) | |
| end |