i ping a couple of phones on the network with a crontab and it switches on/off virtual devices.
i want to get a notification when someone leaves or comes home.
Code: Select all
commandArray = {}
if (devicechanged['phone 1'] == 'On' and otherdevices['my phone'] == 'Off') then
commandArray[1]={['SendEmail']='Phone 1#phone 1 is home#[email protected]' }
end
if (devicechanged['phone 1'] == 'Off' and otherdevices['my phone'] == 'Off') then
commandArray[1]={['SendEmail']='Phone 1#phone 1 is gone#[email protected]' }
end
if (devicechanged['phone 2'] == 'On' and otherdevices['my phone'] == 'Off') then
commandArray[1]={['SendEmail']='Phone 2#phone 2 is home#[email protected]' }
end
if (devicechanged['phone 2'] == 'Off' and otherdevices['my phone'] == 'Off') then
commandArray[1]={['SendEmail']='Phone 2#phone 2 is gone#[email protected]' }
end
return commandArray
but when we leave toghether i also get the notification.
so the question is:can i "activate" the notification only when my Phone is gone for more then lets say 10 minutes?