Broadlink Manager - Nicer way to Learn and Send IR/RF commands

Like you, my HA is also installed on a dedicated rpi and never found how to install BLM on it. Likely, I have several rpi and I use one of them to install BLM with this guide.
As an alternative, have you tried using the Windows version? I have no luck with it though.

thanks pro. but
I have the following problem with docker when installing!
image|690x70
Traceback (most recent call last):
File ā€œ/opt/broadlinkmanager-docker/broadlinkmanager/broadlinkmanager.pyā€, line 2, in
from flask import Flask, request, make_response, render_template, url_for, g, send_from_directory, jsonify
ModuleNotFoundError: No module named ā€˜flaskā€™

I managed to do it without BL Manager, the steps are intense but it works great and I managed to program all the RF remotes, I can post it if any desires

Cheers

I will really appreciate it if you could share the steps you took to learn RF remotes :pray: :pray:

Note: with the latest version of homeassistant the yaml syntax for seting up a broadlink switch has changed AND you now need to also setup an integration for the GUI.

Hello, I have Broadlink Manager running in a LXD container. Iā€™m able to access the webpage and it successfully finds my RM Mini 3 Device Type: 0x5f36. I initially had a problem with it displaying the Base64 code after clicking the Learn IR Code button. Turns out uBlock Origin plugin was blocking it. So for those having this same problem, make sure to turn off your ad blocker at least for that specific page.

I have a Daikin Split Aircon unit that Iā€™m trying to control with the Broadlink. But I noticed when Learning the IR codes they seem to be random. For instance I tested power which is a toggle on/off and every press is a random Base64 code. I also tested with temperature up and swing buttons and again the Base64 is random.

For example, here is the Base64 results for the swing button. Note this isnā€™t complete but just exerpts.
JgC8AWw3Dā€¦Dg4qDwANBQAAAAAAAAAAAAA=
JgC8AWw4Dā€¦EA0rDQANBQAAAAAAAAAAAAA=
JgC8AWo6Dā€¦Dw0sDQANBQAAAAAAAAAAAAA=

Does anyone have any idea whatā€™s going on here and what I can do to get this working? I currently have a Switchbot mini ir hub working with this same AC unit but the Switchbot mini ir hub is cloud based so I would prefer to replace it with the Broadlink.

Thank in advance for your assistance.

1 Like

@ [mjeshurun]

Sure and I am sorry for the lengthy steps as I wanted to make sure it is followed with no confusion:

The environment I have is Home Assistant 0.115.2 on Raspberry Pi 4 with 4GB RAM, I also use Powershell on Windows to set the SSID and Password for the RM4 Pro, but you can use any method of setting the SSID for the Broadlink devices

I will say the idea in brief then I will walk you through the steps in more details . We will use the Broadlink App (latest version) to learn the RF codes while HA is also set to learn the RF codes at the same time, it will be like a competition between the two but we always want HA to win, if Broadlink App wins the learning before HA then we reject it and redo the process of learning again for that button we currently programming, so here is the steps in details

1- We need HA to talk to RM4 Pro and recognize it through the Broadlink integration released with HA 0.115

2- To do that we need to put the RM4 Pro in AP mode and set the SSID and password, hold reset button until light flashes quick and let it restart then hold reset again until light flashes quick with pauses between 4 or 5 flashes, then you set the SSID with whatever means, I used PowerShell ran as Administrator on Windows machine then executed Python commands from the PowerShell window to set the SSID and password for the RM4 Pro while my pc is connected to the RM4 Pro access point, very easy but you need Python installed on Windows and I think you also need the Broadlink components under Python which you can get easily from GetHUB

3- You also need to set the RM4 Pro with a static IP address through your DHCP under your router and by using the MAC address of the RM4 Pro

4- After you set the SSID and password and restarted your Broadlink, HA will connect easily to it through the integration, you only need to supply the IP address of the Broadlink which should be reserved for it under your router

5- Get all your RF remotes ready as we do not need to worry about IR remotes because HA can learn their codes easily, our problem is the RF remotes
6- Now we need to run Broadlink App latest version on your mobile, and if you have Home, Devices, and Remotes configured, you MUST remove all of them

7- Create a new home in a totally different country and time zone to whatever you set before, and if you will do the process again always start with deleting the home and all devices/remotes and always select different country and time zone to whatever you selected before

8- Broadlink app should then ask you to configure the ā€˜foundā€™ RM4 Pro, say yes and it will add it to the new home you created and you should give it a name BUT before the last step of adding the device, we need to get HA ready to learn

9- Go to Developers Tools and under Services select
remote.learn_command

The entity_id should be the RM4 Pro we added to HA before
In my case the service data yaml was

entity_id: remote.rm4_pro_remote
device: fan_rumpus
command: Low
timeout: 20

Note here that the device should be the same name for each remote and its buttons, i.e. under each remote, we only going to change the command after we learn the previous command

in my next case, the service data for the next button on the same remote was

entity_id: remote.rm4_pro_remote
device: fan_rumpus
command: Med
timeout: 20

And so on until we finish all buttons on the remote the we move on to the next remote and at that point, we need to change the device to be the next remote, for example

entity_id: remote.rm4_pro_remote
device: fan_living
command: Low
timeout: 20

10- Now Press the Call service once on the HA Services, then finish adding the Broadlink device to the Broadlink app that we paused on step 8

11- In the App add RF remote and we will only use one button to learn all our RF remotes and their buttons, this will allow us to do the process quickly if you have a lot of RF remotes, I programmed 8 fansā€™ remotes at once

