friedpenguin

OH trigger rule - working

Mar 11th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. var Timer waitTimer = null
  2. var boolean sentVoltage = false
  3.  
  4. rule "so many volts"
  5.  
  6. when
  7. Item solar_BattVolt changed
  8. then
  9. logInfo("Voltage: ", solar_BattVolt.state.toString())
  10. if (!sentVoltage && solar_BattVolt.state > 27.5) {
  11. sendCommand(ghouse1, ON)
  12. sentVoltage = true
  13. waitTimer = createTimer(now.plusMinutes(2))[|
  14. sentVoltage = false
  15. ]
  16. }
  17. end
  18.  
  19. rule "less volts"
  20.  
  21. when
  22. Item solar_BattVolt changed
  23. then
  24. logInfo("Volt: ", solar_BattVolt.state.toString())
  25. if (!sentVoltage && solar_BattVolt.state < 27) {
  26. sendCommand(ghouse1, OFF)
  27. sentVoltage = true
  28. waitTimer = createTimer(now.plusMinutes(5))[|
  29. sentVoltage = false
  30. ]
  31. }
  32. end
Advertisement
Add Comment
Please, Sign In to add comment