This Thread::Sleep for 5 minutes is a bad idea…
See:
Replace with a timer:
var Timer timer = null
rule "xxx"
sendBroadcastNotification("Door Open")
timer = createTimer(now,plusMinutes(5), [ |
var String IphoneExec = executeCommandLine("sudo@@bash@@/opt/IphoneD.sh", 5000)
Iphone.postUpdate(IphoneExec)
Presence.sendCommand(IphoneExec)
])
BUT for detecting my android phone presence I simply use the network binding
Install it through the paper UI
The binding will scan your network and detect the phones. Make sure they are online!!
Select the thingcorresponding to your phone IP and link the item to the channel:
No need for a script or exec binding!
