A small SPEED-TEST flow Dashboard 2 nodes

DASHBOARD-2 nodes.

also required:
(Ubuntu)
sudo apt install speedtest
(there is a -cli version available too.)

[{"id":"ef4a762fbd189044","type":"inject","z":"b39000460508d582","name":"Test","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":520,"y":450,"wires":[["6382f8b9642a32d3"]]},{"id":"8a0f2457de496a8a","type":"trigger","z":"b39000460508d582","name":"","op1":"true","op2":"false","op1type":"bool","op2type":"bool","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":755,"y":580,"wires":[["fbeeb3f149c2d8ba","c3f89cd42bfcb661"],["dce9cad1b1549593","c3f89cd42bfcb661"]],"l":false},{"id":"9f911bf264a37747","type":"trigger","z":"b39000460508d582","name":"","op1":"","op2":"0","op1type":"pay","op2type":"num","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1165,"y":530,"wires":[["04efd261c4af9dc1"]],"l":false},{"id":"a95943a269acba3a","type":"trigger","z":"b39000460508d582","name":"","op1":"","op2":"0","op1type":"pay","op2type":"num","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1165,"y":580,"wires":[["703aedb705463138"]],"l":false},{"id":"d5c5267d47461eb8","type":"inject","z":"b39000460508d582","name":"Initialise","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":755,"y":510,"wires":[["c3f89cd42bfcb661"]],"l":false},{"id":"a0d12323f02eccb0","type":"change","z":"b39000460508d582","name":"Reset","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":955,"y":490,"wires":[["9734efc198b32b22"]],"l":false},{"id":"8344fa99a2a4949f","type":"change","z":"b39000460508d582","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":705,"y":550,"wires":[["c3f89cd42bfcb661"]],"l":false},{"id":"5bdde14fb80b87f6","type":"change","z":"b39000460508d582","name":"Hold","rules":[{"t":"set","p":"payload","pt":"msg","to":"--== HOLD ==--","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":755,"y":290,"wires":[["8faf0d2cb0338722"]],"l":false},{"id":"dce9cad1b1549593","type":"change","z":"b39000460508d582","name":"Wipe","rules":[{"t":"set","p":"payload","pt":"msg","to":" ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":755,"y":410,"wires":[["08cc4a0b89309784"]],"l":false},{"id":"5d5e9423a985e2b3","type":"change","z":"b39000460508d582","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":705,"y":620,"wires":[["88740176955f399c"]],"l":false},{"id":"9ed83ad96f7a8405","type":"change","z":"b39000460508d582","name":"Running","rules":[{"t":"set","p":"payload","pt":"msg","to":"--== RUNNING ==--","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":755,"y":330,"wires":[["8faf0d2cb0338722"]],"l":false},{"id":"fbeeb3f149c2d8ba","type":"change","z":"b39000460508d582","name":"RESULT","rules":[{"t":"set","p":"payload","pt":"msg","to":"--== RESULT ==--","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":755,"y":370,"wires":[["8faf0d2cb0338722"]],"l":false},{"id":"08cc4a0b89309784","type":"trigger","z":"b39000460508d582","name":"","op1":"Resetting","op2":"","op1type":"str","op2type":"pay","duration":"1","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":805,"y":410,"wires":[["8faf0d2cb0338722"]],"l":false},{"id":"a2b99db0037e519c","type":"ui-button","z":"b39000460508d582","group":"6f4a6f88bfbb219b","name":"","label":"Test","order":2,"width":"1","height":"1","emulateClick":false,"tooltip":"","color":"","bgcolor":"","className":"","icon":"","iconPosition":"left","payload":"X","payloadType":"str","topic":"topic","topicType":"msg","buttonColor":"","textColor":"","iconColor":"","enableClick":true,"enablePointerdown":false,"pointerdownPayload":"","pointerdownPayloadType":"str","enablePointerup":false,"pointerupPayload":"","pointerupPayloadType":"str","x":520,"y":530,"wires":[["6382f8b9642a32d3"]]},{"id":"de5be44bacf7ef7d","type":"ui-button","z":"b39000460508d582","group":"6f4a6f88bfbb219b","name":"","label":"HOLD","order":6,"width":"1","height":"1","emulateClick":false,"tooltip":"","color":"","bgcolor":"","className":"","icon":"","iconPosition":"left","payload":"X","payloadType":"str","topic":"topic","topicType":"msg","buttonColor":"","textColor":"","iconColor":"","enableClick":true,"enablePointerdown":false,"pointerdownPayload":"","pointerdownPayloadType":"str","enablePointerup":false,"pointerupPayload":"","pointerupPayloadType":"str","x":520,"y":490,"wires":[["a0d12323f02eccb0","5bdde14fb80b87f6"]]},{"id":"f5dd0f4c10b5a02f","type":"ui-button","z":"b39000460508d582","group":"6f4a6f88bfbb219b","name":"","label":"WIPE","order":7,"width":"1","height":"1","emulateClick":false,"tooltip":"","color":"","bgcolor":"","className":"","icon":"","iconPosition":"left","payload":"0","payloadType":"num","topic":"topic","topicType":"msg","buttonColor":"","textColor":"","iconColor":"","enableClick":true,"enablePointerdown":false,"pointerdownPayload":"","pointerdownPayloadType":"str","enablePointerup":false,"pointerupPayload":"","pointerupPayloadType":"str","x":520,"y":570,"wires":[["dce9cad1b1549593","8344fa99a2a4949f","5d5e9423a985e2b3"]]},{"id":"3356f32d9cee6b1a","type":"ui-text","z":"b39000460508d582","group":"6f4a6f88bfbb219b","order":5,"width":"2","height":"1","name":"State","label":"","format":"{{msg.payload}}","layout":"col-center","style":false,"font":"","fontSize":16,"color":"#717171","wrapText":false,"className":"","x":910,"y":370,"wires":[]},{"id":"a1e611b0418ff926","type":"ui-led","z":"b39000460508d582","name":"LED","group":"6f4a6f88bfbb219b","order":3,"width":"1","height":"1","label":"","labelPlacement":"left","labelAlignment":"left","states":[{"value":"false","valueType":"bool","color":"#0095ff"},{"value":"true","valueType":"bool","color":"#00ff00"},{"value":"X","valueType":"str","color":"#f9f06b"},{"value":"--== ERROR ==--","valueType":"str","color":"#ff0000"}],"allowColorForValueInMessage":false,"shape":"circle","showBorder":true,"showGlow":true,"x":910,"y":530,"wires":[]},{"id":"b1ec61b4728293d2","type":"ui-gauge-classic","z":"b39000460508d582","name":"Up","group":"6f4a6f88bfbb219b","order":4,"width":"4","height":"4","min":0,"max":"25","sectors":[],"major_division":"2","minor_division":"0.5","value_decimal_places":1,"scale_decimal_places":0,"label":"","measurement":"Up","units":"MB/s","needles":[{"topic":"","color":"black","lengthPercent":"100"}],"sweep_angle":250,"myclass":"","x":1340,"y":530,"wires":[]},{"id":"55e07fc6e6ad268d","type":"ui-gauge-classic","z":"b39000460508d582","name":"Down","group":"6f4a6f88bfbb219b","order":1,"width":"4","height":"4","min":0,"max":"100","sectors":[],"major_division":"10","minor_division":"2","value_decimal_places":1,"scale_decimal_places":0,"label":"","measurement":"Down","units":"MB/s","needles":[{"topic":"","color":"black","lengthPercent":"100"}],"sweep_angle":250,"myclass":"","x":1340,"y":580,"wires":[]},{"id":"4c425322114dad3e","type":"exec","z":"b39000460508d582","command":"speedtest","addpay":false,"append":"","useSpawn":"","timer":"","winHide":false,"name":"Call Speedtest","x":550,"y":660,"wires":[["ccf15a634b561c54"],["662b4dc85acb571e"],["55a14ad9ab99075d"]]},{"id":"b216eeb599f8f33f","type":"debug","z":"b39000460508d582","name":"THIS IS THE MESSAGE","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":970,"y":660,"wires":[]},{"id":"9b25337dad36c116","type":"function","z":"b39000460508d582","name":"Parse the values","func":"//  Get time now.\nlet currentTime = time()\n\nfunction time() {\n    return {\n        time: new Date().toLocaleTimeString('en-GB', { hour12: false })\n    };\n}\n\n//  Extract value.\nconst use_this = currentTime.time\n\n\n// Extract download and upload from msg.payload using regex\nlet payload = msg.payload\n\nlet downloadMatch = payload.match(/Download:\\s+([0-9.]+)\\s+Mbit\\/s/)\nlet uploadMatch = payload.match(/Upload:\\s+([0-9.]+)\\s+Mbit\\/s/)\n\nlet download = downloadMatch ? parseFloat(downloadMatch[1]) : null\nlet upload = uploadMatch ? parseFloat(uploadMatch[1]) : null\n\nreturn [{ payload: upload },{ payload: download },{payload: use_this} ]\n","outputs":3,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":950,"y":590,"wires":[["9f911bf264a37747"],["a95943a269acba3a"],["3084f7137ef25712"]]},{"id":"3084f7137ef25712","type":"trigger","z":"b39000460508d582","name":"","op1":"","op2":" ","op1type":"pay","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1165,"y":660,"wires":[["a0739c8df6f1cfa5"]],"l":false},{"id":"d2a83b806264ee8c","type":"ui-text","z":"b39000460508d582","group":"6f4a6f88bfbb219b","order":0,"width":"2","height":"1","name":"","label":"TIME: ","format":"{{msg.payload}}","layout":"row-spread","style":false,"font":"","fontSize":16,"color":"#717171","wrapText":false,"className":"","x":1350,"y":660,"wires":[]},{"id":"a4eda6eecb36c359","type":"change","z":"b39000460508d582","name":"Error","rules":[{"t":"set","p":"payload","pt":"msg","to":"--== ERROR ==--","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":755,"y":450,"wires":[["3356f32d9cee6b1a","c3f89cd42bfcb661"]],"l":false},{"id":"9734efc198b32b22","type":"junction","z":"b39000460508d582","x":1000,"y":530,"wires":[["a95943a269acba3a","9f911bf264a37747","8a0f2457de496a8a","3084f7137ef25712"]]},{"id":"88740176955f399c","type":"junction","z":"b39000460508d582","x":1230,"y":620,"wires":[["04efd261c4af9dc1","703aedb705463138"]]},{"id":"8faf0d2cb0338722","type":"junction","z":"b39000460508d582","x":820,"y":370,"wires":[["3356f32d9cee6b1a"]]},{"id":"c3f89cd42bfcb661","type":"junction","z":"b39000460508d582","x":830,"y":530,"wires":[["a1e611b0418ff926"]]},{"id":"04efd261c4af9dc1","type":"junction","z":"b39000460508d582","x":1260,"y":530,"wires":[["b1ec61b4728293d2"]]},{"id":"703aedb705463138","type":"junction","z":"b39000460508d582","x":1260,"y":580,"wires":[["55e07fc6e6ad268d"]]},{"id":"a0739c8df6f1cfa5","type":"junction","z":"b39000460508d582","x":1260,"y":660,"wires":[["d2a83b806264ee8c"]]},{"id":"662b4dc85acb571e","type":"junction","z":"b39000460508d582","x":720,"y":690,"wires":[["5ebf8efa2cda36a8","a4eda6eecb36c359"]]},{"id":"6382f8b9642a32d3","type":"junction","z":"b39000460508d582","x":590,"y":530,"wires":[["9ed83ad96f7a8405","c3f89cd42bfcb661","5d5e9423a985e2b3","4c425322114dad3e"]]},{"id":"ccf15a634b561c54","type":"junction","z":"b39000460508d582","x":720,"y":660,"wires":[["9b25337dad36c116","8a0f2457de496a8a","b216eeb599f8f33f"]]},{"id":"6f4a6f88bfbb219b","type":"ui-group","name":"Group 1","page":"b9b507aa5c5840c2","width":"10","height":1,"order":1,"showTitle":false,"className":"","visible":"true","disabled":"false","groupType":"default"},{"id":"b9b507aa5c5840c2","type":"ui-page","name":"Down/Up load speed tester","ui":"379027033ed5c83a","path":"/page1","icon":"home","layout":"flex","theme":"84a68e3f4c6f8cdc","breakpoints":[{"name":"Default","px":"0","cols":"3"},{"name":"Tablet","px":"576","cols":"6"},{"name":"Small Desktop","px":"768","cols":"9"},{"name":"Desktop","px":"1024","cols":"12"}],"order":1,"className":"","visible":"true","disabled":"false"},{"id":"379027033ed5c83a","type":"ui-base","name":"My Dashboard","path":"/dashboard","appIcon":"","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"headerContent":"page","navigationStyle":"default","titleBarStyle":"default","showReconnectNotification":true,"notificationDisplayTime":1,"showDisconnectNotification":true,"allowInstall":true},{"id":"84a68e3f4c6f8cdc","type":"ui-theme","name":"Default Theme","colors":{"surface":"#63452c","primary":"#0094ce","bgPage":"#63452c","groupBg":"#63452c","groupOutline":"#cccccc"},"sizes":{"density":"default","pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

Piccie:

Walk through. :wink:

LED:
blue - ready.
yellow - running test
green - results being shown
red - error

TEST - start the test
HOLD - hold values displayed.
(They are shown for 10 seconds by default.)
WIPE - wipe gauges
TIME - well..... Time of test.

Hope someone likes it.

2 Likes

Thanks Andrew - Great contribution!
I could imagine this in some performance dashboard for a home-lab server cabinet

Something like that.

I was needing to see real time data for my internet connection and so this was born.

1 Like