I have several rules that depend on the presence of phones.
For Android and Windows phones is sufficient to do a simple pingPresentce . The problem is that iPhones go after about 30 seconds of inactivity in sleep mode and turn off wifi. This made the whole concept unreliable
There is another way to verify that the iPhone(s) are present using icloud.
Install the plugin location
configure the location-plugin:
{
"id": "iphone one",
"name": "iphone-one",
"class": "LocationDevice",
"lat": 51.xxxxxxxxxx,
"long": 5.xxxxxxxx,
"iCloudUser": "you icloud username",
"iCloudPass": "you icloud password",
"iCloudDevice": "the name icloud knows your iPhone by",
"iCloudInterval": 60000
}
make a dummy-phone for the iphone:
{
"id": "iPhone1",
"name": "iPhone1",
"class": "DummyPresenceSensor",
"autoReset": false
},
And lastly make 2 rules.
{
"id": "iphone1-is-home",
"name": "iphone1 is home",
"rule": "if linearDistance of iphone one is less than 40m then execute \"curl admin:admin@localhost/api/device/iPhone1/changePresenceTo?presence=true >/dev/null 2>&1\"",
"active": true,
"logging": true
},
{
"id": "iPhone1-is-gone",
"name": "iPhone1 is gone",
"rule": "if linearDistance of iphone one is greater than 40m then execute \"curl admin:admin@localhost/api/device/iPhone1/changePresenceTo?presence=false >/dev/null 2>&1\"",
"active": true,
"logging": true
}
You have to do this for ever iPhone or iTab
Hope this helps someone.
Greetings Hans