This script uses speedtest-cli for testing internet bandwidth using a server list provided by speedtest.net.

Servers are randomly selected, the number of servers to pick is specified at the top of the script, upload and download speeds are displayed and the averages calculated at completion of multiple tests.

You will need to change the Domoticz Configuration section and the idx numbers to correspond to your Domoticz custom sensors in the "Load data into Domoticz" section at the end of the script.