Calling shell commands from Alexa

I wan’t to turn my tv on and off, i have a skill setup but struggling with the yaml file.

i want to say
Alexa tell Home Assistant to turn tv on
Alexa tell Home Assistant to turn tv off

i’ve been messing about with this sort of thing, tried using a switch and a shell _command,

alexa:
  intents:
    TvControlIntent:
      action:
        service_template: shell_command.{{ Script }}
        data_template:
          entity_id: script.{{ Script | replace(" ", "_") }}
      speech:
        type: plaintext
        text: OK

shell_command:
  tv_on: echo "on 0" | cec-client -s
  tv_off: echo "standby 0" | cec-client -s

switch:
  platform: command_line
  switches:
    arest_pin_four:
      command_on: echo "on 0" | cec-client -s
      command_off: echo "standby 0" | cec-client -s
      value_template: '{{ return_value == "1" }}'
      friendly_name: Bedroom Tv

Whats the correct way to do this?

I would do it this way.

alexa:
  intents:
      tv_on:
          action:
            service: switch.turn_on
            data_template:
              entity_id: switch.tv
          speech:
            type: plaintext
            text: OK
      tv_off:
          action:
            service: switch.turn_off
            data_template:
              entity_id: switch.tv
          speech:
            type: plaintext
            text: OK


    switch:
      platform: command_line
      switches:
        tv:
          command_on: switch_echo "on 0" | cec-client -s
          command_off: switch_echo "standby 0" | cec-client -s

you can also it for emulated hue and say “Alexa, turn on TV”