So I have sort of got this working, but looking for some expertise help to clean up and combine a couple rules.
Essentially, I want to turn on my Zone 2 (so far so good thanks to @codahq and @mircolino!) for my Yamaha receiver if there is a combined opening of at least 4 times the 2 doors to backyard. If no motion is detected back there for more than 20 minutes, I'd like to turn it back off again.
I have a rule for turning on and separate for turning off. I noticed today that the "on" rule is continuing to add to my door opening count even though it's already on, which I need to correct. Regarding turning it off, I think it's good but might not be the cleanest. In perfect scenario I could rope this all into one rule with else-if structure.
Rule for turning ON
Rule for turning OFF