Home Home Automation Slow Internet Warning

Slow Internet Warning

Where is my Internet???

From time to time your ISP fails and the promised Internet speed drops below what’s acceptable. If the slow internet speed isn’t caused by local network traffic, chances are it’s your ISP that is not delivering on the contractual agreements due to technical reasons (or else). Inspired by Fingbox feature and a profile I made earlier to use Google Home to measure the Internet speed, I created the Slow Internet Warning system that works with your smart home.

Bad ISP? Get a warning and Tweet at them!

I know that tweeting at ISP has been done before, but I wanted to bring something special to the table. This project will not only monitor your Internet speed 24/7 but also notifies you and your smart home in more than one way!


  • Alexa notifications
  • Google Home alerts
  • Android Notifications
  • Windows 10 Notifications
  • 24h Charts
  • Custom number of tests
  • Tweeter alerts

The Slow Internet Warning system will periodically check your Internet speed. I could finally take advantage of the 1Gbit Ethernet on my Raspberry Pi 4 to monitor my network (I get speeds in excess of 100Mbits).

I would strongly recommend getting a 1Gbit compatible board (Raspberry Pi 4) unless your ISP contractual speed is way below 100Mbits, otherwise, your results may not be accurate. Note that even with 10/100 Ethernet it’s possible to monitor low speeds.

If the Internet speed drops below a predefined value, the Slow Internet Warning system will start measuring it X times over a shorter period of time to make sure this was not a traffic spike. If the Internet speed is still low, warnings are sent to the devices of your choice with an option to automatically tweet at your ISP to start the conversation about the possible discounts this month!

NodeRED and Slow Internet Warning

There are a couple of nodes that you need to instal to make this work. I used the following nodes in my script:

 node-red-contrib-cast (for google home)
 node-red-contrib-join-joaoapps (for android)
 node-red-dashboard (for charts)

To send the notifications for Windows 10 and Android I will use Join app. It works great for simple notifications. Anything more complicated would require Perfect Notifications 2.0.


I’m taking advantage of NodeRED 1.0 release and the custom subflow variables to set the settings for the project. You will need to provide the following info:

  • lowspeed set the low limit threshold
  • handle provide the Twitter handle of your ISP to annoy them
  • defaultspeed promised Internet speed by ISP
  • tests – number of confirmation tests


Thanks to speedtest node, the entire process is very simple, trigger the speedtest node every X min, and monitor the result. It gets somehow complicated when it comes to calculating what constitutes the low Internet speed.

If the Internet speed fails to go over the set threshold, the Internet is then a subject to further evaluation. There is a smaller loop in place which will make consecutive tests.

If the average of these tests still falls below the threshold, the notifications are triggered. To break the loop, the threshold level tests have to be done X times (tests) or the value of the subsequent test has to go over the threshold indicating that the network issue was only temporary.

Function Node: Investigate
var count = context.get("count");
var total = flow.get("lowAverageSpeed");
var download = msg.payload.speeds.download;
var targetspeed = flow.get("lowSpeed");
var tests = flow.get("tests");
var defaultspeed = flow.get("defaultspeed");
var handle = flow.get("handle");

