Detecting whether Picture in Picture is active

I have not seen a way to set a trigger condition outside of the predefined ones, I'm new to the app so it's possible I might be wrong.

I would like to run a trigger only if Picture in Picture is active, perhaps using some tool that uses isPictureInPictureActive | Apple Developer Documentation

Or, it could be added to BTT as a condition, but would love a generic way to let's say run a shell script and get its output and then be able to compare in the conditions window.

Also, someone posted a PiP on/off script, but could this be integrated into BTT if there are more recommended APIs BTT can use?