Speedtest not producing results only if triggered via automation

Hey there!

Speedtest integration work flawlessly on “auto-update” mode, no problem there.

It also works perfectly fine if triggered manually via dashboard UI.
However, even though It seems to run every hour, the automation doesn’t produce the intended results and the widget displays “entity is currently unavailable” error.

Here is the automation in YAML mode (originally created via visual editor).

alias: Speedtest Manual Trigger
description: Manual trigger of speedtest (hourly)
trigger:
  - platform: time_pattern
    hours: /1
condition: []
action:
  - service: speedtestdotnet.speedtest
mode: single

Any ideas would be appreciated :pray:

PS: I can confirm that the problem is not version-dependent, I’ve been having this problem for a while.

Home Assistant 2021.12.9
Home Assistant OS 7.1
Raspberry Pi 4 - 64bit

1 Like

The same happens for me. The log says “Error fetching speedtestdotnet data: Unable to connect to servers to test latency.”. I have a separate ping test which shows my internet is up all the time so I have no idea why it wouldn’t be able to connect to speedtest. I was thinking of trying to ping the url first as part of the automation.

1 Like

I have tried adding a scheduled speed test in node-red and it seems to work fine so I will switch to using that. It just needs an inject node with a repeat at the required times and then the call service node - 2 nodes so very simple to set up.

Thanks. I guess if there isn’t a native fix to this, Node-Red seems like a good alternative. I was just watching videos about it.

I’ll try and report back :+1:

Yes in fact it works well.
I’ve even implemented a killswitch, for disabling it while online gaming.

I’m now getting the same problem I had with native automation in that the speedtest service is unavailable. I guess that makes sense since I’m just calling the same service whether using native automation or node red. So I think this is still a problem. Will try calling the service twice, maybe the first fails and the second will work!

Native automation ‘works fine’ if calling the speedtest service twice - with a minute long wait sandwiched between. I still see the first one error in the logs but then the second is fine. Its like its a timing issue whereby it tries to run the test before its resolved the name to an IP but by the time of the second test something has been cached so it works fine.

Having this exact issue. It seems the speedtest service is now removed from the integration. Calling the update entity service twice in a row with a wait in between also doesn’t work.

If you have added the speedtest integration, what works for me is that:

I call service: “update entity” on “sensor.speedtest_download” either through node-red automation or manual trigger.

The best thing is, it updates all 3 sensors even if you call update on “download” sensor.