[OH3] New Binding - Speedtest

Hi there,

let me share with you how I solved the issue as the GDPR acceptance was in the way:

I ran as user openhab the command speedtest

sudo -u openhab speedtest

Maybe helpful to others

2 Likes

I have the isse that the speedtest binding goes offline every few days. In the log, I usually find an entry such as:

2021-05-24 16:21:14.602 [WARN ] [.speedtest.internal.speedtestHandler] - An exception occurred while running Speedtest: ‘null’

After that the Thing shows offline and I have to manually disable and enable it to clear the error. Is there any way to debug this and provide more info where things break down?

Thanks!

Best,

Thomas

Dear Colleagues,

great binding and easily integration, my suggestion is to change ad add some feature like below:
New Items channel:last run timestamp and URL image that is the URL that we already have on bind witn “.png” ending this new image url
Also I woul like to run this between 1-5 minutes, may you add this option there?

Hello forum community,

Inspired by the new Speedtest binding from @bhomeyer, I tried to perform an installation on my Synology NAS that is similar to that of the user @muelli1967. My requirements are openhab 3.1 in Docker. I have stored the file org.openhab.binding.speedtest-3.1.0-SNAPSHOT.jar (v 0.5) under addons and installed it under usr/ bin/ Ookla-Speedtest. I also accepted the license and the exec binding is also installed. The test goes well and the result looks exactly like @ muelli1967.

However, if I then install the Speedtest Thing, the error message “CONFIGURATION_ERROR Speedtest Executable not found. Please check configuration. "

I tried it with user 9001 (suggested when creating the openhab container) and user 1000. The same error message over and over again.

What did I forget or what am I doing wrong? Who can help me here?

I would like to make one suggestion for the binding.
With the old method using rules, i was able to control the execution of the speedtest from items.
This isn´t possible as the binding has no channel for this.
Maybe you could have a look into it and try to create a channel that controls wether the speedtest is executed like configured in the Thing or not executed.

I’m not sure what you mean by this, as there is a channel for manually triggering a speedtest.

You have to click “Show Advanced” to see it.

If you don’t have it, make sure you have the latest version of the binding, as mentioned earlier in the thread.

I know that there‘s a manual trigger :wink:
The question is if bhomeyer could add another channel that allows to enable or disable the automatic execution.
Currently it‘s only an Thing setting to choose a time interval or disable it.
I know i can just disable it there and build a rule that triggers the manual start.

It‘s one Channel against one rule and two items.

Yeah, I realized that’s what you meant after seeing your other thread. Someone else had issues getting the test trigger to show up, so I thought that might be the case again.

I think you’d need two items either way. Test Trigger is always going to need an item, and “Enable/disable timer” is always going to need an item (whether it impacts a rule or a channel). So as I see it, the difference is that you have one less rule and the binding has one more channel. Am I missing something?

Not that i‘m currently aware of.

Scenario 1 or current state:

  1. The trigger item
  2. A dummy switch that represents if the speedtest should be executed
  3. A rule that starts by a crown expression and checks the dummy before execution

Scenario 2 - a new Channel:

  1. A channel linked to a switch item that controls the execution of the speedtest
    E.g. configure the Thing to execute every 30 minutes and then control if it‘s executed every 30 minutes or not with the new Channel

The aready existing trigger item isn‘t needed for the second scenario.
It‘s already there and don‘t need to be removed but neither is it needed when there‘s a Channel to control the automated execution.

I‘m fan of things build into the binding instead of working around something in rules.
Same goes for the homematic binding that uses the exact opposit logic for rollershuters compared to the original CCU.
Homematic 100% open / 0% closed
openHAB 100% closed / 0% open
The z-wave binding atleast has an option to invert this, but the homematic binding not.
But that‘s another discussion :wink:

Actually, I was missing something. I assumed that you’d want the test trigger anyway, and thus included it in the math. As you point out, it’s not necessary to the implementation.

It is another discussion, but I would instead argue for logic reversal (and/or state transformation) to be in the core so that it can be applied to any item, regardless of binding.

1 Like

I could certainly add all sorts of things, but I intended this to be a very simple and easy to use binding. I don’t want to over complicate something as simple as a speedtest.

Problem with an enable/disable that I can see would be how that gets handled on a restart, etc… just really over complicates something that is intended to be very simple. I’d be worried that you’d start seeing reports of “Speedtest isn’t running, it’s enabled”, but it’s really not because the switch they thought was for enabling it had a misspelling or something.

My hope for help from @muelli1967 has unfortunately not been used so far, he was on vacation. Perhaps he is now well recovered and will find the time to explain to me step by step how he did it. I ask because I think it has the same requirements: OH3.1 in Docker on a NAS.
I would be very happy about your help.

Your installation path is different from your config. Both paths need to be the same.

@sihui
Thank you for your reply. I’m not sure which installation path to use.

My way (openhab on NAS in Docker on Linux - /volume1/docker/openhab):

  1. File “org.openhab.binding.speedtest-3.1.0-SNAPSHOT.jar” copied to /openhab/addons
  2. The “speedtest” file installed in /usr/bin
  3. sudo chmod +x /usr/bin/speedtest
  4. Exec Binding has been installed
  5. Entry in exec.whitelist “/usr/bin/ speedtest” under /openhab/conf/misc/exec.whitelist
  6. /usr/bin/speedtest --accept-license

What am I doing wrong?

I am not using Docker, sorry.
Did you follow the docs closely? Did you install the speedtest cli?

I mean I read somewhere that Speedtest-CLI is not for Docker. But I’m not sure anymore.
By copying the file
org.openhab.binding.speedtest-3.1.0-SNAPSHOT.jar after /openhab/addons the speedtest binding and various channels are available. That’s how I understood it. However, the thing created is then offline.

Channels:

Without installing the CLI the binding does not work.

Your log shows that it is not installed:

OK, try again. I have now set up a Docker container for Ookla Speedtest. The file Speedtest is in the directory “/volume1/docker/speedtest/www/app/Bin. With the call ./speedtest I get the result below in the command line. Via the file” org.openhab.binding.speedtest-3.1.0 -SNAPSHOT.jar “(copied to the /openhab/addons directory) I get the desired speedtest binding. I have adjusted the path to the” Speedtest "file because it is now in the Speedtest container. However, I still get the same error message . Unfortunately I have no more ideas, who can help?

Note: Speedtest-CLI is not for Docker in a NAS, but e.g. B. for Raspberry.

I´m not sure if the cotainers can freely access eachother.
As far as i remember it´s not possible to access the commandline of another docker container.
It´s possible to create a virtual network that both containers can access.
I think you need to wait forn an answer from @muelli1967