Slow Internet Warning
From time to time ISP fails, and don't deliver the advertised speed. You could get a Fingbox to monitor your speed and provide you with monthly statistics, or you make the monitor yourself.
Instructions: You can read all set up instructions here
Unless your speeds are not in excess of 100Mbps, you will need to use RaspberryPi 4 (or similar with 1Gbit Ethernet) to make sure your results are not hindered by the network interface.
Features:
- Google Home, Android, Alexa, and Windows 10 Notifications
- Automatic Tweets at ISP (if you are evil 😈)
- Retest options to limit false positives
- 24h Chart
You will need the following nodes:
- node-red-contrib-cast (for google home)
- node-red-contrib-join-joaoapps (for android)
- node-red-dashboard (for charts)
- node-red-contrib-alexa-notifyme
- node-red-contrib-speedtest
and Join app for Android notifications
Settings
- lowspeed set the low limit threshold
- handle provide Twitter handle of your ISP to annoy them
- defaultspeed promised Internet speed by ISP
- tests - number of confirmation tests
More about me:
If you want to get the latest updates to this project you can follow me via your preferred social media:
And if you feeling like buying me a coffee or supporting me in a more continuous way:
I hope you have enjoyed the project!
[{"id":"7fac0b0a.91eb24","type":"subflow","name":"Speed Config","info":"","category":"","in":[{"x":440,"y":80,"wires":[{"id":"c39df40d.c38f48"}]}],"out":[{"x":660,"y":80,"wires":[{"id":"c39df40d.c38f48","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"c39df40d.c38f48","type":"function","z":"7fac0b0a.91eb24","name":"","func":"var x = env.get(\"lowSpeed\"); \nvar handle = env.get(\"handle\"); \nvar tests = env.get(\"tests\"); \nvar speed = env.get(\"defaultspeed\");\n\nflow.set(\"$parent.lowSpeed\", x);\nflow.set(\"$parent.handle\", handle); \nflow.set(\"$parent.tests\", tests); \nflow.set(\"$parent.defaultspeed\", speed);\n\nmsg.payload = \"The trigger speed is: \"+x+ \" over \" +tests+ \" tests your ISP handle is \" + handle;\n\nreturn msg;\n","outputs":1,"noerr":0,"x":550,"y":80,"wires":[[]]},{"id":"fc059357.a9133","type":"tab","label":"Slow Internet Warning","disabled":false,"info":"From time to time ISP fails, and don't deliver the advertised speed. You could get a [Fingbox to monitor your speed](https://notenoughtech.com/news/fingbox-updates-help-argue-isp/) and provide you with monthly statistics, or you make the monitor yourself.\n\n\n**Instructions:**\nYou can read all [set up instructions here]([https://notenoughtech.com/home-automation/slow-internet-warning/](https://notenoughtech.com/home-automation/slow-internet-warning/))\n\n---\n\nUnless your speeds are not in excess of 100Mbps, you will need to use **RaspberryPi 4** (or similar with 1Gbit Ethernet) to make sure your results are not hindered by the network interface.\n\n**Features**:\n\n- Google Home, Android, Alexa, and Windows 10 Notifications \n- Automatic Tweets at ISP (if you are evil 😈) \n- Retest options to limit false positives \n- 24h Chart \n\n**You will need the following nodes:**\n\n - node-red-contrib-cast (for google home)\n - node-red-contrib-join-joaoapps (for android)\n - node-red-dashboard (for charts)\n - node-red-contrib-alexa-notifyme\n - node-red-contrib-speedtest\n\nand [Join app](https://play.google.com/store/apps/details?id=com.joaomgcd.join&hl=en_GB) for Android notifications \n\n\n---\n\n\n# Settings\n - **lowspeed** set the low limit threshold\n - **handle** provide Twitter handle of your ISP to annoy them\n - **defaultspeed** promised Internet speed by ISP\n - **tests** - number of confirmation tests"},{"id":"5afc4c55.4bb224","type":"speedtest","z":"fc059357.a9133","name":"","maxTime":"10000","x":400,"y":260,"wires":[["4707831b.e50ffc","5cd7b785.4f9b78"]]},{"id":"1b0973c5.3e228c","type":"inject","z":"fc059357.a9133","name":"test every 1h","topic":"","payload":"","payloadType":"date","repeat":"3600","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":260,"wires":[["5afc4c55.4bb224"]]},{"id":"4c91a538.23556c","type":"ui_chart","z":"fc059357.a9133","name":"","group":"f5370b5f.718798","order":0,"width":"18","height":"8","label":"Virgin Media Broadband","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"{{msg.topic}}","dot":true,"ymin":"0","ymax":"120","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#03cf41","#2716fa","#14affa","#cc0000","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":850,"y":220,"wires":[[]]},{"id":"4707831b.e50ffc","type":"function","z":"fc059357.a9133","name":"Display Data","func":"var download = msg.payload.speeds.download;\nvar ulopad = msg.payload.speeds.upload;\nvar isp = msg.payload.client.isp;\nvar defaultspeed = flow.get(\"defaultspeed\");\nvar lowSpeed = flow.get(\"lowSpeed\");\n\n\nvar msg1 = {payload: ulopad,\n \n topic:\"upload\",\n isp: isp\n};\nvar msg2 = {payload: download,\n \n topic:\"download\",\n isp: isp\n};\nvar msg3 = {payload: defaultspeed,\n \n topic:\"advertised\",\n isp: isp\n};\n\nvar msg4 = {payload: lowSpeed,\n \n topic:\"threshold\",\n isp: isp\n};\n\nreturn [msg1, msg2, msg3, msg4];\n\n\n","outputs":4,"noerr":0,"x":630,"y":220,"wires":[["4c91a538.23556c"],["4c91a538.23556c"],["4c91a538.23556c"],["4c91a538.23556c"]]},{"id":"5cd7b785.4f9b78","type":"function","z":"fc059357.a9133","name":"Investigate","func":"var count = context.get(\"count\");\nvar total = flow.get(\"lowAverageSpeed\");\nvar download = msg.payload.speeds.download;\nvar targetspeed = flow.get(\"lowSpeed\");\nvar tests = flow.get(\"tests\");\nvar defaultspeed = flow.get(\"defaultspeed\");\nvar handle = flow.get(\"handle\");\n\n\n//check if array exists\nif(!total || !total.length || total === undefined){\n total = [];\n }\n\nvar z = isNaN(count);\n\nif(z === true){\n count = 0;\n context.set(\"count\", count);\n}\n\nif(download <= targetspeed){\n\n if(z === false){\n if(count <= tests){\n count = count + 1;\n context.set(\"count\", count);\n //push element\n total.unshift(download);\n //remove X elementh\n if(total[tests] === undefined) {\n \n flow.set(\"lowAverageSpeed\", total);\n }\n else {\n total.splice(tests, 1);\n flow.set(\"lowAverageSpeed\", total);\n }\n }\n //if speed is still below the target \n if(count > tests){\n context.set(\"count\", 0);\n //calculate average\n var sum = total;\n var average = Math.round(sum.reduce(add)/tests);\n total.splice(0,total.length);\n if(average <= targetspeed){\n msg.info = {\n \"isp\": msg.payload.client.isp,\n \"average\": average,\n \"lastDL\": msg.payload.speeds.download,\n \"lastUL\": msg.payload.speeds.upload\n }\n \n return[null, msg];\n }\n }\n }\n }\nif(download > targetspeed){\n context.set(\"count\", 0);\n total.splice(0,total.length);\n return [null, null];\n}\n\nfunction add(accumulator, a) {\n return accumulator + a;\n }\n\nmsg.payload = average;\n\nreturn [msg, null];","outputs":2,"noerr":0,"x":630,"y":320,"wires":[["10478b4c.105295"],["93d431d7.dfc4c","c8cba6.1b42e458","e9be01bd.c45c5","488be2a6.f8395c"]]},{"id":"3faf98b5.2f8bf8","type":"speedtest","z":"fc059357.a9133","name":"","maxTime":"10000","x":720,"y":480,"wires":[["5cd7b785.4f9b78","4707831b.e50ffc"]]},{"id":"8f081cf5.5b84f","type":"subflow:7fac0b0a.91eb24","z":"fc059357.a9133","name":"","env":[{"name":"lowSpeed","value":"30","type":"num"},{"name":"handle","value":"@virginmedia","type":"str"},{"name":"tests","value":"3","type":"num"},{"name":"defaultspeed","value":"110","type":"num"}],"x":380,"y":100,"wires":[["d5e8e0ef.7e91a"]]},{"id":"54307a5f.2bbd04","type":"inject","z":"fc059357.a9133","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":100,"wires":[["8f081cf5.5b84f"]]},{"id":"d5e8e0ef.7e91a","type":"debug","z":"fc059357.a9133","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":560,"y":100,"wires":[]},{"id":"34e0e74f.09dae8","type":"twitter out","z":"fc059357.a9133","twitter":"","name":"Tweet","x":1330,"y":500,"wires":[]},{"id":"423dc3f4.0319ec","type":"comment","z":"fc059357.a9133","name":"Test loop","info":"","x":620,"y":520,"wires":[]},{"id":"789c1bf2.2cb034","type":"join-message","z":"fc059357.a9133","name":"","text":"","title":"","url":"","notificationicon":"","joinConfig":"43463bd8.73c264","x":1340,"y":420,"wires":[[]]},{"id":"e9be01bd.c45c5","type":"function","z":"fc059357.a9133","name":"Compose Push","func":"var handle = flow.get(\"handle\");\nvar defaultspeed = flow.get(\"defaultspeed\");\nvar average = msg.info.average;\nvar isp = msg.info.isp;\n\nvar id1 = global.get('JOINmi9');\nvar id2 = global.get('JOINdesktop');\n\nmsg.push = {\n \"deviceIds\": id2,\n \"title\":\"The Internet speed warning\",\n \"text\":\"The Internet speed is \" +average+\"Mbps out of \"+defaultspeed+\"Mbps. Looks like \"+isp+ \" sucks again\",\n \"icon\":\"https://doc-0k-9k-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/d35rtaa7bl3d8elcjd6koa8pk5646dnu/1570968000000/04123719101998194317/*/11CUYP4yD7iJBVc_bMmVLoZz7rRRaHAmZ?e=view\"\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":1120,"y":420,"wires":[["789c1bf2.2cb034"]]},{"id":"91d3c002.5152","type":"alexa-notifyme","z":"fc059357.a9133","name":"Alexa Notification","notification":"","x":1370,"y":260,"wires":[[]]},{"id":"93d431d7.dfc4c","type":"function","z":"fc059357.a9133","name":"Alexa Notification","func":"var handle = flow.get(\"handle\");\nvar defaultspeed = flow.get(\"defaultspeed\");\nvar average = msg.info.average;\nvar isp = msg.info.isp;\n\n//get HH:MM\nvar time = new Date();\nvar timestamp = time.getHours() +\":\"+ time.getMinutes();\n\nmsg.payload = \"The Internet speed at \"+ timestamp + \"was \"+average+\"Mbps out of \"+defaultspeed+\"Mbps. Looks like \"+isp+ \" sucks again\";\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":260,"wires":[["91d3c002.5152"]]},{"id":"c76df89e.9fc4a8","type":"cast-to-client","z":"fc059357.a9133","name":"Google Home","url":"","contentType":"","message":"","language":"en","ip":"192.168.1.174","port":"","volume":"","x":1360,"y":340,"wires":[[]]},{"id":"1e71fc73.a50384","type":"comment","z":"fc059357.a9133","name":"Speed above threshold","info":"","x":740,"y":280,"wires":[]},{"id":"48e40dd7.383fc4","type":"comment","z":"fc059357.a9133","name":"Still low after X tests","info":"","x":730,"y":360,"wires":[]},{"id":"488be2a6.f8395c","type":"function","z":"fc059357.a9133","name":"Compose Tweet","func":"var handle = flow.get(\"handle\");\nvar defaultspeed = flow.get(\"defaultspeed\");\nvar average = msg.info.average;\n\n//tweet\nmsg.payload = \"Hey \" + msg.payload.client.isp + \n \" (\"+handle+\") what's going on with my Internet, the speed dropped to \" + \n average + \"Mbps from \" + defaultspeed + \"Mbps.\";\n \nreturn msg;","outputs":1,"noerr":0,"x":1120,"y":500,"wires":[["34e0e74f.09dae8"]]},{"id":"c8cba6.1b42e458","type":"function","z":"fc059357.a9133","name":"Google Notification","func":"var handle = flow.get(\"handle\");\nvar defaultspeed = flow.get(\"defaultspeed\");\nvar average = msg.info.average;\nvar isp = msg.info.isp;\n\nmsg.payload = \"The Internet speed is \"+average+\"Mbps out of \"+defaultspeed+\"Mbps. Looks like \"+isp+ \" sucks again\";\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":340,"wires":[["c76df89e.9fc4a8"]]},{"id":"10478b4c.105295","type":"delay","z":"fc059357.a9133","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":540,"y":480,"wires":[["3faf98b5.2f8bf8"]]},{"id":"7bbd806e.ef9ca","type":"comment","z":"fc059357.a9133","name":"Tweet to ISP","info":"","x":1050,"y":460,"wires":[]},{"id":"b91da2a4.d66ce","type":"comment","z":"fc059357.a9133","name":"Android Notification","info":"","x":1070,"y":380,"wires":[]},{"id":"86072b60.741728","type":"comment","z":"fc059357.a9133","name":"Google Home Alert","info":"","x":1070,"y":300,"wires":[]},{"id":"63332cb8.f042a4","type":"comment","z":"fc059357.a9133","name":"Alexa Notification","info":"","x":1060,"y":220,"wires":[]},{"id":"c5b382e9.70747","type":"comment","z":"fc059357.a9133","name":"Settings","info":"","x":280,"y":60,"wires":[]},{"id":"eca8a784.d78048","type":"inject","z":"fc059357.a9133","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":740,"y":660,"wires":[["e9be01bd.c45c5"]]},{"id":"f5370b5f.718798","type":"ui_group","z":"","name":"Default","tab":"7251a0d8.e5953","disp":true,"width":"18","collapse":false},{"id":"43463bd8.73c264","type":"join-config","z":"","name":"Join Configuration","register":true},{"id":"7251a0d8.e5953","type":"ui_tab","z":"","name":"Speed Test","icon":"dashboard","order":6,"disabled":false,"hidden":false}]