//check if array exists
if(!total || !total.length || total === undefined){
        total = [];

var z = isNaN(count);

if(z === true){
    count = 0;
    context.set("count", count);

if(download <= targetspeed){

    if(z === false){
        if(count <= tests){
            count = count + 1;
            context.set("count", count);
            //push element
            //remove X elementh
            if(total[tests] === undefined) {
                flow.set("lowAverageSpeed", total);
            else {
                total.splice(tests, 1);
                flow.set("lowAverageSpeed", total);
    //if speed is still below the target    
        if(count > tests){
            context.set("count", 0);
            //calculate average
            var sum = total;
            var average = Math.round(sum.reduce(add)/tests);
            if(average <= targetspeed){
                msg.info = {
                    "isp": msg.payload.client.isp,
                    "average": average,
                    "lastDL": msg.payload.speeds.download,
                    "lastUL": msg.payload.speeds.upload
                return[null, msg];
if(download > targetspeed){
    context.set("count", 0);
    return [null, null];

function add(accumulator, a) {
            return accumulator + a;

msg.payload = average;

return [msg, null];

A couple of words about Notifications


I’m using Alexa NotifyMe skill, to create a pending notification on my Alexa devices. For the most part, everything stays the same, but I wanted to add a timestamp to the message so I would know when the outage occurred.

Function Node: Alexa Notification
var handle       = flow.get("handle");
var defaultspeed = flow.get("defaultspeed");
var average      = msg.info.average;
var isp          = msg.info.isp;

//get HH:MM
var time = new Date();
var timestamp = time.getHours() +":"+ time.getMinutes();

msg.payload = "The Internet speed at "+ timestamp + "was "+average+"Mbps out of "+defaultspeed+"Mbps. Looks like "+isp+ " sucks again";
return msg;
Google Home

To get Google Home talking, I used the Cast node. Since I cannot create a pending notification, your voice note will be played only at the time of the outage. That’s ok, we have android notifications too if you missed the announcement.

Function Node: Google Notification
var handle       = flow.get("handle");
var defaultspeed = flow.get("defaultspeed");
var average      = msg.info.average;
var isp          = msg.info.isp;

msg.payload = "The Internet speed is "+average+"Mbps out of "+defaultspeed+"Mbps. Looks like "+isp+ " sucks again";
return msg;
Android and Windows 10

Both, Android and Windows will use simple Join messages to receive updates about the conditions of your network. The notification is simple, but you probably want to read the trick about the icons below!

You could hardcode the API keys, but I used my credential system to serve it from global variables.

Function Node: Compose Push
var handle       = flow.get("handle");
var defaultspeed = flow.get("defaultspeed");
var average      = msg.info.average;
var isp          = "msg.info.isp;

var id1 = global.get('JOINmi9');
var id2 = global.get('JOINdesktop');

msg.push = {
    "deviceIds": id2,
    "title":"The Internet speed warning",
    "text":"The Internet speed is " +average+"Mbps out of "+defaultspeed+"Mbps. Looks like "+isp+ " sucks again",

return msg;
Tweet at ISP

You will have to apply for the Twitter API. It was granted quickly for my account, so I don’t expect you to wait long. Once you provide all the tokens to authorise the tweets, you will be able to tweet at your ISP about the outages.

Do not provide them with any information about your account in that tweet. Also, be very careful about scammers. My last interaction with Virgin Media on Twitter ended up with a spoof account DM me minutes after the official account responded back to me asking for card details.

Function Node: Compose Tweet
var handle       = flow.get("handle");
var defaultspeed = flow.get("defaultspeed");
var average      = msg.info.average;

msg.payload = "Hey " + msg.payload.client.isp + 
               " ("+handle+") what's going on with my Internet, the speed dropped to " + 
               average + "Mbps from " + defaultspeed + "Mbps.";
return msg;


Even if you don’t have a spare Raspberry Pi 4, you can use this to monitor your internet speed. You won’t get accurate results if your Internet is faster than 10/100 interface, but you will be able to tell if your ISP dropped the speed significantly!

Let me know what do you think about this project, and feel free to share your internet charts in this Reddit thread.

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.


Nothing says "Thank you" better than keeping my coffee jar topped up!


Support me on Patreon and get an early access to tutorial files and videos.


Bitcoin (BTC)

Use this QR to keep me caffeinated in style with crypto-currency

Smart Ideas with

Automate your space in with these ecosystems and integrate it with other automation services

Learn NodeRED

NodeRED for beginners: 1. Why do you need a NodeRED server?

To server or not to server? That's a very silly question!

Best Automation Projects

ESP8266 WIFI lights under $5

Your Sonoff device can't do this!

Free wireless doorbell (Amazon Dash button hack)

The most terrifying situation I can imagine* is missing a parcel

New Amazon Dash Buttons

You can teach new buttons old tricks!

ESP8266 ceiling light – demo

Testing the ESP8266 as a WIFI light controller

Try Tasker and Raspberry Pi for your home automation needs!

Raspberry Pi can help you with your Tasker profiles

Smart Home

If Edison made smart lights: OEEONE ZigBee lightbulb

OEEONE ZigBee lightbulb may look vintage, but packs the latest ZigBee protocol

Zemismart Zigbee switch

Zemismart Zigbee switch to control the light and your wall switch!

IFTTT Pro Alternative: Alexa ed.

Bypass IFTTT Pro restrictions for Alexa voice actions with this IFTTT Pro Alternative

The answer to almost all Echo needs: Alexa-remote2

Alexaremote2 is a Swiss army knife for Amazon Echo devices. Connect, control and listen to all Alexa enabled gadget at home.

This ESP32 is on FIRE! – M5Stack Core

This ESP kit is on fire! M5Stack Core merges IoT platform and learning in a very polished stackable module.