{"name":"Länger Schlafen","type":"virtual_device","properties":{"deviceIcon":0,"currentIcon":"0","log":"","logTemp":"","mainLoop":"selfId = fibaro:getSelfId()\n\nlocal holidayM = \"\"\nlocal function checkH()\n local holiday = tonumber(fibaro:getGlobalValue(\"Feiertag_morgen\"));\n if (holiday == nil) or (holiday == 0) then holidayM = 'kein Feiertag.'\n else \n holidayM = 'ein Feiertag oder Wochenende.'\n end\n fibaro:call(selfId, \"setProperty\", \"ui.Label1.value\", holidayM)\n \n if tonumber(fibaro:getGlobalValue(\"Ausschlafen\")) == 1 then \n fibaro:call(selfId, \"setProperty\", \"ui.Label2.value\", 'ist aktiv!')\n else \n fibaro:call(selfId, \"setProperty\", \"ui.Label2.value\", 'ist inaktiv.')\n end \n fibaro:sleep(60*1000);\nend \ncheckH()\n--\n-- v. 0.1\n-- {jeep}\n-- Feb.2019","ui.Label1.value":"kein Feiertag.","ui.Label2.value":"ist inaktiv.","visible":"true","rows":[{"type":"label","elements":[{"id":1,"lua":false,"waitForResponse":false,"caption":"Morgen ist","name":"Label1","favourite":false,"main":false}]},{"type":"label","elements":[{"id":2,"lua":false,"waitForResponse":false,"caption":"Länger schlafen","name":"Label2","favourite":false,"main":false}]},{"type":"button","elements":[{"id":3,"lua":true,"waitForResponse":false,"caption":"Ja","name":"Button11","empty":false,"msg":"selfId = fibaro:getSelfId()\nfibaro:setGlobal(\"Ausschlafen\", \"1\"); \nfibaro:call(selfId, \"setProperty\", \"ui.Label2.value\", 'ist aktiv!')","buttonIcon":0,"favourite":false,"main":false},{"id":4,"lua":true,"waitForResponse":false,"caption":"Nein","name":"Button12","empty":false,"msg":"selfId = fibaro:getSelfId()\nfibaro:setGlobal(\"Ausschlafen\", \"0\"); \nfibaro:call(selfId, \"setProperty\", \"ui.Label2.value\", 'ist inaktiv!')","buttonIcon":0,"favourite":false,"main":false}]}]},"actions":{"pressButton":1,"setSlider":2,"setProperty":2}}