Guest User

script_device_LUX.lua

a guest
Oct 9th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. commandArray = {}
  2.  
  3. local light_intensity = 'LUX-meter'
  4. local isdark_switch = 'SchemerschakelaarBuiten'
  5. local lux_lower = 80
  6. local lux_upper = 250
  7.  
  8.  
  9. if (devicechanged[light_intensity]) then
  10. lux = tonumber(otherdevices_svalues[light_intensity])
  11.  
  12. if lux <= tonumber(lux_lower) and otherdevices[isdark_switch] == 'Off' then
  13. commandArray[isdark_switch] = 'On'
  14. print('<font color="blue">isdonker is ingeschakeld!!</font>')
  15.  
  16. elseif lux >= tonumber(lux_upper) and otherdevices[isdark_switch] == 'On' then
  17. commandArray[isdark_switch] = 'Off'
  18. print('<font color="blue">isdonker is uitgeschakeld!!</font>')
  19. end
  20. end
  21. return commandArray
Add Comment
Please, Sign In to add comment