⏩ Running A Daily Internet Speed Test

GitHub Gist: Running A Daily Internet Speed Test Using A Home Assistant Blueprint · GitHub

There might be a number of reasons you want to monitor your internet speed: troubleshooting speed issues, checking that your ISP is delivering what they’ve promised, or just plain curiosity. The Speedtest integration is useful, but by default - it runs hourly, which will almost certainly impact any other activities that are happening, e.g. streaming, video calls, games, etc. To keep this sensor in check, we are going to set-up an Automation to run daily at a quieter time.

For a more advanced manual configuration of the speedtest, check out: Configuring an Internet Speed Test sensor in Home Assistant | by Cyan Automation | Medium

Prerequisites

You will need to complete the following pre-requisites to get this blueprint to work correctly.

  1. Install the Speedtest integration
  2. Set the intergration to run manually, this can be done by going into Integrations, selecting Options on the right Speedtest tile, then checking the box next to Disable auto update.

Blueprint

Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

blueprint:
  name: Running A Daily Internet Speed Test
  description: This automation schedules and runs an internet speed test, at a convenient time just once a day. Note that you will need to have the Speedtest integration installed, and most importantly, and set to Disable auto update.
  domain: automation
  input:
    # Capture a time to run the automation 
    run_time:
      name: Test Run Time
      description: This is the time that the speed test will run each day
      # Use a selector, to pick the scheduled time
      selector:
        time: {}
      # Provide a default value
      default: "23:30:00"

# Prevent the automation from running concurrently
mode: single

# Define the variables used in the action section
variables:
  run_time: !input run_time

# Define the trigger for the automation
trigger:
  # Using the defined time as the trigger
  platform: time
  at: !input run_time

# This section will take action and run the relevant service
action:
  - service: speedtestdotnet.speedtest

Changelog

  • 2020-12-31: Initial version

First Time Working With Blueprints?

How To Import Blueprints

Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

you can already do this with the built-in functionality of the integration with no automation required.

2 Likes

Marc,

I use your Speedtest Blueprint in an automation. Thank you for preparing the Blueprint, I find it very useful.

However, I am getting warnings in my log that “The “speedtest” service is deprecated and will be removed in “2022.11.0”; use the “homeassistant.update_entity” service and pass it a target Speedtest entity_id”.

Do you plan to update the Blueprint please?

If not, please can you confirm that the update I will need to make in the Blueprint is:

action:
- service: speedtestdotnet.speedtest

Becomes:

action:
- service: homeassistant.update_entity
  target:
    entity_id:
    - sensor.speedtest_download
    - sensor.speedtest_upload
    - sensor.speedtest_ping

Many thanks for any help.

2 Likes

I made it like this:

action:
  - service: homeassistant.update_entity
    data: {}
    target:
      entity_id:
        - sensor.speedtest_download
        - sensor.speedtest_upload
        - sensor.speedtest_ping

And this is working fine.

Kind regards,
Lieven

1 Like

Lieven,

Thanks for your reply, much appreciated.

Our solutions look very similar and mine does also work, but I’m relatively new to Home Assistant, to programming etc. and am keen to learn more.

Apart from the differences in our indentation (which I think are acceptable in YAML?) I’d like to know what “data: {}” in your solution is for. Please can you explain that for me?

Many thanks again.

Hey @markck101

I got my configuration by updating the automation in ‘GUI mode’ in the web interface of home assistant and then navigating to ‘display as YAML’. The data: {} section was there, I assume it is some kind of default empty assignment.

I agree with you that it is very likely that your and my configuration are functionally identical.

Best regards and have fun with HomeAssistant!
Lieven

Thanks Lieven.

I must try to make more use of the GUI and ‘display as YAML’ - I’m sure I can learn lots by doing things that way.

Thanks again and all the best…