I wanted to save an ESP32 (although relatively inexpensive still a cost as well additional power cables); so I needed to add the PIR to my ESP32 running an SX1278 from Ai Thinker. See the example extension in environments.ini. ; tested this and it is working.
[env:esp32doitv1-aithinker-r01-sx1278-hcsr501]
extends = env:esp32doitv1-aithinker-r01-sx1278
lib_deps = ${env:esp32doitv1-aithinker-r01-sx1278.lib_deps}
${libraries.unifiedsensor}
build_flags =
${env:esp32doitv1-aithinker-r01-sx1278.build_flags}
'-DZsensorHCSR501="HCSR501"'
'-DHCSR501_GPIO=13'