Custom Button card automation

Hello,
Is there a way to start an automation or script for my bed.
I already have two custom button cards.
Bed up and bed flat.
I want to give voice command

Button card 1:


cards: null
type: custom:button-card
name: Bed rechts TV kijken
icon: mdi:bed
tap_action:
  action: call-service
  service: rest_command.bed
  service_data:
    cbu: 2
    motor_1_action: 1
    motor_1_time: 2000
    motor_2_action: 1
    motor_2_time: 6000
    motor_3_action: 1
    motor_3_time: 6000'

Button card 2:
'cards: null
type: custom:button-card
name: Bed rechts Slapen
icon: mdi:bed
tap_action:
  action: call-service
  service: rest_command.bed
  service_data:
    cbu: 2
    motor_1_action: 2
    motor_1_time: 2000
    motor_2_action: 2
    motor_2_time: 6000
    motor_3_action: 2
    motor_3_time: 6000