Guide: How to learn broadlink RF codes

I bought a Broadlink RM4C Pro and also struggled with the setup.
Based on the instructions above, I finally got it to work.
Here are the steps I followed.

Prerequisites:

  1. Add a new “UserDefine” device in the BroadLink app on your phone.

  2. Add a control button for the device and verify that it works.

  3. Connect the BroadLink to Home Assistant through the corresponding integration.

  4. Install the “File editor” addon.

  5. In the addon’s configuration, unhide the .storage folder (remove it from the dirs_filter list).

Learning the Command in HA:

  1. Go to Developer Tools => Actions.

  2. Select the action remote.learn_command. For the target, choose your Broadlink device. Then, fill in the following:

  • Device: An arbitrary name for your device, e.g., bathroom_wall_strip

  • Command: An arbitrary name for the command, e.g., power

  • Command Type: rf

  1. In the BroadLink app, go to your UserDefine device and tap add functional buttons at the bottom, then learn simple RF code. The frequency from the last connection should be pre-filled. Press Next.

  2. After this, the indicator light on your Broadlink device should turn orange.

  3. As soon as the light is on, click Perform action in Home Assistant.

  4. Next, press the button on your physical remote. The indicator light should turn off and then light up again. A green checkmark should briefly appear in the HA UI.

  5. As soon as that happens, press the button on your remote again.

  6. Another green checkmark should briefly appear in HA.

  7. If everything was successful, you can find the new command in the “File editor” in a file named something like /homeassistant/.storage/broadlink_remote_xxxxxxxxxxxx_codes.

  8. If the command doesn’t appear, something went wrong. Try the process again. Personally, it didn’t always work for me on the first try.

Example of a command that should appear in the broadlink_remote_..._codes file:

{
  "version": 1,
  "minor_version": 1,
  "key": "broadlink_remote_348e893324c9_codes",
  "data": {
    "bathroom_wall_strip": {
      "power": "scCkAJyeBgASAAGADyYQJSoMDycPJikMKA0oDQ8mDycOKCcNDycoDiYODigOJw8nDigOJw8nDycPJycNDwABhw8nDycnDg4nDycoDScOJw4OKA0pDSgnDg4nJw8mDg4oDSkNKA4nDycPJw8nDignDQ8AAYgOJw4oJw0PJw8nKA0nDicODSkOJw4oJw4NKSYOJw4NKQ4oDSkNKA4oDigNKA4oJw0PAAXc"
    }
  }
}