Detect Apple Vision Pro - Virtual Display

I would like to detect Apple Vision Pro - Virtual Display sharing for my Mac.

One of the reasons why I need this functionality is because I have an app that detects screen brightness and it only works when I'm outside of Virtual Display (when I'm using my MacBook's display / when I take off AVP).
When I connect to Virtual Display and then disconnect the app stops working.

I thought BTT would be the best tool to address this issue by quitting the app when Virtual Display connects and launching the app when Virtual Display disconnects.

I'm not sure how Virtual Display is "reflected" internally on macOS. Maybe it's AirPlay display? Is there any way I can already detect this? I searched in the settings, but couldn't figure it out.

I just noticed that when you're using AVP and open the iPhone Mirroring app on your Mac, you get the error message saying:

Unable to Connect to iPhone Mirroring
MacBookPro is currently using Sidecar

I found a way to "detect" Apple Vision Pro:

  1. Automations & Named & Other Triggers
  2. Screen/Display Did Connect
  • Advanced Conditions: active_screen_resolutions is {{0, 0}, {1920, 1080}}
    (This is not default AVP resolution. Find your AVP resolution in System Settings => Displays)

Is there any way for BTT to detect "Sidecar display" connected?