Can anyone help, i have some lights come one automatically when one of us gets home. Which works fine, the problem i have is that when i put my phone on charge at night it kicks back in location settings and then re-triggers my geogfence, therefore turning on lights. They do go off after a few mins, its just a bit annoying.
Because its multiple people i cant use add a variable for my phone as that would stop it working for others on occasion, I did wonder about lastupdate+1 or something but not sure if there is a syntax for this?
Code: Select all
if (otherdevices['Sunset'] == 'On' and otherdevices['Hallway Lights'] == 'Off' and (devicechanged['Jims Home'] == 'On' or devicechanged['Kaths Home'] == 'On')) then
print("Coming Home, Setting Hallway lights to 85%")
-- commandArray['Porch Light']='On'
commandArray['Hallway Lights']='Set Level 85'
commandArray['Variable:Hallway_Lights'] = '2'
elseif (uservariables["Hallway_Lights"] == 2 and timedifference(otherdevices_lastupdate['Jims Home']) > 180 and timedifference(otherdevices_lastupdate['Kaths Home']) > 180 and otherdevices['Hallway Lights'] ~= 'Off') then
commandArray['Variable:Hallway_Lights'] = '1'
end
return commandArray