I just set this up at home. Things seem to working as I’m getting what looks like accurate speed tests, but seeing a strange error in my log when I run it of:
And can anyone tell me what “Statistics” on the sitemap should be doing or showing?. I just show the three dots, … Should that be going to graph or other?
The warnings you are seeing are yield by io.openhabcloud.internal.CloudClient, which is probably related to your myopenhab setup.
The three dots under statistics are just a placeholder for whatever statistics you want to generate out of your measurements over time (see persistence). My recommendation would be Grafana graphs, see InfluxDB+Grafana persistence and graphing
Great scripts, just a quick comment for future improvements: Lots of people use a switch item called Presence_anyone or similiar that indicates if someone is home or not, Its been discussed here to run it hourly or twice per day, So one idea is that we run it hourly(cron rule) but only if nobody is home(Presence_anybody.state ==FALSE)
rule "Speedtest"
when
(Time cron "0 0 * * * ?" and Presence_anybody.state ==FALSE) or
Item SpeedtestRerun received command ON
then
Can you edit you orginal post to include this as an option with the link provided on how to do so in your tutorial.(Its superb btw, took less then 5 minutes to install, if you take away the fact that i had to install 7z to unzip rar)
I think “val” is a typo and schould be “var”?
Could you fix that if I am right?
and…
I think giving the startup-timer a name could be better. or?
e.g.
var Timer startup_Speedtest
rule "Speedtest init"
when
System started
then
startup_Speedtest = createTimer(now.plusSeconds(195)) [|
if (SpeedtestRerun.state == NULL) SpeedtestRerun.postUpdate(OFF)
if (SpeedtestRunning.state == NULL) SpeedtestRunning.postUpdate("-")
if (SpeedtestSummary.state == NULL || SpeedtestSummary.state == "")
SpeedtestSummary.postUpdate("⁉ (unbekannt)")
]
end
This is not a typo and is correct and appropriate as written. Use “val” when you have a variable that should never be reassigned. In this case filename is a constant so val is appropriate.
It’s unnecessary. The timer is never referenced again. It is never checked and never cancelled so there is no need to assign it to a variable. You can if you want to be it doesn’t do anything for you.
i need to cheer for your willingness to contribute, not many do that. My examples are far from perfect and if you ever find room for improvement, shoot
Thanks, yes thats probably a better solution for checking more often.
And no, dont really want to run the speedtest every 5min
In fact, as I run Openhab on a Pi3 I might need to move the speedtest off openhab (still feed the data into the db) as it only has a 100mbit ethernet (I have, or should have, a 250/100 link).
Sorry, I’m just learning. Tell me please where to copy the code below?
Rule (Linux speedtest.rules)
val String filename = "speedtest.rules"
rule "Speedtest init"
when
System started
then
createTimer(now.plusSeconds(195)) [|
if (SpeedtestRerun.state == NULL) SpeedtestRerun.postUpdate(OFF)
if (SpeedtestRunning.state == NULL) SpeedtestRunning.postUpdate("-")
if (SpeedtestSummary.state == NULL || SpeedtestSummary.state == "")
SpeedtestSummary.postUpdate("⁉ (unbekannt)")
]
end
I recommend the Beginner’s Tutorial, and the User’s Guide in the docs site. There will almost certainly be other similar fundamental questions you will face soon.
To answer your specific question, if you installed on Linux using apt or yum the file goes in /etc/openhab2/rules.
If installed manually or on another OS it goes in the conf/rules folder under wherever you unzipped OH to.
Thank you! It turns out it’s not two different files (two blocks of code as the author of the article showed), but one file. I put it in the rules folder and it all worked. But unfortunately the data record does not work in influxdb (collectd works) and openhab does not transfer data to the database. The empty database is created from scratch and a separate openhab user is created for it, all privileges are set for both writing and reading.
First make sure to reboot OH. There is some weird behavior right now with groups where changes in group membership are not picked up properly until a reboot.
no work. reboot OH did not help
there are more ideas? can provide some more data? I need very much what would have worked, I have been fighting for many days.
Thank you! My icons work with both quotation marks and without quotes. It did not affect the record in the database. It is not written. Empty. And rebooting the demons did not help either.