How to create direction from 2 motion sensors

Hello all,
I’m having some trouble figuring out how to create a way to detect direction of movement. On my driveway I have two Yolink YS7805 outdoor motion detectors.

Currently only one is in use and I have automations throughout the house to notify me of motion on the driveway such as an announcement on a speaker, mobile alert and flashing of light in the office.

I can’t tell if somebody is coming or going though, hence why I bought a second sensor.

The idea is that direction is found based on the timing of which sensor is triggered first, though I have no clue how to start building this.

Any tips are appreciated!

The following example detects movement in one direction. You can use it as the basis for detecting movement in both directions.

Be advised that things can get messy if there is simultaneous movement in opposite directions.