Question About Multiple-Device-Trigger Behavior for Automations

I’ve got a couple of automations that I manually created using the visual editor that all use a similar build-out so this question will help me with optimizing a few different automations.

The setup is that I have two Unifi Protect camera’s person detection as a triggers for an automation. One camera views the front yard, the other views the porch. I have two triggers created; the first is a motion on with both cameras, the second is a motion off with both cameras. My global conditional is that the front light is already on or the automation stops (see “NOTE” below for further details). My primary action is a choose situation where it can choose between two lighting options based on using trigger IDs of either the “on” or the “off” triggers.

Each of the triggers has both camera’s “person detection” binary as the entity but the motion off trigger has a 1min delay which acts as the cooldown. Triggering the on works great because either camera can trigger it on. If someone goes outside via the front door, the porch camera triggers it on. If someone comes from outside of the property the front yard camera triggers it on.

Which leads to my “off” trigger question. If either entity state change can be the trigger, this means that either “off” can also be the trigger. Hypothetically that means that if someone enters the property and the front yard camera triggers the “on” and they walk up to our front porch where the front yard camera no longer sees them, that front yard camera could still send the “off” trigger after a minute of not detecting a person even though they may now be standing on the front porch and being seen by the 2nd porch camera, right?

Here’s a screen shot of the visual editor for the triggers in this automation for reference:

Is there a way that I can easily modify this so that either camera sensing a person can trigger the “on” side of things but they BOTH have to report off for a minute to trigger the off side of things? This would give me the desired result of either of them being the “on” trigger but both of them needing to be “off” to activate the “off” trigger.

Here’s the code for the entirety of the automation

NOTE: this works with another automation I have that turns the lights on at 25% around dusk and then off at 2:00am. This automation is meant to work with that one to increase the brightness to 100% if a person is detected during this time window of the lights already being on at 25% but then returning to 25% after the person detection has cleared.

alias: Front Lights 100% for 1min on Motion
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.porch_g6_turret_person_detected
      - binary_sensor.front_yard_g6_turret_person_detected
    to: "on"
    id: motion_on
  - trigger: state
    entity_id:
      - binary_sensor.porch_g6_turret_person_detected
      - binary_sensor.front_yard_g6_turret_person_detected
    to: "off"
    for:
      hours: 0
      minutes: 1
      seconds: 0
    id: motion_off
conditions:
  - condition: device
    type: is_on
    device_id: 1b497669b9bcf217c8292530c38c558f
    entity_id: 20ea4b702db0471a4b5a0d0379b08fc4
    domain: light
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - motion_on
        sequence:
          - type: turn_on
            device_id: 1b497669b9bcf217c8292530c38c558f
            entity_id: 20ea4b702db0471a4b5a0d0379b08fc4
            domain: light
            brightness_pct: 100
      - conditions:
          - condition: trigger
            id:
              - motion_off
        sequence:
          - type: turn_on
            device_id: 1b497669b9bcf217c8292530c38c558f
            entity_id: 20ea4b702db0471a4b5a0d0379b08fc4
            domain: light
            brightness_pct: 25
mode: single

It may be time to create one comprehensive automation that does all of this more cleanly. I recently imported the “Sensor Light” blueprint and have been doing some testing with it so perhaps the answer to my question(s) is using that. The only issue I’ve had with that is that the traces are quite complex so even very simple automations become challenging to examine. I tried to use it for a basic motion sensor that also took light luminance into consideration and even though it works fine the traces are so confusing to me that it looks like it never even turned on the light when it did. shrugs I’m basically at a crossroads of if I should invest more time on learning and manually modifying my one scratch-made automations or if I should invest the time into better understanding this blueprint to utilize.