13- When the app starts the learning countdown and the red light comes on the Broadlink device, at this moment you will need to Call the Service under HA and WAIT until you get the HA notification to press the button on the remote

14- When you get the HA notification to press the remote button, this may take a second or it may take few seconds, just be patient until you see the notification, and then you can point the remote to the Broadlink and press the button you want on it to be learned

15- Here we have such situation when we want HA to learn first, for us it does not matter if the App learns or not, in fact, if the app learns the code we need to reject it

16- In my case HA learned the code most of the times before the App and you will know that when you see the HA notification colour disappears

17- If HA learns first then we need to wait until the app learning countdown expires and fails and it will ask you to try again and we say yes and we move on to the next button

18- When we move on to the next button, we need to change the command in the service data under HA or the device also if we moved on to another remote

19- If the app learns first, we need to reject it but do not start the try again until the HA notification disappears which will take a few seconds, and after it disappears try learning again on the app and when the countdown starts press Call service on the HA tools and wait for the HA notification to appear then you press the button on the remote, I cannot stress more how you MUST wait for the HA notification to appear before you press the button on the remote

20- If it fails at any point to learn just start learning again with the app and repeat the process for the same button until it learns, in my case, it was reliable most of the times, and when it was not I just repeated the process and succeeded for whatever button on whatever remote

21- After you finish all your RF remotes you will end up with the Broadlink file under .storage filled with all the learned codes which can be used now to create switches under HA, please make a copy of this file and save it somewhere so you donā€™t lose it or overwrite it

22- The last step is to reset the Broadlink again by the two long presses because the moment you restart the Broadlink device, HA will lose connection to it because the App will take control, but at least we got all the RF codes, all you need to do after resetting is simply add the SSID and password again and add it to home-assistant via the new Broadlink integration

23- And finally if you want to add more RF remotes or discovered later that any of the learned RF remotes not working, you can redo the process for only the buttons you found not working or the new remotes, and the process will be the same from step 1, keep in mind that all the learned and working codes will stay working even if you redo the process again for any new RF remotes

Have a great day everyone

6 Likes

I think it is related to how long you press the button while learning, I found that even with RF remotes I get different codes if I press longer or shorter, but the codes still work

Cheers

Interesting but that makes sense. Iā€™ll have to test that out. I didnā€™t think I was pressing the button any more or less but then again I wasnā€™t paying that much attention to it. Iā€™ll report back my findings. Thanks for the info AhmedBahgat.

Million thanks, @AhmedBahgat! :pray: :pray: :pray:
I really appreciate the time and effort you took to write and explain all the steps.
Iā€™ll try your method and hopefully Iā€™ll finally be able to add my RF remotes to my smart-home system :slight_smile: :slight_smile:

1 Like

It will work 100%. I even edited a few codes because I could not find them in the BL codes file after I restored the BL 4 Pro back to HA, so I repeated the process for only the missing code and it worked great. see my fans. Cheers

And when any is on, this is how they look like

How can I access to .storage folder? Im a newbie on this. Thanks!

If you are using Windows explorer to access your config files, on the top of the explorer browser click on view -> check box hidden items. You should be able to see all hidden folders and files.

If you are using Home Assistant via browser, you will need to install File Editor add-on in the Add-on Store.

1 Like

I have a RM Pro, I spent ages with the Windows version of this, and it would never detect a key press in the frequency scan. Today I changed to the Raspberry Pi version, and it worked like a charm, all my codes are detected and recorded. https://en.techblog.co.il/2020/06/24/installing-broadlinkmanager-on-raspberry-pi/

1 Like

Thanks man!

I didnā€™t have enough time to fully test this but hereā€™s what Iā€™ve found out. The power toggle works as expected in home assistant. But when I try any other function such as temp up, temp down, mode, etc, it turns off the Daikin Aircon unit. I decided to test this further with the physical remote. I first turned on the Daikin using a service call and broadlink which works as expected. I then tried to adjust the temp up and it instead turned off the Daikin. I tested temp down and same thing. Iā€™ll test other functions later when I have more time but this leads me to my question.

Has anyone else experienced this? Iā€™m thinking the Daikin and physical remote have two way communication so perhaps this is causing the issue? Any other thoughts?

The Switchbot Mini hub works fine. I would continue to use this but because their API is closed (for now) I had to configure it through IFTTT using webhooks and Home Assistant. As you may know, IFTTT is moving to a paid service and that itā€™s already a cloud service which I didnā€™t want in the first place, I would much rather get this broadlink working. Any help is much appreciated.

I was having the same issue and wasnā€™t getting anywhere. Iā€™m using the add-on ā€œFile Editorā€ and the guides Iā€™m watching all show the user going to the .storage folder inside the web browser, but all the responses in the forums talk about SSH or Samba.

If you go to Supervisorā€“> Dashboard and select the ā€œFile editorā€ add-on, there will be a tab for configuration. Youā€™ll see a block of text that looks like this:

> dirsfirst: false
> enforce_basepath: true
> ignore_pattern:
>   - __pycache__
>   - .cloud
>   - .storage 
>   - deps
> ssh_keys: []

Delete the line that says .storage

This comes with the perfunctory warning that the reason this folder is hidden is because you can seriously scramble some eggs if you lick the wrong light sockets while digging around inside this folder. Best to ā€œread onlyā€ and not change any names or contents.

Thanks mate

1 Like