Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
2,419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1.  
  2. --[[
  3. %% properties
  4. %% weather
  5. %% events
  6. xxx CentralSceneEvent
  7. %% globals
  8. --]]
  9.  
  10. local startSource = fibaro:getSourceTrigger();
  11. local rollo_device_id = 'xxx';
  12.  
  13. local button = startSource["event"]["data"]["keyId"];
  14. local keyAttribute = startSource["event"]["data"]["keyAttribute"];
  15.  
  16. fibaro:debug('Taste '..button..' und '..keyAttribute..' wurde gedrückt');
  17.  
  18.  
  19. if (keyAttribute == 'Pressed' and button == 1) then
  20. -- Hier Button 1 & gedrückt
  21. fibaro:call(rollo_device_id, "open");
  22.  
  23. elseif (keyAttribute == 'Pressed' and button == 2) then
  24. -- Hier Button 2 & gedrückt
  25. if(tonumber(fibaro:getValue(rollo_device_id, "power")) >= 5)
  26. then
  27. fibaro:call(rollo_device_id, "stop");
  28. else
  29. fibaro:call(rollo_device_id, "open");
  30. end
  31.  
  32. elseif (keyAttribute == 'Pressed' and button == 3) then
  33. -- Hier Button 3 & gedrückt
  34. fibaro:call(rollo_device_id, "close");
  35.  
  36. elseif (keyAttribute == 'Pressed' and button == 4) then
  37. -- Hier Button 4 & gedrückt
  38. if(tonumber(fibaro:getValue(rollo_device_id, "power")) >= 5)
  39. then
  40. fibaro:call(rollo_device_id, "stop");
  41. else
  42. fibaro:call(rollo_device_id, "close");
  43. end
  44.  
  45.  
  46. elseif (keyAttribute == 'HeldDown' and button == 1) then
  47. -- Hier Button 1 & gehalten
  48. elseif (keyAttribute == 'HeldDown' and button == 2) then
  49. -- Hier Button 2 & gehalten
  50. elseif (keyAttribute == 'HeldDown' and button == 3) then
  51. -- Hier Button 3 & gehalten
  52. elseif (keyAttribute == 'HeldDown' and button == 4) then
  53. -- Hier Button 4 & gehalten
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement