# Network binding - speedtest

**URL:** <https://community.openhab.org/t/network-binding-speedtest/85456>\
**Category:** Bindings\
**Created:** [November 14, 2019, 8:20am UTC](https://community.openhab.org/t/network-binding-speedtest/85456 "2019-11-14T08:20:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olymp](https://community.openhab.org/user_avatar/community.openhab.org/olymp/32/5553_2.png) [@Olymp](https://community.openhab.org/u/Olymp)\
**Post date:** [November 14, 2019, 8:20am UTC](https://community.openhab.org/t/network-binding-speedtest/85456/1 "2019-11-14T08:20:36Z")

</div>

Hi!  
I wanted to try how the speed test works in relation to the network.  
In the documentation, in the example there is a line:

```auto
String Speedtest_Running "Test running ... [%s]" {channel="network:speedtest:local:isRunning"}

```

Perhaps this is a typo and should be like this :?

```auto
Switch Speedtest_Running "Test running ... [%s]" {channel="network:speedtest:local:isRunning"}

```

After rebooting openHAB, I get the following warnings:

```
2019-11-14 16:14:25.481 [WARN] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '5.5785282448' of item Speedtest_ResultDown with format '%.2f %unit%': Conversion = 'u'
2019-11-14 16:14:25.485 [WARN] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '5.5785282448' of item Speedtest_ResultDown with format '%.2f %unit%': Conversion = 'u'
2019-11-14 16:14:25.491 [WARN] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '5.5785282448' of item Speedtest_ResultDown with format '%.2f %unit%': Conversion = 'u'
2019-11-14 16:14:25.493 [WARN] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '5.5785282448' of item Speedtest_ResultDown with format '%.2f %unit%': Conversion = 'u'
2019-11-14 16:14:25.497 [WARN] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '5.5785282448' of item Speedtest_ResultDown with format '%.2f %unit%': Conversion = 'u'
2019-11-14 16:14:25.499 [WARN] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '0.0560459576' of item Speedtest_ResultUp with format '%.2f %unit%': Conversion = 'u'
2019-11-14 16:14:25.509 [WARN] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '0.0560459576' of item Speedtest_ResultUp with format '%.2f %unit%': Conversion = 'u'
2019-11-14 16:14:25.511 [WARN] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '0.0560459576' of item Speedtest_ResultUp with format '%.2f %unit%': Conversion = 'u'
2019-11-14 16:14:25.512 [WARN] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '0.0560459576' of item Speedtest_ResultUp with format '%.2f %unit%': Conversion = 'u'
2019-11-14 16:14:25.514 [WARN] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '0.0560459576' of item Speedtest_ResultUp with format '%.2f %unit%': Conversion = 'u'

```

they are related to this code from the documentation:

```
Frame label="Down" {
        Text item=Speedtest_ResultDown
        Chart item=Speedtest_ResultDown period=D refresh=30000 service="influxdb" visibility=[chart_period==0, chart_period=="Non initialisé"]
        Chart item=Speedtest_ResultDown period=W refresh=30000 service="influxdb" visibility=[chart_period==1]
        Chart item=Speedtest_ResultDown period=M refresh=30000 service="influxdb" visibility=[chart_period==2]
        Chart item=Speedtest_ResultDown period=Y refresh=30000 service="influxdb" visibility=[chart_period==3]
}

Frame label="Up" {
        Text item=Speedtest_ResultUp
        Chart item=Speedtest_ResultUp period=D refresh=30000 service="influxdb" visibility=[chart_period==0, chart_period=="Non initialisé"]
        Chart item=Speedtest_ResultUp period=W refresh=30000 service="influxdb" visibility=[chart_period==1]
        Chart item=Speedtest_ResultUp period=M refresh=30000 service="influxdb" visibility=[chart_period==2]
        Chart item=Speedtest_ResultUp period=Y refresh=30000 service="influxdb" visibility=[chart_period==3]  
}

```

What needs to be fixed to get rid of these warnings?  
PS It is very inconvenient that the binding returns units of measure, they have one problem ☹  
Can I somehow abandon the units?  
Thanks!

---

<div class="post-metadata">

**Author:** ![Olymp](https://community.openhab.org/user_avatar/community.openhab.org/olymp/32/5553_2.png) [@Olymp](https://community.openhab.org/u/Olymp)\
**Post date:** [November 14, 2019, 9:08am UTC](https://community.openhab.org/t/network-binding-speedtest/85456/2 "2019-11-14T09:08:34Z")

</div>

I found [this](https://community.openhab.org/t/uom-and-percentages-error-in-sitemaps/48572).  
so there are no warnings:

```
        Frame {
                Text item=Speedtest_ResultDown label="Download [%.2f Mbit/s]"
                Chart item=Speedtest_ResultDown label="[%.2f]" period=D refresh=30000 service="influxdb" visibility=[chart_period==0, chart_period=="Non initialisé"]
                Chart item=Speedtest_ResultDown label="[%.2f]" period=W refresh=30000 service="influxdb" visibility=[chart_period==1]
                Chart item=Speedtest_ResultDown label="[%.2f]" period=M refresh=30000 service="influxdb" visibility=[chart_period==2]
                Chart item=Speedtest_ResultDown label="[%.2f]" period=Y refresh=30000 service="influxdb" visibility=[chart_period==3]
        }

        Frame {
                Text item=Speedtest_ResultUp label="Upload [%.2f Mbit/s]"
                Chart item=Speedtest_ResultUp label="[%.2f]" period=D refresh=30000 service="influxdb" visibility=[chart_period==0, chart_period=="Non initialisé"]
                Chart item=Speedtest_ResultUp label="[%.2f]" period=W refresh=30000 service="influxdb" visibility=[chart_period==1]
                Chart item=Speedtest_ResultUp label="[%.2f]" period=M refresh=30000 service="influxdb" visibility=[chart_period==2]
                Chart item=Speedtest_ResultUp label="[%.2f]" period=Y refresh=30000 service="influxdb" visibility=[chart_period==3]  
        }

```

But this is more like a crutch.  
Is this right to do?

---

<div class="post-metadata">

**Author:** ![christoph\_wempe](https://community.openhab.org/user_avatar/community.openhab.org/christoph_wempe/32/70848_2.png) [@christoph\_wempe](https://community.openhab.org/u/christoph_wempe)\
**Post date:** [November 14, 2019, 9:09am UTC](https://community.openhab.org/t/network-binding-speedtest/85456/3 "2019-11-14T09:09:12Z")

</div>

Please post your item configuration for `Speedtest_ResultDown` and `Speedtest_ResultUp`.  
You only posted `Speedtest_Running` which is not the problem.

---

<div class="post-metadata">

**Author:** ![Olymp](https://community.openhab.org/user_avatar/community.openhab.org/olymp/32/5553_2.png) [@Olymp](https://community.openhab.org/u/Olymp)\
**Post date:** [November 14, 2019, 9:13am UTC](https://community.openhab.org/t/network-binding-speedtest/85456/4 "2019-11-14T09:13:37Z")

</div>

All unchanged from the documentation.  
.things:

```
Thing network:speedtest:local "SpeedTest 50M" @ "Internet" [initialDelay=5, refreshInterval=60, uploadSize=100000, url="https://bouygues.testdebit.info/", fileName="50M.iso"]

```

.items:

```
Group gNetSpeed																									
String Speedtest_Result "testdebit.info [%s]" <speedtest_network> (gRestore)						
Switch Speedtest_Running "Testing [%s]" <speedtest_reload2> (gRestore) {channel="network:speedtest:local:isRunning"}	
Number:Dimensionless	Speedtest_Progress "Progress [%d %unit%]" <speedtest_next5> {channel="network:speedtest:local:progress"}	
Number:DataTransferRate	Speedtest_ResultDown	"ᐁ Download [%.2f %unit%]"	<speedtest_download>	(gHistory,gNetSpeed) {channel="network:speedtest:local:rateDown"}	
Number:DataTransferRate	Speedtest_ResultUp "ᐃ Upload [%.2f %unit%]"	<speedtest_upload> (gHistory,gNetSpeed) {channel="network:speedtest:local:rateUp"}	
DateTime Speedtest_Start "Running [%1$tH:%1$tM]" <speedtest_problem4>	(gRestore) {channel="network:speedtest:local:testStart"}	
DateTime Speedtest_LUD "TimeStamp [%1$tH:%1$tM]"	<speedtest_problem4>	(gRestore) {channel="network:speedtest:local:testEnd"}

```

---

<div class="post-metadata">

**Author:** ![sihui](https://community.openhab.org/user_avatar/community.openhab.org/sihui/32/55674_2.png) [@sihui](https://community.openhab.org/u/sihui)\
**Post date:** [November 14, 2019, 10:12am UTC](https://community.openhab.org/t/network-binding-speedtest/85456/5 "2019-11-14T10:12:10Z")

</div>

> [@Olymp](#):
>
> All unchanged from the documentation.

Same here and it is working.  
But I am using PaperUI Network binding Things, so I guess you should start looking in your things file.

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [November 14, 2019, 5:05pm UTC](https://community.openhab.org/t/network-binding-speedtest/85456/6 "2019-11-14T17:05:28Z")

</div>

Three of those Items use UoM. The error appears to be having some sort of problem with the %unit% conversion for the Number:DataTransferRate Items, not the Speedtest\_Progress Items so I don’t think the link you went to is related to your problem.

It looks like it is not properly interpreting the %unit% which essentially means “the default units”. Instead it is trying to read it as `%u` as the unit which doesn’t exist.

@sihui, since it’s working for you, can you print what units these two Items are showing on your sitemap or events.log? The DataTransferRate units are not in the docs yet (I opened an Issue for that) and it will be easier if someone to post what they are seeing rather than guessing.

For those of you how got this to work, how did you find a speedtest URL and, more importantly, the name of the file?

---

<div class="post-metadata">

**Author:** ![sihui](https://community.openhab.org/user_avatar/community.openhab.org/sihui/32/55674_2.png) [@sihui](https://community.openhab.org/u/sihui)\
**Post date:** [November 14, 2019, 6:35pm UTC](https://community.openhab.org/t/network-binding-speedtest/85456/7 "2019-11-14T18:35:18Z")

</div>

> [@rlkoshak](#):
>
> @sihui, since it’s working for you

I think I was on the wrong track: I just compared the first line from the first post

```auto
String Speedtest_Running "Test running ... [%s]"

```

with the speedtest example from here which I am using:

> [@Speedtest-cli Internet Up-/Downlink Measurement Integration](https://community.openhab.org/t/speedtest-cli-internet-up-downlink-measurement-integration/7611):
>
> Below you’ll find a complete solution on integrating the internet connection bandwidth speed test from [Speedtest.net](http://www.speedtest.net) in your OpenHAB setup. This is accomplished by using the [speedtest-cli](https://github.com/sivel/speedtest-cli) script, which you have to provide on your system. Version Info: The guide was updated for openHAB 2.0 but should work on other versions as well. Functionality: execute speed test once or twice a day, every hour or upon command show summarized results on the sitemap show all results on an extra page after cl…

and that item is almost 🕶 the same:

`String SpeedtestRunning "Speedtest running ... [%s]" <"speedtest_new"> (gSpeedtest)`

Sorry for the confusion.  
BTW, the linked speedtest tutorial and example is working great 😀

 ![grafik](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/c/7/c7ff3bbd415c65e2e44d09a980593afb3c792ea9.png)

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [November 14, 2019, 6:45pm UTC](https://community.openhab.org/t/network-binding-speedtest/85456/8 "2019-11-14T18:45:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Olymp](https://community.openhab.org/user_avatar/community.openhab.org/olymp/32/5553_2.png) [@Olymp](https://community.openhab.org/u/Olymp)\
**Post date:** [November 15, 2019, 4:46am UTC](https://community.openhab.org/t/network-binding-speedtest/85456/9 "2019-11-15T04:46:57Z")

</div>

Hi, All!  
Here is what I did:

```auto
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

```auto
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!

---

<div class="post-metadata">

**Author:** ![Olymp](https://community.openhab.org/user_avatar/community.openhab.org/olymp/32/5553_2.png) [@Olymp](https://community.openhab.org/u/Olymp)\
**Post date:** [November 15, 2019, 4:50am UTC](https://community.openhab.org/t/network-binding-speedtest/85456/10 "2019-11-15T04:50:57Z")

</div>

> [@christoph\_wempe](#):
>
> You only posted `Speedtest_Running` which is not the problem.

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.

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [November 15, 2019, 4:49pm UTC](https://community.openhab.org/t/network-binding-speedtest/85456/11 "2019-11-15T16:49:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Dave\_Baldwin](https://community.openhab.org/user_avatar/community.openhab.org/dave_baldwin/32/45297_2.png) [@Dave\_Baldwin](https://community.openhab.org/u/Dave_Baldwin)\
**Post date:** [January 26, 2020, 8:52pm UTC](https://community.openhab.org/t/network-binding-speedtest/85456/12 "2020-01-26T20:52:22Z")

</div>

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](https://c.speedtest.net/speedtest-servers-static.php)

However, the binding also requires a `fileName` parameter …

```csv
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:

```csv
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](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?

---

<div class="post-metadata">

**Author:** ![mdnx](https://community.openhab.org/user_avatar/community.openhab.org/mdnx/32/10600_2.png) [@mdnx](https://community.openhab.org/u/mdnx)\
**Post date:** [April 15, 2020, 9:34pm UTC](https://community.openhab.org/t/network-binding-speedtest/85456/13 "2020-04-15T21:34:45Z")

</div>

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](http://speedtest.net) servers - an overview of servers is on a [github here](https://gist.github.com/gxgani/11401911) .

My entry to this was though the webpage of an internet provider [http://speedtest4.tele2.net/](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:

```auto
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](http://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](https://community.openhab.org/t/speedtest-cli-by-ookla-internet-up-downlink-measurement-integration/94447)

---

<div class="post-metadata">

**Author:** ![funcat](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/2acd7d/32.png) [@funcat](https://community.openhab.org/u/funcat)\
**Post date:** [October 14, 2020, 1:26pm UTC](https://community.openhab.org/t/network-binding-speedtest/85456/14 "2020-10-14T13:26:01Z")

</div>

> [@Olymp](#):
>
> `https://bouygues.testdebit.info/`

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

---

<div class="post-metadata">

**Author:** ![christoph\_wempe](https://community.openhab.org/user_avatar/community.openhab.org/christoph_wempe/32/70848_2.png) [@christoph\_wempe](https://community.openhab.org/u/christoph_wempe)\
**Post date:** [October 14, 2020, 3:06pm UTC](https://community.openhab.org/t/network-binding-speedtest/85456/15 "2020-10-14T15:06:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![funcat](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/2acd7d/32.png) [@funcat](https://community.openhab.org/u/funcat)\
**Post date:** [October 16, 2020, 2:21pm UTC](https://community.openhab.org/t/network-binding-speedtest/85456/16 "2020-10-16T14:21:02Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![funcat](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/2acd7d/32.png) [@funcat](https://community.openhab.org/u/funcat)\
**Post date:** [October 22, 2020, 11:44am UTC](https://community.openhab.org/t/network-binding-speedtest/85456/17 "2020-10-22T11:44:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Daniel\_O](https://community.openhab.org/user_avatar/community.openhab.org/daniel_o/32/36567_2.png) [@Daniel\_O](https://community.openhab.org/u/Daniel_O)\
**Post date:** [February 10, 2021, 11:21am UTC](https://community.openhab.org/t/network-binding-speedtest/85456/18 "2021-02-10T11:21:57Z")

</div>

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:

```yaml
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?

---

<div class="post-metadata">

**Author:** ![dirkdirk](https://community.openhab.org/user_avatar/community.openhab.org/dirkdirk/32/65282_2.png) [@dirkdirk](https://community.openhab.org/u/dirkdirk)\
**Post date:** [February 10, 2021, 11:56am UTC](https://community.openhab.org/t/network-binding-speedtest/85456/19 "2021-02-10T11:56:31Z")

</div>

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

> %.2f %unit%

---

<div class="post-metadata">

**Author:** ![Daniel\_O](https://community.openhab.org/user_avatar/community.openhab.org/daniel_o/32/36567_2.png) [@Daniel\_O](https://community.openhab.org/u/Daniel_O)\
**Post date:** [February 10, 2021, 12:07pm UTC](https://community.openhab.org/t/network-binding-speedtest/85456/20 "2021-02-10T12:07:13Z")

</div>

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.

![grafik](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/8/7/873f08becb5ea4e8e73b55272d4a8931a69f0f7b.png)

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

 ![grafik](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/f/7/f7445e2182bd15e4439b3bfa1ffe5594639b51c6.png)

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

[Next page](https://community.openhab.org/t/network-binding-speedtest/85456.md?page=2)
