Ookla's Speedtest Binding

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: