{"name":"Garagentor-Öffner","type":"virtual_device","properties":{"deviceIcon":219,"currentIcon":"219","log":"","logTemp":"","mainLoop":"function setDevicePropertyValue(id, label, value)\n fibaro:call(id, \"setProperty\", \"ui.\"..label..\".value\", value)\nend\n\nlocal VDid = fibaro:getSelfId()\n\nlocal TorHinten = fibaro:getValue(296, \"value\")\nlocal TorVorne = fibaro:getValue(277, \"value\")\n\nfibaro:debug(\"Tor hinten: \"..TorHinten..\" und Tor vorne: \"..TorVorne..\".\")\nfibaro:debug(fibaro:getValue(296, \"value\"))\nfibaro:debug(fibaro:getValue(277, \"value\"))\n\nif (tonumber(TorHinten) == 1 and tonumber(TorVorne) == 1)\n then\n setDevicePropertyValue(VDid, \"Label1\", 'Tor ist nicht ganz zu und ncht ganz auf')\n fibaro:call(VDid, \"setProperty\", \"currentIcon\", 270)\n \n elseif (tonumber(TorHinten) == 0 and tonumber(TorVorne) == 1) then\n setDevicePropertyValue(VDid, \"Label1\", 'Tor ist ganz AUF')\n fibaro:call(VDid, \"setProperty\", \"currentIcon\", 269)\n \n elseif (tonumber(TorHinten) == 1 and tonumber(TorVorne) == 0) then\n setDevicePropertyValue(VDid, \"Label1\", 'Tor ist ganz ZU')\n fibaro:call(VDid, \"setProperty\", \"currentIcon\", 219)\nend\n\n","ui.Label1.value":"Tor ist nicht ganz zu und ncht ganz auf","ui.Label2.value":"","visible":"true","rows":[{"type":"label","elements":[{"id":1,"lua":false,"waitForResponse":false,"caption":"Torstatus:","name":"Label1","favourite":true,"main":true}]},{"type":"button","elements":[{"id":2,"lua":true,"waitForResponse":false,"caption":"Tor bewegen","name":"Button11","empty":false,"msg":"fibaro:call(189, \"turnOn\")\n\n","buttonIcon":0,"favourite":false,"main":true}]},{"type":"label","elements":[{"id":3,"lua":false,"waitForResponse":false,"caption":"Lüftungsschlitz","name":"Label2","favourite":false,"main":false}]},{"type":"button","elements":[{"id":4,"lua":true,"waitForResponse":false,"caption":"Wenn Auf","name":"Button21","empty":false,"msg":"fibaro:call(189, \"turnOn\");\nfibaro:debug(\"Öffnen gedrückt\");\n \nfibaro:sleep(17000);\nfibaro:debug(\"Sleep rum\");\n\nfibaro:call(189, \"turnOn\")\nfibaro:debug(\"Stop nach Sleep\");\n\n-----------------------------\nfunction setDevicePropertyValue(id, label, value)\n fibaro:call(id, \"setProperty\", \"ui.\"..label..\".value\", value)\nend\n--local myDeviceID = fibaro:getSelfId() \nlocal VDid = fibaro:getSelfId()\nsetDevicePropertyValue(VDid, \"Label1\", 'VD-Geschlossen mit Lüftungsschlitz')\n\n","buttonIcon":219,"favourite":false,"main":false},{"id":5,"lua":true,"waitForResponse":false,"caption":"Wenn Zu","name":"Button22","empty":false,"msg":"fibaro:call(189, \"turnOn\")\nfibaro:debug(\"Öffnen gedrückt\")\n\nfibaro:sleep(1000)\nfibaro:debug(\"Sleep rum\");\n\nfibaro:call(189, \"turnOn\")\nfibaro:debug(\"Stop nach Sleep\");\n\n-----------------------------\nfunction setDevicePropertyValue(id, label, value)\n fibaro:call(id, \"setProperty\", \"ui.\"..label..\".value\", value)\nend\nlocal VDid = fibaro:getSelfId()\nsetDevicePropertyValue(VDid, \"Label1\", 'VD-Geschlossen mit Lüftungsschlitz')\n","buttonIcon":219,"favourite":false,"main":false}]}]},"actions":{"pressButton":1,"setSlider":2,"setProperty":2}}