Remote long press on Broadlink

Is the code always the same that needs to be transmitted? It was suggested above just to loop the command in a script.

If the commands are unkown, they must be recorded with the broadlink learn functionality.

It is also very easy to use e.g. arduino/ESP with ir-led and build something custom with few codes.

Fist add the RM mini 3 via Integrations page in Home Assistant. Then…

Learn the command:

script:
  learn_stair_lift:
    sequence:
      - service: remote.learn_command
        data:
          entity_id: remote.stair_remote  # Example entity id
          device: stair_lift
          command: up

Send the command with num_repeats:

script:
  send_stair_lift:
    sequence:
      - service: remote.send_command
        data:
          entity_id: remote.stair_remote  # Example entity id
          device: stair_lift
          command: up
          num_repeats: 200  # The number of repetitions you want

If you send me the code, we can make it better. The first bytes represent the number of repetitions. We can put this at the limit to reduce the amount of packets sent.

Edit: I just remembered something. If you are going to send long codes, it is better to wait for the next release of the python-broadlink library before doing critical operations like this. There is a problem of extra repetitions for long codes like yours. It will be resolved soon, I already created the PR.

Hi felipediel,
I have the following code JgAYANZSajkZHRs3Nh0ZORocGzc3Gzc4NwANBQAAAAAAAAAAAAAAAAAA

How could I identify the part which should be repeated?

Many thanks for your help!

Open the Python shell and…

>>> from base64 import b64decode, b64encode
>>> b = bytearray(b64decode('JgAYANZSajkZHRs3Nh0ZORocGzc3Gzc4NwANBQAAAAAAAAAAAAAAAAAA'))
>>> b[1]
0  # Your code repeats 0 times.
>>> b[1] = 50  # Assign 50 repetitions.
>>> b = b64encode(b)
>>> b
b'JjIYANZSajkZHRs3Nh0ZORocGzc3Gzc4NwANBQAAAAAAAAAAAAAAAAAA'

Many thanks for your answer @felipediel!
I did it, but apparentlz it doesn’t work. I did change the number from 50 to 200, but the result is the same.

I tested it locally and it works. Make sure to b64decode before and b64encode after. This is your code with 255 repetitions:

Jv8YANZSajkZHRs3Nh0ZORocGzc3Gzc4NwANBQAAAAAAAAAAAAAAAAAA

Apologies if it wasn’t clear from my side. In effect I can generate the code, but when I add it to my configuration.yaml it doesn’t work seems the code is not correct…

Show me your config.

config

- name: pellets_on_off
        command_on: "Jv8YANZSajkZHRs3Nh0ZORocGzc3Gzc4NwANBQAAAAAAAAAAAAAAAAAA"
        command_off: "Jv8YANZSajkZHRs3Nh0ZORocGzc3Gzc4NwANBQAAAAAAAAAAAAAAAAAA"

The config looks ok, but I see that you are using the same code to turn it on and off. This can be problematic. Most devices use a toggle bit in the code. You need to learn two codes, one for each command.

Thanks, basically it’s exactly the same code. In effect I use then the on integrated into a script and only use the on. Looking to the older answers and the Panasonic example the code should be much longer, I searched for a while without any success. Broadlink told me as well they currently don’t support this action…

The problem is not related to the number of repetitions. You are sending the wrong code. I extracted the codes for you. I hope it works.

Panasonic

Type 1: Turn on/turn off

‘JgBmAG43Dg4OKQ4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OKQ4ODg4ODg4ODg4ODg4ODg4ODg4pDg4ODg4ODg4ODg4ODg4ODg4pDg4OKQ4pDikOKQ4ODg4OKQ4ODikOKQ4pDikODg4pDgAFZAAA’

Type 2: Turn on/turn off

‘JgDMAHQ3EA0QKRANEAwQDRAMEA0QDBEMEA0QDBANEAwRKRAMEA0QDBANEA0QDBANEAwQDRApEA0QDBANEAwRDBANEAwQDRApEA0QKRApECkQKRANEA0QKRAMECoQKRApECkQDRApEAAJenQ3EA0QKRANEAwQDRAMEA0QDBEMEA0QDBANEAwRKRAMEA0QDBANEA0QDBANEAwQDRApEA0QDBANEA0QDBANEAwQDRApEA0QKRApECkQKRANEA0QKRAMECoQKRApECkQDRApEAANBQAAAAAAAAAAAAAAAA==’

Type 3: Turn on/turn off

‘IwBmAHI5Dg4OKw4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OKw4ODg4ODg4ODg4ODg4ODg4ODg4rDg4ODg4ODg4ODg4ODg4ODg4rDg4OKw4rDisOKw4ODg4OKw4ODisOKw4rDisODg4rDgAJfgAA’

Hi Felipe

i have a similar issue turning on my pellet stove, and have nearly given up. i can control the temp and fan but cant figure out the 2sec power press to start and stop it. Do you mind sharing how you got the codes? Everytime i try the long press a different sequence appears.

thanks
Fred

Sorry, I didn’t find any code for pellet stoves. If you find the codes in a crowd-sourced database (IRDB, LIRC etc), there are several modules out there that can help with conversions:


@fredanaman
If your stove uses an Evo board, you could use an ESP? Still very rudimental, but basics work

Hi, thanks. My stove wasnt listed on the site, so will have to try going through the company.

thanks again

@aceindy thanks, i need to find out if i do have an Evo board in my stove. I think i do (Fuoco Delia), but need to confirm. Also i am new to this, when u mentioned the ESP01, is it possible to use the M5stack, as i bought a couple for another infrared prj (which didnt pan out)?

thanks
Fred

Hi felipediel
I missed your message.
My code isn’t for a Panasonic,I was just taking the example.My equipment is a heater,so the broadlink reads the code I sent you, but it doesn’t work. …

Try learning the code with a long press.

Thanks. The code I have sent was the result of the long press, but it doesn’t take all the code. In parallel I opened a ticket within Broadlink, but they just said they don’t support long-press.

I believe we would be able to repeat the payload manually if we would be able to identify the part of the code, but…

I will abandom.

Thanks anyway!!!