Speedtest.net

The Speedtest.net integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] uses the Speedtest.net web service to measure network bandwidth performance.

Configuration

To add the Speedtest.net service to your Home Assistant instance, use this My button:

Manual configuration steps

If the above My button doesn’t work, you can also perform the following steps manually:

  • Browse to your Home Assistant instance.

  • Go to Settings > Devices & services.

  • In the bottom right corner, select the Add Integration button.

  • From the list, select Speedtest.net.

  • Follow the instructions on screen to complete the setup.

Most Speedtest.net servers require TCP port 8080 outbound to function. Without this port open you may experience significant delays or no results at all. See note on their help page.

By default, a speed test will be run every hour. You can disable polling using system options and use the update_entity action to automate the speed test frequency.

If you want to define a specific interval at which your device is being polled for data, you can disable the default polling interval and create your own polling automation.

To turn off the default polling and create your own polling automation, follow these steps:

  1. Go to Settings > Devices & services, and select your integration.
  2. On the integration entry, select the three dots menu, and then select System options.
  3. Turn off Enable polling for changes, and then select Update.
    • If Home Assistant asks you to restart, restart it.
  4. Go to Settings > Automations & scenes, and select Create automation > Create new automation.
  5. Add the triggers and conditions for when you want to poll for data.
  6. Select Add action, select By type, select Perform action, and then select + next to Perform action.
  7. Under Action, search for and select the Update entity action.
  8. Under Entities to update, select the entities you want to poll.
    • You can only select entities. Areas, devices, and labels aren’t supported.
  9. Select Save.

Many integrations update their data at most once every 10 seconds. If you poll more often, Home Assistant waits until the 10 seconds have passed before it updates the data again.

Configuration options

After setup, you can choose which server the speed test runs against. Go to Settings > Devices & services, select the Speedtest.net integration, and then select the cogwheel (Configure).

Select test server

The Speedtest.net server to use for tests. Select *Auto Detect to automatically choose a server. Defaults to *Auto Detect.

Integration sensors

The following sensors are added by the integration:

sensors:

  • Ping sensor: Reaction time in ms of your connection (how fast you get a response after you’ve sent out a request).
  • Download sensor: The download speed (Mbit/s).
  • Upload sensor: The upload speed (Mbit/s).

This integration uses speedtest-cli to gather network performance data from Speedtest.net. Please be aware of the potential inconsistencies that this integration may display.

Examples

In this section you will find some real-life examples of how to use this integration.

Using as a trigger in an automation

# Example configuration.yaml entry
automation:
  - alias: Turn On Green Light When Download Speed Is Good
    description: >-
      This automation turns on the Yeelight bulb with a green color when the
      download speed exceeds 10 megabits per second.
      It ensures that the light is an indicator of the health of your
      network connection.
    triggers:
      - trigger: template
        value_template: "{{ states('sensor.speedtest_download') | float >= 10 }}"
    actions:
      - action: light.turn_on
        target:
          entity_id: light.yeelight_bulb
        data:
          rgb_color: [0, 100, 0]

  - alias: Turn On Red Light When Download Speed Is Poor
    description: >-
      This automation turns on the Yeelight bulb with a red color when the
      download speed drops below 10 megabits per second.
      It ensures that the light is an indicator of the health of your
      network connection.
    triggers:
      - trigger: template
        value_template: "{{ states('sensor.speedtest_download') | float < 10 }}"
    actions:
      - action: light.turn_on
        target:
          entity_id: light.yeelight_bulb
        data:
          rgb_color: [255, 0, 0]

Notes

  • When running on Raspberry Pi the maximum speed is limited by the LAN adapter. The Raspberry Pi 3+ models come with a Gigabit LAN adapter which supports a maximum throughput of 300 Mbit/s.
  • Running this integration can have negative effects on the system’s performance as it requires a fair amount of memory.
  • If run frequently, this integration can use a considerable amount of data. Frequent updates should be avoided on bandwidth-capped connections.
  • While the speedtest is running your network capacity is fully utilized. This may have a negative effect on other devices using the network such as gaming consoles or streaming boxes.

Removing the integration

This integration follows standard integration removal. No extra steps are required.

To remove an integration instance from Home Assistant

  1. Go to Settings > Devices & services and select the integration card.
  2. Next to the entry you want to remove, select the three dots menu. Then, select Delete.
    • Depending on the integration, the entries are listed under one of the following headings:
      • Devices
      • Hubs
      • Services
      • Integration entries
  3. To confirm, select Delete.
    • Home Assistant also deletes the devices and entities of the entry.
  4. If Home Assistant asks you to restart, restart Home Assistant.
  5. If Home Assistant asks whether to also delete the application credentials, select Remove or Keep.