daily pastebin goal
15%
SHARE
TWEET

temp rule - working

friedpenguin Sep 4th, 2016 (edited) 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var Timer waitTimer = null
  2. var boolean sentTemperature = false
  3.  
  4. rule "It's getting hot in here"
  5.  
  6. when
  7.         Item ponicsATemp changed
  8. then
  9.         logInfo("Temperature: ", ponicsATemp.state.toString())
  10.         if (!sentTemperature && ponicsATemp.state > 80) {
  11.                 sendCommand(garageFans, ON)
  12.                 sentTemperature = true
  13.                 waitTimer = createTimer(now.plusMinutes(2))[|
  14.                         sentTemperature = false
  15.                 ]
  16.         }
  17. end
  18.  
  19.  
  20. ##### I have since split this into a second rule for consistent results. If you choose to use it that way copy the first six lines of text into the 'rule' below and change the name of the last line for your needs ######
  21.  
  22. rule "Ah, cooler now"
  23.  
  24. when
  25.         Item ponicsATemp changed
  26. then
  27.         logInfo("Temperature: ", ponicsATemp.state.toString())
  28.         if (!sentTemperature && ponicsATemp.state < 79) {
  29.                 sendCommand(garageFans, OFF)
  30.                 sentTemperature = true
  31.                 waitTimer = createTimer(now.plusMinutes(2))[|
  32.                         sentTemperature = false
  33.                 ]
  34.         }
  35. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top