Advertisement
KrystianD

Turn light on after detection movement in a room

Jan 13th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. # Automation script for KDhome (Home automation system) - http://krystiand.net/projekt/12/kdhome
  2.  
  3. import kdhome
  4.  
  5. class MotionDetector(kdhome.KDHome):
  6.  
  7.     def __init__(self):
  8.         super().__init__()
  9.  
  10.     def onInputChangedEvent(self, id, name, newValue):
  11.         if name == "DOOR" and newValue == True:
  12.             self.setOutput("LIGHT", True)
  13.  
  14. home = MotionDetector()
  15. home.connect("localhost", 9999)
  16. home.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement