This integration uses the cloudflarepycli Python library to retrieve network performance statistics from 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.
If you dont' have HACS installed yet, I highly recommend it.
Or search for Cloudflare Speed Test
in HACS or copy this GitHub URL and add it as a custom integration repository.
Download the latest cloudflare_speed_test.zip
release and extract it into your <config>/custom_component
folder.
After installation you need to restart Home Assistant before using this integration.
Or go to Settings -> Devices & Services
Click Add integration and search for Cloudflare Speed Test
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:
- Go to Settings > Devices & services, and select the Cloudflare Speed Test integration.
- On the integration entry, select the hamburger menu icon
- Then, select System options and toggle the button to disable polling.
- To define your custom polling interval, create an automation.
- Go to Settings > Automations & scenes and create a new automation.
- Define any triggers/conditions you like e.g. a time trigger.
- Select Add action, then, select Other actions.
- Select Perform action, and from the list, select the
homeassistant.update_entity
action (note: only select one entity, the other entities will be automatically updated).
- Save the automation to automatically trigger based on your own schedule.
To add graphs to your dashboard, the following YAML can be used:
Expand for dashboard 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
- 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 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.
Original idea from @rohankapoorcom, @engrbm87