[SOLVED] Xiaomi IR Remote. How to simulate a long press?

Actually all question is displayed in a topic. How to stimulate long press? In order to turn on the TV, on the remote control I need to hold down the power button for 2-3 seconds (during this time there is a kind of 4-5 clicks with flashing status light). Switching off/switching channels works as usual with a single press and a single blinking of the status light. If not very clear, I can record a video of how the TV turns on.

If you use “pronto” codes, you can add “:<number_of_repeats>” at the end of the code as stated here. If you are using raw codes, I guess you can just use the “learn” option and hold the button for this many seconds (not tested, but should work :slight_smile: ).

I use raw codes, I will test it tomorrow, thanks :slight_smile:

well, I found that remote.send_command have parameters have “num_repeats” and “delay_secs”
So in “Call Service” I add this and it works:

{
  "entity_id": "remote.xiaomi_miio_192_168_1_63",
"command": "my_working_command_in Configuration",
"num_repeats": "30",
"delay_secs":"0"}

How to add

"num_repeats": "30",
"delay_secs":"0"

to my script?

'tv_turn_on':
  alias: TV Turn On
  sequence:
    - service: remote.send_command
      entity_id: 'remote.xiaomi_miio_192_168_1_63'
      data:
        command:
          - 'tv_turn_on'

Thanks!

Try this:

'tv_turn_on':
  alias: TV Turn On
  sequence:
    - service: remote.send_command
      entity_id: 'remote.xiaomi_miio_192_168_1_63'
      data:
        num_repeats: 30
        delay_secs: 0
        command:
          - 'tv_turn_on'
1 Like

Thank you!