Advertisement
Guest User

Untitled

a guest
May 11th, 2014
529
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.63 KB | None | 0 0
  1. --[[
  2. %% autostart
  3. %% properties
  4. %% globals
  5. --]]
  6.  
  7. if fibaro:countScenes() > 1 then fibaro:abort(); fibaro:debug("aborted!"); end
  8.  
  9. local sourceTrigger = fibaro:getSourceTrigger();
  10.  
  11. fibaro:debug("Старт!");
  12.  
  13. if (sourceTrigger["type"] == "autostart" or sourceTrigger["type"] == "other") then
  14. while true do
  15.  
  16.     local currentDate = os.date("*t");
  17.     local startSource = fibaro:getSourceTrigger();
  18.     local curTime=string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min);
  19.    
  20.     --туалет
  21.     if(curTime == '00:00')
  22.     then
  23.         fibaro:debug("Туалет ВЫКЛ");
  24.         fibaro:call(123, "pressButton", "8")
  25.     end
  26.     if(curTime == '07:00')
  27.     then
  28.         fibaro:debug("Туалет ВКЛ");
  29.         fibaro:call(123, "pressButton", "9")
  30.     end
  31.        
  32.     --ванна
  33.     if(curTime == '00:00')
  34.     then
  35.         fibaro:debug("Ванна ВЫКЛ");
  36.         fibaro:call(123, "pressButton", "2")
  37.     end
  38.     if(curTime == '17:00')
  39.     then
  40.         fibaro:debug("Ванна ВКЛ");
  41.         fibaro:call(123, "pressButton", "3")
  42.     end
  43.    
  44.     --кухня
  45.     if(curTime == '20:00')
  46.     then
  47.         fibaro:debug("кухня ВЫКЛ");
  48.         fibaro:call(123, "pressButton", "11")
  49.     end
  50.     if(curTime == '06:00')
  51.     then
  52.         fibaro:debug("кухня ВКЛ");
  53.         fibaro:call(123, "pressButton", "12")
  54.     end
  55.    
  56.     --прихожка
  57.     if(curTime == '06:00')
  58.     then
  59.         fibaro:debug("прихожка ВЫКЛ");
  60.         fibaro:call(123, "pressButton", "20")
  61.     end
  62.     if(curTime == '00:00')
  63.     then
  64.         fibaro:debug("прихожка ВКЛ");
  65.         fibaro:call(123, "pressButton", "21")
  66.     end
  67.          
  68.  
  69.  
  70.     fibaro:sleep(60*1000);
  71. end
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement