Button to Automation

I am struggling with this a bit. How can I convert a button to an automation? I want to use MQTT to call an automation. Here is the button code that works:

      - type: button
        icon: mdi:circle
        tap_action:
          action: perform-action
          perform_action: remote.send_command
          data:
            command: DPAD_CENTER
          target:
            entity_id: remote.shield
        hold_action:
          action: perform-action
          perform_action: remote.send_command
          data:
            command: DPAD_CENTER
            hold_secs: 0.5
          target:
            entity_id: remote.shield

I got it working with the code below. If anyone has a better way to making this work please let me know.

description: ""
mode: single
trigger:
  - platform: state
    entity_id:
      - remote.shield
condition: []
action:
  - action: remote.send_command
    target:
      entity_id: remote.shield
    data:
      hold_secs: 1
      command: DPAD_CENTER