I’ll mention a setup I did several months ago (so I may have forgotten some of the details) which maybe rather more complicated than it should be, but something you may be able to use.
In essence I use a python script that calls a speedtest binary developed by OOKLA called Speedtest CLI. The python script uses the server-id of my choosing. I call the script (using HA shell command) whenever I need it to run it using an automation. The script parses the returned values from the binary and in turn calls the HA APIs (using tokens) to update the Speedtest sensors. The Speedtest sensors are setup using the normal HA Speedtest integration, but I have it configured for manual mode, which means the integration doesn’t update the sensors (except maybe at startup time?).
The reason I did this was because I found that the HA Speedtest integration’s test results were highly inaccurate, whereas the binary has about the same result as running the SpeedTest App on Windows.
If one of OOKLA’s binary can run on your machine, then this approach will work for you.