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?