{"name":"SMARWI ložnice","type":"virtual_device","properties":{"deviceIcon":1011,"currentIcon":"1014","log":"Zavřeno","logTemp":"TxtGreen","mainLoop":"local device = fibaro:getSelfId();\nlocal deviceIp = fibaro:getValue(device, \"IPAddress\");\nlocal devicePort = fibaro:get(device, \"TCPPort\");\n\nlocal http = Net.FHttp(deviceIp, devicePort);\nlocal response = http:GET(\"/statusn\");\nlocal status = string.sub(response, 31, 31);\nfibaro:debug(status);\nif status == 'c' then fibaro:setGlobal(\"okno_lo\", \"0\"); fibaro:log('Zavřeno') end\nif status == 'o' then fibaro:setGlobal(\"okno_lo\", \"1\"); fibaro:log('Otevřeno') end","ui.Slider1.value":59,"visible":"true","rows":[{"type":"button","elements":[{"id":1,"lua":true,"waitForResponse":false,"caption":"Větrat","name":"Button11","empty":false,"msg":"local device = fibaro:getSelfId();\nlocal deviceIp = fibaro:getValue(device, \"IPAddress\");\nlocal devicePort = fibaro:get(device, \"TCPPort\");\n\nlocal http = Net.FHttp(deviceIp, devicePort);\nlocal response = http:GET(\"/cmd/open\");","buttonIcon":1013,"favourite":false,"main":false},{"id":2,"lua":true,"waitForResponse":false,"caption":"Zavřít","name":"Button12","empty":false,"msg":"local device = fibaro:getSelfId();\nlocal deviceIp = fibaro:getValue(device, \"IPAddress\");\nlocal devicePort = fibaro:get(device, \"TCPPort\");\n\nlocal http = Net.FHttp(deviceIp, devicePort);\nlocal response = http:GET(\"/cmd/close\");","buttonIcon":1014,"favourite":false,"main":false},{"id":3,"lua":true,"waitForResponse":false,"caption":"Stop","name":"Button13","empty":false,"msg":"local device = fibaro:getSelfId();\nlocal deviceIp = fibaro:getValue(device, \"IPAddress\");\nlocal devicePort = fibaro:get(device, \"TCPPort\");\n\nlocal http = Net.FHttp(deviceIp, devicePort);\nlocal response = http:GET(\"/cmd/stop\");","buttonIcon":0,"favourite":false,"main":false}]},{"type":"slider","elements":[{"id":4,"lua":true,"waitForResponse":false,"caption":"otevřít %","name":"Slider1","msg":"local device = fibaro:getSelfId();\nlocal deviceIp = fibaro:getValue(device, \"IPAddress\");\nlocal devicePort = fibaro:get(device, \"TCPPort\");\n\nproc = tonumber(fibaro:getValue(device, \"ui.Slider1.value\"));\nlocal http = Net.FHttp(deviceIp, devicePort);\nlocal response = http:GET(\"/cmd/open/\" .. proc);","buttonIcon":0,"value":59,"favourite":false,"main":false}]}]},"actions":{"pressButton":1,"setSlider":2,"setProperty":2}}