Official Speedtest.net integration has been broken, from time to time, either from speedtest-cli or Home Assistant changes. There is an alternative in running a separate Docker of Speedtest Tracker (not affiliated) as it includes an API (available at /api/speedtest/latest
) and importing the results in Home Assistant are fairly easy:
Example of API results: {“message”:“ok”,“data”:{“id”:123456789,“ping”:9.467,“download”:1880.9072,“upload”:817.7248,“server_id”:123456789,“server_host”:“speedtest.xxx.xx:8080”,“server_name”:“XXXXXXXXXXX”,“url”:“https://www.speedtest.net/result/c/123456789-123456789-123456789-123456789-123456789”,“scheduled”:true,“failed”:false,“created_at”:“2024-01-23T08:00:20.000000Z”,“updated_at”:“2024-01-23T08:00:20.000000Z”}}
As the Speedtest requires a fair amount of computing power, running it on a separate machine can be useful in cases where the Home Assistant instance runs on a low performance hardware (Raspberry Pi, low power NUCs, etc.) or when a multi-gigabit network card is a available to a server grade machine but not to Home Assistant.
- platform: rest
resource: http://192.168.0.46:45043/api/speedtest/latest
name: Download Speed
value_template: "{{ value_json['data']['download'] }}"
unit_of_measurement: Mbps
unique_id: '0100000000001'
- platform: rest
resource: http://192.168.0.46:45043/api/speedtest/latest
name: Upload Speed
value_template: "{{ value_json['data']['upload'] }}"
unit_of_measurement: Mbps
unique_id: '0100000000002'
- platform: rest
resource: http://192.168.0.46:45043/api/speedtest/latest
name: Ping
value_template: "{{ value_json['data']['ping'] }}"
unit_of_measurement: ms
unique_id: '0100000000003'
If planning to share the results, or view them at a later time, an URL sensor can be imported.
- platform: rest
resource: http://192.168.0.46:45043/api/speedtest/latest
name: URL
value_template: "{{ value_json['data']['url'] }}"
unique_id: '0100000000004'
Also, remainder of API values (server_id, server_host, server_name, scheduled, failed, created_at, updated_at) can be useful for serving additional sensors.
Home Assistant card:
Speedtest Tracker card: