I am still very concerned with your entire house being unlocked while you are at work, but I believe the following does all that you originally requested…
I think the best results would be using two small pistons working together:
Piston 1 (runs when any lock changes)
IF **any** of Lock 1, Lock 2, etc are unlocked <-- Condition acting as a Trigger
Then
With Virtual Lock
Unlock
END IF
IF **all** of Lock 1, Lock 2, etc are locked <-- Condition acting as a Trigger
Then
With Virtual Lock
Lock
END IF
Piston 2 (runs when virtual lock changes)
IF Virtual Lock changes to Unlock <-- Trigger
Then
IF **all** of Lock 1, Lock 2, etc are locked <-- Condition
Then
With Lock 1, Lock 2, etc
Unlock
END IF
END IF
IF Virtual Lock changes to Lock <-- Trigger
Then
With Lock 1, Lock 2, etc
Lock
END IF
(Edit: Removed all ELSE blocks, to make this piston safer)
Notice each IF ends before the next one begins… (except the first two in Piston 2)
Also, since many (most) smart locks take a moment while the gears turn, in Piston 2, I would probably send 7 individual commands with a 1 second wait between each. (instead of all in one line like shown above) This should increase the reliability greatly.
PS. I would still like to encourage you to consider dropping the UNLOCK ALL part of this code. I program “Locks” all the time, all over the place, with no hesitation… but when it comes to “Unlocks” I am very cautious in my coding. Whenever my client insists on automating an unlock, I will place triple/quadruple checks to make sure their household is safe at all times. And all that for a single unlock code. The complexity for a quadruple check on seven locks is mind staggering, and could should never be discussed in a public forum.