I'm using ST, IFTTT, Evohome and smartphone motion sensors to automate my heating so that:

- it switches off when both my wife and I leave the home (which I do without IFTTT)
- when one of us returns home (also without IFTTT)
- and when one of us enters West London (on the assumption that we're coming home, so that the heating can get a headstart), which I do using IFTTT and a virtual 'AWAY' switch in ST (which switches off the heating via IFTTT), as IFTTT can't change the Mode.

However, this last Use Case isn't perfect, as sometimes we enter West London but aren't coming straight home, or we might dip back into the area on the non-linear route somewhere else. I don't mind the heating going on briefly but if we're going away for a period of time this could result in the heating being left on for a long time.

So I'd like to programme the system to turn off again a) if we leave West London again and b) if we don't reenter the house 45 minutes after the 'reentering West London' signal is received.

However, as there are two of us, the logic for this gets a bit more complicated as if I leave West London again my wife might still be travelling home etc.

For A)

I'd like to use two virtual switches for my wife (H) and I (T) (T returning, H returning), and switch off the Away switch if either of these switch on. However, how can I make them switch the Away switch back on if and only if they both are both Off?

For B)

is there a way to make a switch turn back to Off after 45 minutes if one of us doesn't return home (changing the mode)? I thought I could hack Power Allowance but this is linked to open/closed sensors which I'm not sure I can fake in the same way as Virtual Switches (as I can't tell the sensor that it's closed/open - just read its output).

I'm aware i might be able to achieve the above by using another app in the mix (life 360?) but I'm trying to minimise the number of apps that we need to have running on our devices day-to-day.