Monitoring Internet Connectivity with Speedtest Logger and Notifications

Hey everyone, I wanted to share my experience with setting up a speedtest logger and notification system. This setup has been incredibly useful, especially after dealing with some unreliable internet connectivity in my previous apartment. Let me walk you through how I approached this and how it’s benefiting my current setup.

Why I Started Logging Speedtests

I remember the days when my internet connection would act up, and the ISP couldn’t pinpoint the issue. The technician would always check the connection when everything was working fine, leaving me frustrated. After a couple of months of back-and-forth, I decided to take matters into my own hands. I started logging speedtests every 15 minutes, storing the data in InfluxDB, and creating detailed charts to present to my ISP. This approach eventually led to them identifying and fixing an old cable that was causing interference.

My Current Setup

Now, I’m living in a new place with fibre-to-the-building connectivity, which is much more stable. However, I’ve kept the logging system in place as a precaution. Here’s what my setup entails:

Components Used

  • Speedtest Binding by bhomeyer
  • Speedtest CLI by Ookla
  • Rule to download and store speedtest results as images

Requirements

  • OpenHAB 3.1
  • Running InfluxDB and Grafana
  • Speedtest binding
  • Optional: A separate OpenHAB instance for speedtest logging

Key Features

  • Logs every speedtest result in InfluxDB
  • Displays results in Grafana
  • Sends notifications when download/upload speeds drop below predefined thresholds
  • Includes speedtest result images with notifications

Setting It Up

  1. Prepare a Virtual Machine (Optional)

    • Install Debian on a VM and set up OpenHABian.
    • Configure the VM with a dedicated Ethernet port for speedtesting.
  2. Install Speedtest CLI

    • Follow the official installation guide from Ookla.
    • Ensure the CLI is executable by the openhab user.
  3. Configure the Speedtest Binding

    • Download the latest release of the speedtest binding.
    • Add the binding in OpenHAB and configure it with your preferred server ID.
  4. Create Items and Rules

    • Define items to store speedtest results and trigger tests.
    • Implement a rule to reset the test trigger after each use.
  5. Connect Instances with Remote OpenHAB Binding

    • Install the remote OpenHAB binding on your main instance.
    • Configure it to communicate with the speedtest instance using an API token.
  6. Process and Display Results

    • Use rules to download speedtest result images and store them.
    • Set up thresholds for notifications based on your ISP’s contracted speeds.
  7. Sitemap Configuration

    • Display speedtest results, control buttons, and images in a user-friendly interface.

Grafana Integration

I’m still working on optimizing Grafana charts to visualize the speedtest data effectively. Grafana’s interface has evolved since my last setup, so I’m exploring new ways to present the information clearly.

Conclusion

This system has been a game-changer for monitoring my internet connection. It not only provides peace of mind but also serves as a powerful tool if I ever need to troubleshoot connectivity issues with my ISP. I hope this guide inspires others to set up similar monitoring solutions. If anyone has suggestions or improvements, I’d love to hear them!

Cheers,
Michael