https://github.com/digitallyrefined/ha-cloudflare-speed-test
Cloudflare Speed Test for Home Assistant
https://github.com/digitallyrefined/ha-cloudflare-speed-test
cloudflare hacs-integration home-assistant speed-test
Last synced: 4 months ago
JSON representation
Cloudflare Speed Test for Home Assistant
- Host: GitHub
- URL: https://github.com/digitallyrefined/ha-cloudflare-speed-test
- Owner: DigitallyRefined
- License: mit
- Created: 2025-03-05T21:15:49.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-09-19T08:49:56.000Z (5 months ago)
- Last Synced: 2025-09-19T10:41:53.159Z (5 months ago)
- Topics: cloudflare, hacs-integration, home-assistant, speed-test
- Language: Python
- Homepage:
- Size: 148 KB
- Stars: 17
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
# Cloudflare Speed Test for Home Assistant
[](https://github.com/DigitallyRefined/ha-cloudflare-speed-test/actions/workflows/hassfest.yaml)
[](https://github.com/DigitallyRefined/ha-cloudflare-speed-test/actions/workflows/hacs_action.yml)
[](https://github.com/custom-components/hacs)


This integration uses the [cloudflarepycli](https://pypi.org/project/cloudflarepycli/) Python library to retrieve network performance statistics from [https://speed.cloudflare.com](https://speed.cloudflare.com) including:
* 90th percentile down/up
* 25MB down
* 10MB down/up
* 1MB down/up
* 100kB down/up
* Latency
* Jitter
* ISP
* IP address
It also attaches the test servers city, region and code to each result.
## Installation
### Using HACS
If you dont' have [HACS](https://hacs.xyz) installed yet, I highly recommend it.
[](https://my.home-assistant.io/redirect/hacs_repository/?owner=DigitallyRefined&repository=ha-cloudflare-speed-test&category=integration)
Or search for `Cloudflare Speed Test` in HACS or copy this GitHub URL and add it as a custom integration repository.
### Manual
[Download the latest `cloudflare_speed_test.zip` release](https://github.com/DigitallyRefined/ha-cloudflare-speed-test/releases) and extract it into your `/custom_component` folder.
### Setup
After installation you need to **restart** Home Assistant before using this integration.
[](https://my.home-assistant.io/redirect/config_flow_start/?domain=cloudflare_speed_test)
Or go to **Settings** -> **Devices & Services**
Click **Add integration** and search for `Cloudflare Speed Test`
## Configuration
By default, a speed test will be run every hour or you can set a custom interval.
If you want to select an exact time when the speed test should run (e.g. to be more specific such as once a day over night) you can disable the default polling interval and create your own timed automation.
To disable polling and create your own timed automation:
1. Go to **Settings** > **Devices & services**, and select the Cloudflare Speed Test integration.
2. On the integration entry, select the hamburger menu icon
* Then, select **System options** and toggle the button to disable polling.
3. To define your custom polling interval, create an automation.
1. Go to [**Settings** > **Automations & scenes**](https://my.home-assistant.io/redirect/automations) and create a new automation.
2. Define any triggers/conditions you like e.g. a time trigger.
3. Select **Add action**, then, select **Other actions**.
4. Select **Perform action**, and from the list, select the [`homeassistant.update_entity` action](https://www.home-assistant.io/integrations/homeassistant/#action-homeassistantupdate_entity) (note: only select one entity, the other entities will be automatically updated).
4. Save the automation to automatically trigger based on your own schedule.
### Add to dashboard

To add graphs to your dashboard, the following YAML can be used:
Expand for dashboard YAML
```yaml
- chart_type: line
period: day
type: statistics-graph
entities:
- sensor.cloudflare_speed_test_90th_percentile_down
- sensor.cloudflare_speed_test_25mb_down
- sensor.cloudflare_speed_test_10mb_down
- sensor.cloudflare_speed_test_1mb_down
- sensor.cloudflare_speed_test_100kb_down
stat_types:
- max
title: Download speed
- chart_type: line
period: day
type: statistics-graph
entities:
- sensor.cloudflare_speed_test_90th_percentile_up
- sensor.cloudflare_speed_test_10mb_up
- sensor.cloudflare_speed_test_1mb_up
- sensor.cloudflare_speed_test_100kb_up
stat_types:
- max
title: Upload speed
- chart_type: line
period: day
type: statistics-graph
entities:
- sensor.cloudflare_speed_test_latency
- sensor.cloudflare_speed_test_jitter
stat_types:
- min
title: Ping
```
## 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](https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/) 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 has the ability to use a considerable amount of data. Frequent updates should be avoided on bandwidth-capped connections.
* While a speed test 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.
* This integration and its author are **not** affiliated or associated with Cloudflare.
## Attribution
Original idea from [@rohankapoorcom, @engrbm87](https://github.com/home-assistant/core/tree/dev/homeassistant/components/speedtestdotnet)