Remote control - series of commands

hi, i am wondering what is the best way to push a series of commands.

for example when opening my tv, my android STB shows a homepage, i need to go up, then right and then center to go to the tv option to see the latest chosen active channel.

I believe i should do it with:

# Open the currently selected item on the Android TV
service: remote.send_command
data:
  command: DPAD_CENTER
target:
  entity_id: remote.living_room_tv

but how do i import the commands to be executed one after the other?

Thanks

Write a script with the list of commands one after the other.

Call the script from frontend buttons or automations.

1 Like

And be prepared to add pauses between the send commands.
The length will have to by trial and error.

1 Like

got it thanks, working ok :smiley:

for anybody looking something similar:

stb_ready:
  sequence:
  - alias: "UP"
    service: remote.send_command
    data:
      command: DPAD_UP
      hold_secs: 0.5
    target:
      entity_id: remote.stb
  - alias: "RIGHT"
    service: remote.send_command
    data:
      command: DPAD_RIGHT
    target:
      entity_id: remote.stb
  - alias: "CENTER"
    service: remote.send_command
    data:
      command: DPAD_CENTER
      hold_secs: 0.5
    target:
      entity_id: remote.stb