SHARE
TWEET

Fenster offen?

h_tag Feb 6th, 2016 (edited) 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. %% autostart
  3. %% properties
  4. 69 value
  5. 75 value
  6. 100 value
  7. 104 value
  8. %% globals
  9. --]]
  10.  
  11. -- 69 Fenster Arbeitszimmer
  12. -- 75 Terrassentür
  13. -- 100 Fenster Schlafzimmer
  14. -- 104 Fenster Bad
  15.  
  16.  
  17. local id_iph = (fibaro:getGlobalValue("ID_iPhone"));
  18. fibaro:debug("ID vom iPhone: "..id_iph);
  19.  
  20. --nur eine Instanz zulassen--
  21. if (fibaro:countScenes() > 1)
  22.  then fibaro:abort()
  23. end
  24.  
  25.  
  26. local startSource = fibaro:getSourceTrigger();
  27. if (
  28.  ( tonumber(fibaro:getValue(69, "value")) > 0  or  tonumber(fibaro:getValue(75, "value")) > 0  or  tonumber(fibaro:getValue(100, "value")) > 0  or  tonumber(fibaro:getValue(104, "value")) > 0 )
  29. or
  30. startSource["type"] == "other"
  31. )
  32. then
  33.     fibaro:call(89, "setSlider", "1", "50"); -- Philips Hue
  34.     fibaro:call(89, "setSlider", "2", "90");
  35.     fibaro:setGlobal("Fenster_offen", "1");
  36.     fibaro:call(tonumber(id_iph), "sendPush", "Es ist mindestens 1 Fenster geöffnet!");
  37.  
  38.   setTimeout(function()
  39.         fibaro:call(89, "setSlider", "1", "0");  --Philips Hue nach 10 Sekunden aus
  40.     end, 10000)
  41. else
  42. fibaro:setGlobal("Fenster_offen", "0");
  43. fibaro:debug("Alle Fenster (wieder) geschlossen.");  
  44. -- fibaro:call(tonumber(id_iph), "sendPush", "Alle Fenster (wieder) geschlossen.");
  45. 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