Speedtest script error

Dear Experts,

I am not able to execute the below attached automation script. Kindly guide me the right approach.

- id: "speedtest restart"
  alias: "speedtest restart"
    - platform: state
      entity_id: sensor.speedtest_download
      to: "unavailable"
    - delay: "00:05:00"
    - service: speedtestdotnet.speedtest

Error : The automation “speedtest_restart” (automation.speedtest_restart ) has an action that calls an unknown service: speedtestdotnet.speedtest .

Vinay Krishna

Where did you get that such a service existed?

1 Like

You can’t just make up services. Where did you see this?

Try this instead:

  - service: homeassistant.update_entity
    entity_id: sensor.speedtest_download
1 Like

I refered this thread: https://community.home-assistant.io/t/speedtest-service-to-restart/319440

That service was removed 2 years ago.

Better to refer to the documentation:

Is there any way to disable and enable the integration through automation.?

If you’re just trying to update the speedtest_download sensor, you need to call the homeassistant.update_entity service against the sensor as Tom stated and as is written in the documentation. There shouldn’t be any need to enable or disable the integration. Please explain what you’re trying to do if you think it is necessary to disable the whole integration.

You can disable the “default” polling, if that’s what you want.
It’s the same for all integrations.

1 Like