Ookla's Speedtest Binding [3.2.0;3.9.0)

Speedtest Binding

share-logo

The Speedtest Binding can be used to perform a network speed test for your openHAB instance.
It is based on the command line interface (CLI) version of Ookla’s Speedtest (Speedtest CLI: Internet speed test for the command line).

The Ookla CLI Speedtest application MUST be installed on your openHAB instance when using the Speedtest Binding.

Why Ookla’s Speedtest?

Fully supported and maintained by Ookla with the latest Speedtest technology for best results:

  • Consistent measurement, even on high bandwidth
  • Consistent measurement, very much independent from the performance of the host system

What functionality does Ookla’s Speedtest offer?

The Speedtest Binding is using the following functionality, provided by Ookla’s Speedtest:

  • Output of an accurate timestamp per measurement
  • Output of Ping time and Jitter
  • Output of Bandwidth, transferred Bytes and elapsed time for Down-/Upload
  • Output of the used interface with Internal/External IP, MAC Address and the Internet Service Provider (ISP)
  • Output of a result ID and a result URL
  • Output of the used Server and location the Speedtest was run against
  • Possiblity to pre-select a server used for testing

What interfaces does the Speedtest Binding offer?

The Speedtest Binding provides the Ookla’s Speedtest functionality via the following openHAB interface:

  • Execute Speedtest time based or triggered
  • Provide results via openHAB Channels
  • List available Ookla Speedtest servers that can be used for testing (optional)

Ookla License and Privacy Terms

When using this binding, you automatically accept the license and privacy terms of Ookla’s Speedtest.
You can find the latest version of those terms at the following webpages:

Supported Things

Speedtest thing.

Binding Configuration

For this binding to work, you MUST install Ookla’s Speedtest command line tool (speedtest or speedtest.exe).
It will not work with other versions like speedtest-cli or other speedtest variants.

To install Ookla’s version of Speedtest, head to Speedtest CLI: Internet speed test for the command line and follow the instructions for your Operating System.

Thing Configuration

Parameter Description Default
refreshInterval How often to test network speed, in minutes 60
execPath The path of the Ookla Speedtest executable.
Linux machines may leave this blank and it defaults to /usr/bin/speedtest.
serverID Optional: A specific server that shall be used for testing. You can pick the server ID from the “Thing Properties”.
If this is left blank the best option will be selected by Ookla.

The refreshInterval parameter can also be set to “Do not test automatically”.
This can be used if you want to use the “Trigger Test” channel in order to test via rules, or an item instead.

Ensure that the user that openHAB is running with, has the permissions to access and execute the executable.

Properties

Property Description
Server List 1…10 A List of Ookla Speedtest servers that can be used in order to specify a specific server for the Speedtest.
Configure the Server ID via the serverID Thing Configuration Parameter.

Channels

Channel Type Description
server String The remote server that the Speedtest was run against
pingJitter Number:Time Ping Jitter - the variation in the response time
pingLatency Number:Time Ping Latency - the reaction time of your internet connection
downloadBandwidth Number:DataTransferRate Download bandwidth, e.g. in Mbit/s
downloadBytes Number:DataAmount Amount of data that was used for the last download bandwidth test
downloadElapsed Number:Time Time spent for the last download bandwidth test
uploadBandwidth Number:DataTransferRate Upload bandwidth, e.g. in Mbit/s
uploadBytes Number:DataAmount Amount of data that was used for the last upload bandwidth test
uploadElapsed Number:Time Time spent for the last upload bandwidth test
isp String Your Internet Service Provider (ISP) as calculated by Ookla
interfaceInternalIp String IP address of the internal interface that was used for the test
interfaceExternalIp String IP address of the external interface that was used for the test
resultUrl String The URL to the Speedtest results in HTML on the Ookla webserver
triggerTest Switch Trigger in order to run Speedtest manually

Full Example

Thing File

Thing   speedtest:speedtest:myspeedtest   "Ookla Speedtest"    [ execPath="/usr/bin/speedtest", refreshInterval=60 ]

Item File

