[OH3] New Binding - Speedtest

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

I had already tried another option above. Unfortunately without success. My guess is that it has something to do with the jar file. I have already read a lot on this topic, but now I can’t get any further. My only hope now rests on the fact that @ muelli1967 will get in touch and his own solution will also help me.
Thank you for your answer.

Guys, almost too long ago since I installed it so I might be out of details, but I have not set up 2 dockers, one for openHAB and one for Speedtest. instead I just stored the speedtest files from here Speedtest CLI: Internet speed test for the command line into the NAS and then did mount it like this:

The config of speedtest in openHAB looks like this:

At first start you need to go into the docker terminal, change user to openHAB and run the speedtest manually to accept the T&C´s. Then speedtest changes to ONLINE and works fine in openHAB.

I hope I captured the questions you had. As you can see I have not updated since 3.1.0_M4 due to time constrains and healthy issues, currently I am just enjoying a system that works reliable for my usecases. If there were any changes that impacts the above procedure, I missed this.

No it has nothing to do with the .jar (binding).
The binding can´t find the speedtest executable in your docker container.
See Jans answer, the speedtest executable must be placed into the openHAB docker container.

Gentlemen, thanks to your help, I made it. :+1: I knew that @muelli1967 would get me on the right track (sorry again for disturbing me on vacation). But the last hint from @Bredmich was also very important.
Finally, one more question is allowed: the entry in the exec.whitelist is important so that the values updated regularly, right?