Method to script the platformIO.ini upload_port or display OTA port host names?

I have a project that has 50+ ESP32s connected wirelessly, all running the same software. I have added OTA to the project, which is working fine for single uploads.
I have installed ESPmDNS, but have not yet got the hostname.local appearing in the PlatformIO port list.

At the moment, the only way to upload with OTA is to specify the individual IPs of the devices in platformio,ini, which is time-consuming (change to platformio.ini necessitates an environment switch and full rebuild), and also not ideal as the IPs are DHCP and not fixed, so unknown for the 50+ boards.

Is there a method where the OTA hostname(s) can appear in the upload port list, or alternatively, to script the upload_port somehow to semi-automate the OTA roll-out? I am hoping to simply use the MAC address as the hostame.

Thanks, Jim

platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
lib_deps = 
monitor_speed = 115200
upload_port =
;upload_port = mDNS_NAME.local
;upload_port = 78:21:84:9A:C3:90._arduino._tcp.local
;upload_port = 78:21:84:9A:C3:90.local
upload_protocol = espota
upload_flags =