WTFoX74
(Martin)
1
I’ve got a scheduled speedtest integration working, looking like this:
![image](//community-assets.home-assistant.io/original/3X/1/f/1f863822e137de59dca28f21d0e2d3a4eb404fb7.png)
and using this script:
sensor:
- platform: speedtest
minute: 30
hour: 3
monitored_conditions:
- ping
- dowload
- upload
So it is running every night at 3.30am.
Now I want to create an update button on this automation part, where I can manually trigger:
sensor.update_speedtest
(which works from a direct service call)
How can I achieve this?
VDRainer
(🍻)
2
I think a script should do it.
script:
update_speedtest:
sequence:
- service: sensor.update_speedtest
1 Like
WTFoX74
(Martin)
3
Seems to work fine! Thanks for your quick response! I was quite close except for one uppercase too much ![:wink: :wink:](https://community.home-assistant.io/images/emoji/twitter/wink.png?v=9)
nightmare1
(nightmare1)
4
Is this still possible using the speedtest integration as i am unable to call the service or find the update entity. Tia
cooljimy84
(James Crook)
5
I think the service call is now part of homeassistant.update ?!?
action:
service: homeassistant.update_entity
data: {}
target:
entity_id: sensor.speedtest_download
1 Like
nightmare1
(nightmare1)
6
I made a button to call the reload speedtest if anybody wants the code
First a script, i have made the script so it can only run once in 20 seconds to prevent repeated pressing as it shows as unavailable whilst reloading
sequence:
- condition: not
conditions:
- condition: state
entity_id: sensor.speedtest_download
state: unavailable
- service: homeassistant.reload_config_entry
data:
entity_id: sensor.speedtest_download
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
alias: Speedtest update
mode: single
Then the button is a custom button card.
show_name: true
show_icon: true
type: button
tap_action:
action: call-service
service: script.speed_test
data: {}
target: {}
name: Speed Test
icon: mdi:speedometer
entity: sensor.speedtest_download
show_state: true
2 Likes