Define a simple, stateless press button in configuration?

I want to have a simple, stateless press button created in configuration.yaml.

I only managed to create an on/off switch which calls the same action:

switch:
  - platform: template
    switches:
      docker_update:
        turn_on:
          service: shell_command.run_watchtower
        turn_off:
          service: shell_command.run_watchtower

I tried this but the button does not show up in home assistant:

button:
  - platform: template
    buttons:
      docker_update:
        action:
          service: shell_command.run_watchtower

I want a button like this:

Seems to be an entities card button.

You will find a full example at the bottom of that page.

No need for create a new entity. Create a new entities card, switch to yaml mode and paste the example.

Ah ok … so I define the button in the Web GUI and access the service call defined in configuration.yaml.

Works like this:

type: entities
entities:
  - type: button
    name: Update Docker Container
    icon: mdi:power-cycle
    tap_action:
      action: call-service
      confirmation:
        text: Are you sure you want to update?
      service: shell_command.run_watchtower