String              	    Speedtest_Server  	            "Server"               	{ channel="speedtest:speedtest:myspeedtest:server" }
Number:Time              	Speedtest_Ping_Jitter         	"Ping Jitter"           { channel="speedtest:speedtest:myspeedtest:pingJitter" }
Number:Time              	Speedtest_Ping_Latency	        "Ping Latency"      	{ channel="speedtest:speedtest:myspeedtest:pingLatency" }
Number:DataTransferRate     Speedtest_Download_Bandwith	    "Download Bandwith"     { channel="speedtest:speedtest:myspeedtest:downloadBandwidth" }
Number:DataAmount           Speedtest_Download_Bytes	    "Download Bytes"      	{ channel="speedtest:speedtest:myspeedtest:downloadBytes" }
Number:Time              	Speedtest_Download_Elapsed	    "Download Elapsed"      { channel="speedtest:speedtest:myspeedtest:downloadElapsed" }
Number:DataTransferRate     Speedtest_Upload_Bandwith	    "Upload Bandwith"      	{ channel="speedtest:speedtest:myspeedtest:uploadBandwidth" }
Number:DataAmount           Speedtest_Upload_Bytes	        "Upload Bytes"      	{ channel="speedtest:speedtest:myspeedtest:uploadBytes" }
Number:Time              	Speedtest_Upload_Elapsed        "Upload Elapsed"      	{ channel="speedtest:speedtest:myspeedtest:uploadElapsed" }
String              	    Speedtest_ISP         	        "ISP"      	            { channel="speedtest:speedtest:myspeedtest:isp" }
String              	    Speedtest_Interface_InternalIP  "Internal IP Address"   { channel="speedtest:speedtest:myspeedtest:interfaceInternalIp" }
String              	    Speedtest_Interface_ExternalIP  "External IP Address"	{ channel="speedtest:speedtest:myspeedtest:interfaceExternalIp" }
String              	    Speedtest_ResultURL    	        "Result URL"	        { channel="speedtest:speedtest:myspeedtest:resultUrl" }
Switch              	    Speedtest_TriggerTest    	    "Trigger Test"	        { channel="speedtest:speedtest:myspeedtest:triggerTest" }

Changelog

Version 0.2 (22.11.2022)

  • minor updates: robustness improvements, docu update

Version 0.1 (13.10.2022)

  • initial release

Resources

JAR:

speedtest binding jar

Source:

Forum Topic:

2 Likes

Oh man this is great!
Looking forward to seeing this in the bindings list!

Thanks for this. I once tried to set up speed tests using the Network binding but could never figure out a public service to download from.

But for those of us unlucky enough to be stuck on a metered ISP, each test is a significant download. You need to watch out that you don’t run the test too often and use up all your data. I was having speed problems and overran my 1.2 TB limit diagnosing and debugging it with speedtest.

Via the downloadBytes and uploadedBytes Channels you can monitor the data usage of the tool per test.

I had installed the addon “org.openhab.binding.speedtest-3.1.0-SNAPSHOT.jar” under oh3.1 but then uninstalled it again. However, I still get this message in the log:

2022-11-04 05:06:11.605 [WARN ] [core.karaf.internal.FeatureInstaller] - The binding add-on 'Speedtest' does not exist - ignoring it.

Can you tell me what else needs to be removed? Then I would like to install the new binding.

How did you uninstall it?

At that time it was the first attempts and it meant simply copying “org.openhab.binding.speedtest-3.1.0-SNAPSHOT.jar” to addons. Then the “speedtest” file was copied to /usr/bin/. I removed it the same way. Since then I have the message in the log.
However, I also know that this procedure is not referred to as install / uninstall.

You probably will need to clear the cache.

I have already cleared /userdata/tmp/ and /userdata/cache/. After restarting the NAS, I still get this message.

Do you use addons.cfg? If so remove the add-on from that file. If not remove the add-on from $OH_USERDATA/config/org/openhab/addons.config

1 Like

Very nice, that was the right hint. Thanks a lot for this!

I am currently dealing with the elimination of warning messages in the log. Maybe you can help me with these messages too, or should I open a new thread for this?

