Internet Speedtest

This flow checks the current Internet Speed and logs the data to a json file. Can be used as evidence for your internet provider if your speed is lower as your contract says.

PreSettings:

[{"id":"5286be59.669fe","type":"cron","z":"d290794c.e099a8","name":"Cronjob (Every Hour)","crontab":"0 */1 * * *","x":200,"y":100,"wires":[["8749a854.0cee38"]]},{"id":"8749a854.0cee38","type":"exec","z":"d290794c.e099a8","command":"/home/pi/Speedtest/speedtest-cli","addpay":false,"append":"","useSpawn":"","timer":"","name":"Call Speedtest-cli","x":445.5,"y":101.66665649414062,"wires":[["d5973ebb.39e38"],[],[]]},{"id":"d5973ebb.39e38","type":"function","z":"d290794c.e099a8","name":"Data Preparation for File","func":"var content = msg.payload.split(\"\\n\");\nmsg.payload = JSON.stringify({\n    \"Testserver\": content[2].match(/\\((.*?)\\)/)[1],\n    \"Hosted by\": content[4],\n    \"Download Speed Mbit/s\": parseFloat(content[6].split(\" \")[1]),\n    \"Upload Speed Mbit/s\": parseFloat(content[8].split(\" \")[1]),\n    \"Timestamp\": new Date()\n}) + \",\";\n\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":100,"wires":[["b246a7b.dee2b58"]]},{"id":"b246a7b.dee2b58","type":"file","z":"d290794c.e099a8","name":"Store data (/home/pi/Speedtest/data.json)","filename":"/home/pi/Speedtest/data.json","appendNewline":true,"createDir":false,"overwriteFile":"false","x":1080,"y":100,"wires":[]}]
bloigge

Flow Info

created 11 months, 3 weeks ago

Node Types

Core
  • exec (x1)
  • file (x1)
  • function (x1)
Other

Tags

  • speedtest
  • internet
  • checkspeed
  • cronjob
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option