Advertisement
Antropex

Termo-Fog

May 23rd, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.64 KB | None | 0 0
  1. return      {   on  =   {
  2.                      timer = { 'every 30 minutes' },
  3.                   },
  4.  
  5.             logging = {
  6.         level = domoticz.LOG_DEBUG,
  7.         marker = "Fogger_"
  8.     },
  9.    execute = function(dz,domoticz,devices)
  10.      local time             = 240
  11.        
  12.      local  went1            = dz.devices('Wentylator Przod')
  13.      local  went2            = dz.devices('Wentylator Srodek')
  14.      local  went3            = dz.devices('Wentylator Koniec')                  --definiowanie switchy
  15.      local  Fogger           = dz.devices('Fogger')
  16.      local controlSwitch     = dz.devices('Termostat')                          --czy włączony
  17.      
  18.      local setPoint1         = dz.devices('Termo-Fog').setPoint                 --odczyt nastawy
  19.      
  20.      local Temp              = dz.devices('bme280').temperature                 --odczyt temperatury
  21.      
  22.     print(setPointTyl)
  23.  
  24.       if controlSwitch.state == 'On' then
  25.          
  26.           if Temp >= setPoint1 and Temp <= 99 then
  27.              Fogger.switchOn()
  28.              went1.switchOn()
  29.              went1.switchOff().afterSec(time)
  30.  
  31.              Fogger.switchOn()
  32.              went2.switchOn().afterSec(3)                                       -- Załączanie czasowe wentylatorów na czas+zwłoka
  33.              went2.switchOff().afterSec(time+3)
  34.  
  35.              Fogger.switchOn()
  36.              went3.switchOn().afterSec(6)
  37.              went3.switchOff().afterSec(time+6)
  38.  
  39.              Fogger.switchOff().afterSec(time+6)                                --Służy do komunkacji z termostatem, co by się nie kłóciły
  40.          end
  41.          
  42.   end
  43.  
  44.    end
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement