forked from remibergsma/fibaro-hc2-scenes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iPhonePresenceChecker.vfib
1 lines (1 loc) · 2.05 KB
/
iPhonePresenceChecker.vfib
1
{"name":"iPhoneChecker","type":"virtual_device","properties":{"deviceIcon":0,"currentIcon":"0","mainLoop":"","saveLogs":"1","rows":[{"type":"button","elements":[{"id":1,"lua":true,"waitForResponse":false,"caption":"Remi","name":"Button11","empty":false,"msg":"tcpSocket = Net.FTcpSocket(\"10.1.2.6\", 62078) \nbytes, errorCode = tcpSocket:write(\"test\") \n\nif errorCode == 0 \nthen \n fibaro:debug(\"IPHONE REMI OK\")\n -- only update at status change\n if fibaro:getGlobal(\"remiAtHome\") == \"0\" then\n fibaro:setGlobal(\"remiAtHome\",1)\n fibaro:call(95, \"pressButton\", \"1\"); \n fibaro:debug(\"Updated global var\")\n else\n fibaro:debug(\"No need to update global var\")\n end\nelse \n fibaro:debug(\"IPHONE REMI offline\")\n -- only update at status change\n if fibaro:getGlobal(\"remiAtHome\") == \"1\" then\n fibaro:setGlobal(\"remiAtHome\",0)\n fibaro:call(95, \"pressButton\", \"2\"); \n fibaro:debug(\"Updated global var\")\n else\n fibaro:debug(\"No need to update global var\")\n end\nend","buttonIcon":0,"favourite":false,"main":true},{"id":2,"lua":true,"waitForResponse":false,"caption":"Kaat","name":"Button12","empty":false,"msg":"tcpSocket = Net.FTcpSocket(\"10.1.2.5\", 62078) \nbytes, errorCode = tcpSocket:write(\"test\") \n\nif errorCode == 0 \nthen \n fibaro:debug(\"IPHONE KAAT OK\")\n -- only update at status change\n if fibaro:getGlobal(\"kaatAtHome\") == \"0\" then\n fibaro:setGlobal(\"kaatAtHome\",1)\n fibaro:call(96, \"pressButton\", \"1\"); \n fibaro:debug(\"Updated global var\")\n else\n fibaro:debug(\"No need to update global var\")\n end\nelse \n fibaro:debug(\"IPHONE KAAT offline\")\n -- only update at status change\n if fibaro:getGlobal(\"kaatAtHome\") == \"1\" then\n fibaro:setGlobal(\"kaatAtHome\",0)\n fibaro:call(96, \"pressButton\", \"2\"); \n fibaro:debug(\"Updated global var\")\n else\n fibaro:debug(\"No need to update global var\")\n end\nend","buttonIcon":0,"favourite":false,"main":false}]}]},"actions":{"pressButton":1,"setSlider":2,"setProperty":2}}