Lights on a security timer while away

[quote=“RichardTSchaefer, post:20, topic:170893”]Personally I would use PLEG so you do not have to deal with ServiceIDs and DeviceIDs.
You still have to get the logic right,
But for LUUP here goes:

local me = luup.variable_get("urn:upnp-org:serviceId:VSwitch1","Status",59)
local wife = luup.variable_get("urn:upnp-org:serviceId:VSwitch1","Status",138)

Now there are multiple ways to combine two or more variables:

local both_home = (me == "1") and (wife == "1")
local both_gone = (me == "0") and (wife == "0")
local either_home (me == "0") or (wife == "0")

Depending on what you want to do you will use ONE of the following at the end of the LUUP to allow the scene to run:

[ul][li]return both_home[/li]
[li]return both_gone[/li]
[li]return either_home[/li][/ul][/quote]

Thanks Richard. I used phone locator plugin before and PLEG and you help me there too. but i gave up with the iphone locator plugin because it did not work. i have 2 PLEGs currently working; the triggers, conditions and actions are not too complex. i will try to use PLEG in this particular situation although i am not too good at it. will let you know. i just want to make both VSwitches turn off when we both leave the house but not when one of us is still home.