Run speedtest.net each hour

Hello,

I’ve installed the speedtest.net integration and as a test I would like to run it every hour.

So, with the help of Speedtest.net - Home Assistant, i tried this configuration

alias: SpeedTest each hour
triggers:
  - trigger: event
    platform: time_pattern
      hours: /1
      minuts: 0
conditions: []
actions:
  - action: homeassistant.update_entity
    metadata: {}
    data:
      entity_id:
        - sensor.speedtest_download
        - sensor.speedtest_upload
        - sensor.speedtest_ping
mode: single

But when I want to save it, I got this error : “Message malformed: extra keys not allowed @ data[‘hours’]”.

What do I do wrong?

And this also doesn’t work at all…

alias: Speedtest every 1 hour
description: Speedtest every 1 hour
triggers:
  - trigger: time_pattern
    hours: "1"
    minutes: "00"
    seconds: "00"
conditions: []
actions:
  - action: homeassistant.update_entity
    metadata: {}
    data:
      entity_id:
        - sensor.speedtest_download
        - sensor.speedtest_upload
        - sensor.speedtest_ping
mode: single

What you have set up with

triggers:
  - trigger: time_pattern
    hours: "1"
    minuts: "00"

had a typo in it - “minuts” instead of “minutes”.

The 2nd one only runs once a day at 1 o’clock.

Try

triggers:
  - trigger: time_pattern
    hours: /1
    minutes: "00"
    seconds: "00"

in order to run it every hour.

I’m using the same integration, but never set up an automation - the documentation you’re referencing also says that "By default, a speed test will be run every hour. "

1 Like

There is an add-on which allows you to run speedtest from an automation at any interval you like - or indeed just once. It’s a bit more accurate too - allows you to select the server you’re testing with. You still need the speedtest integration.

2 Likes

So, the good news is that, at this moment, I don’t have any errors. The bad news : it doesn’t do a speedtest every hour…

@jackjourneyman thanks for this advice. I’ve installed it!

alias: Speedtest every 1 hour
description: Speedtest every 1 hour
triggers:
  - trigger: time_pattern
    hours: /1
    minutes: "00"
    seconds: "00"
conditions: []
actions:
  - action: homeassistant.update_entity
    metadata: {}
    data:
      entity_id:
        - sensor.speedtest_download
        - sensor.speedtest_upload
        - sensor.speedtest_ping
mode: single

With the add-on, my action is just:

actions:
  - action: hassio.addon_start
    metadata: {}
    data:
      addon: 6b87c29e_speedtest_addon

It updates all three sensors.