Internet Speedtest (with gauges & charts)

This is my version of an Internet Speedtest flow. It is based on previous flows by bloigge and DeepPurple77.

My version differs from theirs in the following ways:

  1. I make use of steffen's node-red-contrib-speedtest, so there is no need to install the command-line speedtest client.
  2. Output from the node is stored as flow variables, and use these variables to repopulate the SpeedTest Dashboard when Node-RED is restarted.
  3. Clicking on the name of the speedtest server will open a new browser window linked to the results from Ookla.

Flow Diagram:

SpeedTest Flow

Dashboard:

SpeedTest Dashboard
[{"id":"26548c9f.0a8ae4","type":"speedtest","z":"38287a9c.ed6b16","name":"Speedtest","maxTime":"","serverId":"16618","acceptLicense":true,"acceptGdpr":true,"x":530,"y":540,"wires":[["396bf742.f9d9","6acde784.b9637","de54e40c.adbb6","aa97e078d434bb68","898989e13bec9e86","795dbfdfb7d44b8a","030ba525f3f7c155"]]},{"id":"396bf742.f9d9","type":"change","z":"38287a9c.ed6b16","name":"download","rules":[{"t":"set","p":"topic","pt":"msg","to":"Download","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"$round((payload.download.bandwidth)/125002, 2)","tot":"jsonata"},{"t":"set","p":"download","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":440,"wires":[["5e653827.8785","5f6cea04.d3fee4"]]},{"id":"6acde784.b9637","type":"change","z":"38287a9c.ed6b16","name":"upload","rules":[{"t":"set","p":"topic","pt":"msg","to":"Upload","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"$round((payload.upload.bandwidth)/125002, 2)","tot":"jsonata"},{"t":"set","p":"upload","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":480,"wires":[["e9d19890.e768","5f6cea04.d3fee4"]]},{"id":"de54e40c.adbb6","type":"change","z":"38287a9c.ed6b16","name":"ping","rules":[{"t":"set","p":"topic","pt":"msg","to":"Ping","tot":"str"},{"t":"set","p":"ping","pt":"flow","to":"$round((payload.ping.latency), 2)","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"ping","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":560,"wires":[["246ebc72.ad1ffc","7be6dd65.0679a4"]]},{"id":"5e653827.8785","type":"ui_gauge","z":"38287a9c.ed6b16","name":"","group":"2a046f7e.21973","order":7,"width":0,"height":0,"gtype":"gage","title":"Download Speed","label":"Download Mbits/sec","format":"{{value}}","min":0,"max":"350","colors":["#ff002d","#e4b400","#03f81f"],"seg1":"50","seg2":"170","className":"","x":1070,"y":440,"wires":[]},{"id":"5f6cea04.d3fee4","type":"ui_chart","z":"38287a9c.ed6b16","name":"","group":"6dbda234.52c8cc","order":2,"width":12,"height":6,"label":"Performance Chart","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"350","removeOlder":"2","removeOlderPoints":"","removeOlderUnit":"86400","cutout":"","useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1070,"y":260,"wires":[["fd9f742c.8b63c8"]]},{"id":"e9d19890.e768","type":"ui_gauge","z":"38287a9c.ed6b16","name":"","group":"2a046f7e.21973","order":8,"width":0,"height":0,"gtype":"gage","title":"Upload Speed","label":"Upload MBits/sec","format":"{{value}}","min":0,"max":"15","colors":["#ff002d","#ffed36","#03f81f"],"seg1":"2","seg2":"7","className":"","x":1060,"y":480,"wires":[]},{"id":"7be6dd65.0679a4","type":"ui_text","z":"38287a9c.ed6b16","group":"2a046f7e.21973","order":4,"width":0,"height":0,"name":"","label":"Ping Time (Jitter) (ms)","format":"<font color=\"cyan\">{{msg.payload}} ({{msg.jitter}})</font>","layout":"col-center","className":"","x":1080,"y":560,"wires":[]},{"id":"246ebc72.ad1ffc","type":"ui_chart","z":"38287a9c.ed6b16","name":"","group":"6dbda234.52c8cc","order":4,"width":12,"height":6,"label":"Latency Chart","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"15","removeOlder":"2","removeOlderPoints":"","removeOlderUnit":"86400","cutout":"","useOneColor":false,"useUTC":false,"colors":["#00c7fc","#1f77b4","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1060,"y":380,"wires":[["d699828f.59d9d8"]]},{"id":"c6ceb4b4.b89518","type":"json","z":"38287a9c.ed6b16","name":"","x":1270,"y":200,"wires":[["5f6cea04.d3fee4"]]},{"id":"fd9f742c.8b63c8","type":"file","z":"38287a9c.ed6b16","name":"Speed Test Data Save","filename":"/home/odroid/.node-red/data/speedtest/speedtestData.json","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":1300,"y":260,"wires":[[]]},{"id":"d699828f.59d9d8","type":"file","z":"38287a9c.ed6b16","name":"Speed Test Data Save","filename":"/home/odroid/.node-red/data/speedtest/speedtestDataPD.json","appendNewline":false,"createDir":false,"overwriteFile":"true","x":1300,"y":380,"wires":[[]]},{"id":"75617693.7c66f","type":"json","z":"38287a9c.ed6b16","name":"","x":1270,"y":440,"wires":[["246ebc72.ad1ffc"]]},{"id":"d6650ca2.aff488","type":"ui_text","z":"38287a9c.ed6b16","group":"2a046f7e.21973","order":6,"width":0,"height":0,"name":"","label":"Last Speedtest","format":"<font color=\"cyan\">{{msg.payload}}</font>","layout":"col-center","className":"","x":1060,"y":520,"wires":[]},{"id":"746fb82b.bef8","type":"file in","z":"38287a9c.ed6b16","name":"Speed Test Data Restore","filename":"/home/odroid/.node-red/data/speedtest/speedtestData.json","format":"utf8","x":1310,"y":300,"wires":[["c6ceb4b4.b89518"]]},{"id":"6facbb75.c62ad4","type":"file in","z":"38287a9c.ed6b16","name":"Speed Test Data Restore","filename":"/home/odroid/.node-red/data/speedtest/speedtestDataPD.json","format":"utf8","x":1310,"y":340,"wires":[["75617693.7c66f"]]},{"id":"1122ef5f.e68229","type":"inject","z":"38287a9c.ed6b16","name":"","repeat":"","crontab":"","once":true,"topic":"","payload":"restore","payloadType":"str","x":1060,"y":320,"wires":[["746fb82b.bef8","6facbb75.c62ad4"]]},{"id":"215587eb.e0e4a8","type":"ui_button","z":"38287a9c.ed6b16","name":"","group":"2a046f7e.21973","order":3,"width":0,"height":0,"passthru":false,"label":"Run SpeedTest Now!","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"date","topic":"","topicType":"str","x":300,"y":520,"wires":[["26548c9f.0a8ae4"]]},{"id":"22197e6c.d3e35a","type":"comment","z":"38287a9c.ed6b16","name":"Speedtest (once every 4 hours)","info":"","x":310,"y":100,"wires":[]},{"id":"232191e0.aa6446","type":"cronplus","z":"38287a9c.ed6b16","name":"Every 4 hours","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"Every 4 hours","topic":"Every 4 hours","payloadType":"str","payload":"start","expressionType":"cron","expression":"5 */4 * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":320,"y":560,"wires":[["26548c9f.0a8ae4"]]},{"id":"9c6301a1.640288","type":"switch","z":"38287a9c.ed6b16","name":"down < 70","property":"download","propertyType":"flow","rules":[{"t":"lt","v":"70","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":930,"y":700,"wires":[["596bab8b.4e19dc"]]},{"id":"596bab8b.4e19dc","type":"change","z":"38287a9c.ed6b16","name":"Speed Test","rules":[{"t":"set","p":"topic","pt":"msg","to":"Speed Test","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":700,"wires":[["8ce20f27.8481e8"]]},{"id":"8ce20f27.8481e8","type":"template","z":"38287a9c.ed6b16","name":"SMS","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Internet speed was {{flow.download}}/{{flow.upload}} (down/up Mbits/s) at {{time}}. Speedtest server was {{payload.server.name}}.","output":"str","x":1270,"y":700,"wires":[["be415b8c.8405f"]]},{"id":"be415b8c.8405f","type":"link out","z":"38287a9c.ed6b16","name":"SMS-out","links":["67fd4532.52d0e4","f90b7520.2bca38"],"x":1375,"y":700,"wires":[]},{"id":"c3381fddc96e1bfe","type":"change","z":"38287a9c.ed6b16","name":"time","rules":[{"t":"set","p":"lasttest","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":520,"wires":[["d6650ca2.aff488"]]},{"id":"66b92f1745c51496","type":"inject","z":"38287a9c.ed6b16","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"Download","payload":"download","payloadType":"flow","x":845,"y":220,"wires":[["5e653827.8785"]],"l":false},{"id":"d8fb2ee91d981d93","type":"inject","z":"38287a9c.ed6b16","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"0.2","topic":"Upload","payload":"upload","payloadType":"flow","x":845,"y":260,"wires":[["e9d19890.e768"]],"l":false},{"id":"804d689b26f1a9de","type":"inject","z":"38287a9c.ed6b16","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"jitter","v":"jitter","vt":"flow"}],"repeat":"","crontab":"","once":true,"onceDelay":"0.4","topic":"Ping","payload":"ping","payloadType":"flow","x":845,"y":340,"wires":[["7be6dd65.0679a4"]],"l":false},{"id":"e470fef7a4ddf502","type":"inject","z":"38287a9c.ed6b16","name":"","props":[{"p":"payload"},{"p":"link","v":"link","vt":"flow"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"0.6","topic":"ISP","payload":"isp","payloadType":"flow","x":845,"y":380,"wires":[["c2ce63457ba135e1"]],"l":false},{"id":"e7d166b8ceab0c22","type":"inject","z":"38287a9c.ed6b16","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"0.3","topic":"Time","payload":"lasttest","payloadType":"flow","x":845,"y":300,"wires":[["d6650ca2.aff488"]],"l":false},{"id":"8e794ac3deed5f26","type":"delay","z":"38287a9c.ed6b16","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":795,"y":700,"wires":[["9c6301a1.640288"]],"l":false},{"id":"aa97e078d434bb68","type":"change","z":"38287a9c.ed6b16","name":"ISP","rules":[{"t":"set","p":"isp","pt":"flow","to":"payload.server.name","tot":"msg"},{"t":"set","p":"link","pt":"flow","to":"payload.result.url","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"isp","tot":"flow"},{"t":"set","p":"link","pt":"msg","to":"link","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":640,"wires":[["c2ce63457ba135e1"]]},{"id":"c2ce63457ba135e1","type":"ui_text","z":"38287a9c.ed6b16","group":"2a046f7e.21973","order":2,"width":0,"height":0,"name":"","label":"Hosted By","format":"<a href=\"{{msg.link}}\" target=\"_blank\" rel=\"noopener noreferrer\"><font color=\"cyan\">{{msg.payload}}</font></a>","layout":"col-center","className":"","x":1050,"y":640,"wires":[]},{"id":"898989e13bec9e86","type":"change","z":"38287a9c.ed6b16","name":"jitter","rules":[{"t":"set","p":"topic","pt":"msg","to":"Jitter","tot":"str"},{"t":"set","p":"jitter","pt":"flow","to":"$round((payload.ping.jitter), 2)","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"jitter","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":600,"wires":[["246ebc72.ad1ffc","518fbfcc3101b633"]]},{"id":"518fbfcc3101b633","type":"change","z":"38287a9c.ed6b16","name":"","rules":[{"t":"set","p":"jitter","pt":"msg","to":"payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":875,"y":600,"wires":[["7be6dd65.0679a4"]],"l":false},{"id":"795dbfdfb7d44b8a","type":"moment","z":"38287a9c.ed6b16","name":"","topic":"","input":"payload.timestamp","inputType":"msg","inTz":"America/Chicago","adjAmount":0,"adjType":"days","adjDir":"add","format":"ddd MMM DD YYYY, HH:mm:ss","locale":"en-US","output":"payload","outputType":"msg","outTz":"America/Chicago","x":715,"y":520,"wires":[["c3381fddc96e1bfe"]],"l":false},{"id":"030ba525f3f7c155","type":"moment","z":"38287a9c.ed6b16","name":"","topic":"","input":"payload.timestamp","inputType":"msg","inTz":"America/Chicago","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm:ss on MMM Do","locale":"en-US","output":"time","outputType":"msg","outTz":"America/Chicago","x":715,"y":700,"wires":[["8e794ac3deed5f26"]],"l":false},{"id":"2a046f7e.21973","type":"ui_group","name":"Graphs","tab":"929d3236.90d2","order":1,"disp":false,"width":"6","collapse":false},{"id":"6dbda234.52c8cc","type":"ui_group","name":"Charts","tab":"929d3236.90d2","order":2,"disp":false,"width":"12","collapse":false},{"id":"929d3236.90d2","type":"ui_tab","name":"Internet Speed","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

Flow Info

Created 2 years, 6 months ago
Rating: 5 4

Owner

Actions

Rate:

Node Types

Core
  • change (x8)
  • comment (x1)
  • delay (x1)
  • file (x2)
  • file in (x2)
  • inject (x6)
  • json (x2)
  • link out (x1)
  • switch (x1)
  • template (x1)
Other
  • cronplus (x1)
  • moment (x2)
  • speedtest (x1)
  • ui_button (x1)
  • ui_chart (x2)
  • ui_gauge (x2)
  • ui_group (x2)
  • ui_tab (x1)
  • ui_text (x3)

Tags

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