Testing your DSL Connection Speed with FHEM for free

When using FHEM, you can utilize a little script to test your DSL speed periodically and free, without buying separate hardware. The module is called “speedtest”.

In order to use the speedtest module, you first have to install a script which is triggered by the module: speedtest-cli.
I installed the script into the /usr/local directory, where FHEM is searching for it (and you do not have to do some extra config to run it):

mkdir /usr/local/speedtest-cli
cd /usr/local/speedtest-cli
wget -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
chmod +x speedtest-cli

Then you have to add the module config to your FHEM config:

define Speedtest speedtest 1800 4223
define FileLog_Speedtest FileLog ./log/InternetSpeedTest-%Y.log Speedtest:.*
attr FileLog_Speedtest logtype text
define SVG_FileLog_Speedtest_1 SVG FileLog_Speedtest:SVG_FileLog_Speedtest_1:CURRENT

The first line defines the speedtest itself, providing a interval and server ID. For more doc, see here.

The last three lines generate a nice plot, where you can check the last measures:


Update 01/2115:
The gplot file should look like follows:

# Created by FHEM/98_SVG.pm, 2014-12-06 06:23:03
set terminal png transparent size crop
set output '.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title ''
set ytics
set y2tics
set grid ytics
set ylabel "Mbit/s"
set y2label " "

#FileLog 4:Speedtest.download\x3a::
#FileLog 4:Speedtest.upload\x3a::

plot "" using 1:2 axes x1y1 title 'Download' ls l0 lw 1 with lines,\
"" using 1:2 axes x1y1 title 'Upload' ls l1 lw 1 with lines

3 thoughts on “Testing your DSL Connection Speed with FHEM for free”

  1. Hallo, Ich versuche seit 2 Tagen den speedtest zum fliege zu kriegen, leider nur mit Teilerfolg. Es wird mir immer nur der Upload im Plot angezeigt. Inhalt des logfiles :
    2015-01-06_18:19:29 Speedtest ok
    2015-01-06_18:19:29 Speedtest upload: 0.87 Mbits/s
    2015-01-06_18:19:29 Speedtest download: 18.62 Mbits/s
    2015-01-06_18:19:29 Speedtest ping: 33.861 ms
    2015-01-06_18:18:35 Speedtest running
    2015-01-06_17:49:19 Speedtest ok…

    Ich hoffe du kannst ir weiterhelfen.
    /br Steffen

    1. Hi,

      ich habe die gplot Definition nochmal an den Post gehangen. Schau mal, ob das ggf hilft.
      Über ein Besuch meiner Werbepartner würde ich mich freuen!

Leave a Reply

Your email address will not be published.