Speedtest integration wont work

I am trying to get the Speedtest integration to work. But seem to fail. I have tried installing it through the GUI by installing the integration. And also just by editing the configuration, by adding:

speedtestdotnet:
  server_id: 10644
  scan_interval:
      minutes: 120
  monitored_conditions:
      - download
      - upload
      - ping

But it then gets stuck on loading home assistant. If I go to the terminal and manually type speedtest-cli, I see this error. It looks as if there is no config or something. Anyone that knows this issue?

bash-5.0# speedtest-cli                                                                                                                                                                                     
Retrieving speedtest.net configuration...                                                                                                                                                                   
Traceback (most recent call last):                                                                                                                                                                          
  File "/usr/local/bin/speedtest-cli", line 8, in <module>                                                                                                                                                  
    sys.exit(main())                                                                                                                                                                                        
  File "/usr/local/lib/python3.8/site-packages/speedtest.py", line 1986, in main                                                                                                                            
    shell()                                                                                                                                                                                                 
  File "/usr/local/lib/python3.8/site-packages/speedtest.py", line 1872, in shell                                                                                                                           
    speedtest = Speedtest(                                                                                                                                                                                  
  File "/usr/local/lib/python3.8/site-packages/speedtest.py", line 1091, in __init__                                                                                                                        
    self.get_config()                                                                                                                                                                                  
  File "/usr/local/lib/python3.8/site-packages/speedtest.py", line 1173, in get_config                                                                                                                      
    ignore_servers = list(                                                                                                                                                                                  
ValueError: invalid literal for int() with base 10: ''

Mine works but occasionally fails if I try and nominate a server.
I am using the integration and running my system on a NUC with Ubuntu.
If I use this config it works most of the time but I occasionally have to reload it.
image

I have the same error since this morning

speedtest --json --server 29238 --share
Traceback (most recent call last):
File “/usr/bin/speedtest”, line 11, in
load_entry_point(‘speedtest-cli==2.0.0’, ‘console_scripts’, ‘speedtest’)()
File “/usr/lib/python3/dist-packages/speedtest.py”, line 1832, in main
shell()
File “/usr/lib/python3/dist-packages/speedtest.py”, line 1729, in shell
secure=args.secure
File “/usr/lib/python3/dist-packages/speedtest.py”, line 1009, in init
self.get_config()
File “/usr/lib/python3/dist-packages/speedtest.py”, line 1081, in get_config
map(int, server_config[‘ignoreids’].split(’,’))
ValueError: invalid literal for int() with base 10: ‘’

Where do you get this options screen? After installing the integration, I don’t get any options at all.

Same here and after installation if I open the options there’s text

Error
Config flow could not be loaded

Same issue here. This integration worked well until few days ago. I removed and reinstalled then now I lost all its sensors and it cannot recreate them.

its a known issue, there is an issue with upstream speedtest-cli componenet as ookla have changed something

ValueError: invalid literal for int() with base 10: ‘’ by ligrevx · Pull Request #769 · sivel/speedtest-cli (github.com)

1 Like

For me this odd behaviour started with 2021.2 or 3
But now it’s totally dead…
Well, maybe I’ll test the Fast.com integration…

Thanks a lot.
I did the change like explained in this post and it’s working now

Change line where the error is located by this one:

map(int, [server_no for server_no in server_config[‘ignoreids’].split(’,’) if server_no])

just bear in mind if you upgrade it will get wiped till fixed in the upstream component, unless you copy down as a custom component

I have been getting continual errors with this anyway for a few weeks now anyway before the total failure today so I’ve switched to running it on the Debian host using the ookla cli. No failures anymore so I’m thinking I might just stick with that going forward.

That maybe the way to go, the speedtest-cli hasn’t had any updates since 2019

1 Like

I’ve logged an issue on Github to hopefully get someone to look at this - Speedtest integration no longer works. · Issue #48853 · home-assistant/core (github.com)

there is already one
SpeedTest throws unhandled exception in 2021.4.0 · Issue #48803 · home-assistant/core (github.com)

Thanks - closed mine and referred to that one.

The upstream component has just been fixed and a PR to fix HA has just been submitted, should be in next ha update.

2 Likes

I just updated to 2021.4.0 and mine is broken too now.
image
I will have to wait for PR to filter through to next update.

This is a problem with today’s interconnected world.
The domino effect!

The issue wasnt with the update, it would have happened after you had restarted on previous version, it was just a coincidence that the issue appeared around same time as HA released new version.

2021.4.1 has been released and has the updated upstream component referenced so will fix the issue

Thanks for the heads up. Yep mine works now after 2021.4.1 loaded

2021.4.1 also fixed it for me.