Speedtest update sensor with Lovelace button

Hi All,

Working with the Lovelace UI and like it a lot. I’ve build a Gauge card which shows the result of daily speedtest check.

image

Without Lovelace I build a button which invokes the sensor.update_speedtest service.
My question how I can achieve this in lovelace? essentially calling the service from a button. It this possible with the button card?

Thanks in advance!

A few days ago someone had the same question.

Correct that was me and was able to work it out fine :wink:
My question now is how I can create a button in lovelace calling this update sensor.

Ups! :upside_down_face:
You can call a script with the Special Row element Call Service.

For example:

          - type: entities
            entities:
              - type: call-service
                name: Label
                action_name: UPDATE
                icon: mdi:some_icon
                service: homeassistant.turn_on
                service_data:
                  entity_id: script.your_script

EDIT:
The Enity Button Card should also work with the call-service.

Thanks for your quick feedback. I want to build this as a lovelace card.
I am struggeling a little bit with the entity field, where should this point to?

Good question. Looks like it is required in the button card.
Then you can make a script with the sensor.update_speedtest and call this script from the button card.

I think I found it: :wink:

image

Thanks for your quick response. Up to the next challenge

1 Like

Just a heads up, it’s best to share your code as text so it can be searched as well as copied and pasted.

1 Like