Network binding - speedtest

The Network binding now implements the speedtest natively so you don’t have to use the Exec binding and the speedtest-cli any more. Assuming you can figure out how to configure it. But the Network binding requires the Items use UoM and that seems to be the root of the problem.

Hi, All!
Here is what I did:

Number:DataTransferRate Speedtest_ResultDown "Downlink [%.2f %unit%]"  {channel="network:speedtest:local:rateDown"}
Number:DataTransferRate Speedtest_ResultUp "Uplink [%.2f %unit%]" {channel="network:speedtest:local:rateUp"}

Deleted - :DataTransferRate
Replaced - %unit% on Mbit/s

Number Speedtest_ResultDown "Downlink [%.2f Mbit/s]"  {channel="network:speedtest:local:rateDown"}
Number Speedtest_ResultUp "Uplink [%.2f Mbit/s]" {channel="network:speedtest:local:rateUp"}

It works just fine, as I would like!
PS openHAB 2.5.0 Build #1756

Thanks!

1 Like

I assumed that the element is incorrectly declared here, in the documentation it is like a string, I think it should be like a switch.

It works but it doesn’t actually help us figure out if there is a regression bug that has been recently introduced in how the %unit% is handled. You’ve avoided the error by eliminating the UoM but there is still something wrong with the UoM and the %unit% play holder.

Overall this binding works well for me, assuming I stick with the example server and filename given in the binding documentation. BUT, that server’s in France, so not that meaningful for me. I’d like to use a closer server as a better benchmark of my up/down speeds.

I found a list of speedtest servers that (I think?) should allow this sort of traffic:
https://c.speedtest.net/speedtest-servers-static.php

However, the binding also requires a fileName parameter …

Thing network:speedtest:local "SpeedTest" @ "Internet" [refreshInterval=30, uploadSize=8000000, url="https://bouygues.testdebit.info/", filename="50M.iso", initialDelay=5]

But that link above does not give lists of filenames that exist on those speedtest servers for download. I tried not changing the filename:

url="hou.speedtest.sbcglobal.net:8080", filename="50M.iso"

… and that gives a “Error status code 404” errors.

I did a brute force search on this directory with DirBuster, and found that this link:
https://hou.speedtest.sbcglobal.net:8080/download/download
… successfully begins a download of a 10.0 GB file. Cool, that’s good to know, seems like I am getting somewhere!

But since then I have fiddled around with the Thing definition with various permutations of the url and the fileName parameters, and still not yet managed to make it work. I keep getting 404 errors.

Any ideas on how to get this working?

Hej @Dave_Baldwin - I ended up with the same question, when I shifted from speedtest-cli to the binding based network speedtest. The latter shows lower up/download capacity, than speedtest, which seems to automatically choose the closest server (in my case Stockholm)
Could you solve your problem and would you share your solution here?

SOLVED - for any, who runs into this issue

I had succes in using the speedtest.net servers - an overview of servers is on a github here .

My entry to this was though the webpage of an internet provider http://speedtest4.tele2.net/ , which expolians nicely the underlying concept of the speedtest servers.
The network.things file has to point at an anycast server address, which automatically connects to the closest servers, and one can choose from a range of files in different sizes in order to test the connection.
This is my working definition:

Thing network:speedtest:local "SpeedTest 100Mb" [refreshInterval=180, initialDelay=5, url="http://speedtest.tele2.net", fileName="100MB.zip"]

I benchmarked the quite simple solution here against the ookla speedtest webpage (speedtest.net) and the results are the same. There might be caveats with this simple approach, but one avoids extra rules and binding definitions, which a solution with speedtest-cli requires Openhab: speedtest-cli-by-ookla-internet-up-downlink-measurement-integration

Hi all,
Nice binding, very usefull.
For the speedtest, i try the basic thing and it works, but result is very strange as it says my bandwidth is between 2.3 - 2.4Mbit/s (DL).
Problem is that i have a 1Gbits connexion (tested and effective at 950Mbits).
When i do a WGET on the same file with the server, i have more than 900Mbits for bandwidth.
Any clue why the binding speedtest is so slow ?
Thanks

Can you monitor your interface load while the test is performed?
Is the test really that slow or is the shown result wrong?

Thanks for your response.
I monitor the interface all the time, so while the test is performed.
(with iftop for this test)
I really dont understand why network binding/speedtest is so slow …

Hello,
No one else has the same problem ?
Forgot to mention my system : raspberry PI4 (1gb interface) with raspbian.
After a reboot for another reason, my results are now : 40mb/s (DL) 25 mb/s (UL), still far from real bandwidth.

Thank you @mdnx, the suggested server works fine for me and the numbers seem realistic compared to other (web based) speedtests!

However, I got a problem with the returned text from the binding:

2021-02-10 11:14:47.733 [WARN ] [e.internal.SseItemStatesEventBuilder] - Exception while formatting value '91.4568805736 Mbit/s' of item SpeedTest_DownloadRate with format '%d %unit%': d != java.math.BigDecimal

But I don’t really get the problem? The number seems to fit into BigDecimal and there is a space separating it from the unit. What’s failing here?

I fixed the warning in my log with floating pattern like:

%.2f %unit%

Where did you do that? I’m trying to avoid file configs with OH3 now. So I checked the possibilities when linking the item and see that “Number:DataTransferRate” is the preset.

I tried changing this to “String”, but still get the same error. Presumably since the channel in the binding is already defined as such:

So I guess, I have to fall back to create this thing as a Textfile Item to resolve that problem :-/ ?

You can do it in the UI. I’ve done everything without any .items files in OH3.

Go to your item, add meta data, state description, and there is a value for pattern. Paste the given code and it should work.

1 Like

Thank you so much, this works perfectly! I feared that it’s wrong in the channel already, because the same format string was displayed for it. But changing the metadata indeed is enough!

Coming back here to ask, whether somebody has a current, working and fast speedtest server to share? The french one from the docu works fine, but the speed is very slow and doesn’t reflect my actual speed. The aforementioned tele2 server was quite good, but it’s been giving back a http 503 for over a week now :frowning:

this could help:

1 Like

I tried this one before, but Upload didn’t seem to work. Just tried it again, now it works, albeit slower than it should be. I’ll keep an eye on it, maybe it was just a glitch. Thanks!

I am having the same experience with the French one and also ovh gives me too low results compared to speedtest and reality. I tried with different files, but with the same result. I am on a SVDSL 185 connection, maybe someone with a different bandwidths is closer to reality with ovh or the french one. ovh is showing just around 125 with me. speedtest net was around 160-170.

The interesting thing is if you copy paste the configuration for http://speedtest.tele2.net/100MB.zip into the browser, it works and the file will download. Maybe a minimal change has happened. Is there someone who could have a look into the binding configuration?

For me is the speedtest.tele2.net Server working but only for download. After the failed upload attempt the thing goes offline.
So i think it is a problem with the upload process.