2022-11-04 16:10:33.313 [WARN ] [ty.util.ssl.SslContextFactory.config] - Trusting all certificates configured for Client@55cab4ed[provider=null,keyStore=null,trustStore=null]
2022-11-04 16:10:33.315 [WARN ] [ty.util.ssl.SslContextFactory.config] - No Client EndPointIdentificationAlgorithm configured for Client@55cab4ed[provider=null,keyStore=null,trustStore=null]
2022-11-04 16:10:33.813 [WARN ] [ty.util.ssl.SslContextFactory.config] - Trusting all certificates configured for Client@7060cac0[provider=null,keyStore=null,trustStore=null]
2022-11-04 16:10:33.815 [WARN ] [ty.util.ssl.SslContextFactory.config] - No Client EndPointIdentificationAlgorithm configured for Client@7060cac0[provider=null,keyStore=null,trustStore=null]

It would help if someone could tell me which is Client@55cab4ed or Client@7060cac0. How can I find out?

A new thread should be created and I can’t help with these.

Thanks!

Hello again,

I’m running openhab 3.3 in Docker on a NAS. After cleaning up my system with the friendly support of rlkoshak, there is now a problem installing the new version. The new Ookla Speedtest Binding is already installed and this zip file

https://codeload.github.com/bigbasec/openhab-addons/zip/refs/heads/speedtest

has already been downloaded. However, I don’t know how and where to install it. I also have the current ‘ookla-speedtest-1.2.0-linux-x86_64.tgz’. Here I assume that it will be installed to /usr/bin/speedtest as before.

Can somebody help me with it? I’m a bit clueless at the moment.

Ookla Speedtest in the current version ‘ookla-speedtest-1.2.0-linux-x86_64.tgz’ and the binding ‘org.openhab.binding.speedtest-3.4.0-SNAPSHOT.jar’ now works for me again under openhab3. 3. The installation way is identical to this description:

https://community.openhab.org/t/oh3-new-binding-speedtest/114242/126

However, I no longer had to accept the license.

… now works for me …

Great to hear :slight_smile:

Installation should actually be straight forward. In which area is the current readme not sufficient?

This is one of the improvements from the latest version of this binding. See also the readme:

Ookla License and Privacy Terms

When using this Binding, you automatically accept the License and Privacy Terms of Ookla’s Speedtest. You can find the latest version of those terms at the following webpages:

It was! However I am not able to get the execPath working.

I installed Python, downloaded the speedtest-cli, I have the binding, the items and the thing. Running in docker on Synology DSM. I can execute the speedtest using the terminal command ./speedtest-cli

image

I tried leaving the execPath empty since DSM is a linux system. Also tried ./ and ./speedtest-cli.

The outcome is always “Speedtest executable not found”.

image

It might be a naming problem or something? I installed the CLI doing this because I had no clue how to install it using the link provided:

wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest-cli

Let’s review:
You’re running the wrong speedtest for starters.
Please read the following instructions, here
And check the screenshot below:

Ooklas instructions actually tell you to remove the speed test-cli application.

Once you have the correct one installed, consider the following:
You have the speedtest application installed somewhere (maybe your user folder? I don’t recall) but you have your docker files somewhere else. Additionally, in your docker information you defined the mount points of the folders - and you probably did not account for files other than openHAB.
Remember, docker cannot look outside of its image and folders you mounted, so, if you’re running docker, and you’re running an application outside the docker container that you want to access, you’re… kind of stuck.
What you can do is:
install speedtest inside of the docker container - but - every update you’ll lose it.
Or
Mount the location of the speedtest install folder onto the openHAB disk mounts so that it will be accessible by the binding. But if there’s a Java update on something it might break. If openHAB uses a different Java version, you may end up with other problems.

And that’s it. Once the executable is visible to openHAB it will run. It’s actually super cool and I’ve been having fun with it. I just miss a channel with the date and time of the last speedtest run :slight_smile:

I can’t remove it. There is no apt-get in the Synology world.

admin@DS918plus:~$ sudo apt-get update
sudo: apt-get: command not found

Now how do I find out what the command I executed downloaded to remove it? This is the repo:

I have read now that the sivel package is incompatible with the binding. Sadly read it too late.

Without apt-get I can’t install curl as well.

But you can do that easily on your own if the binding is working already :slight_smile:

Humm then just delete the files, and install the ookla version afterwards. That’s what I had to do because my version was manually installed.

Yeah it’s easy enough to store that data for sure, not complaining, but it would be quite useful if it is already part of the binding, that’s it :slight_smile: