kiwi-cam/homebridge-broadlink-rm

Cannot connect to my bridge, does not auto discover or find when host IP and MAC are specified

Opened this issue · 18 comments

I cannot connect the Broadlink RM plugin (in HOOBS) to my BroadLink RM 4 Pro.

I've tried a whole bunch of different config options including setting the Host information, and nothing seems to connect according to the log.

My current config I've managed to get to is:

{ "platform": "homebridge-broadlink-rm-pro", "name": "Broadlink RM", "hideScanFrequencyButton": true, "hideLearnButton": false, "hideWelcomeMessage": true, "hosts": [ { "address": "x.x.x.x", "mac": "x:x:x:x:x:x", "isRFSupported": false, "isRM4": true } ] }

To be honest I don't think it's paying any attention to my config, as it still launches with the welcome message in my log, and says:
BroadlinkRMNo accessories have been added to the "undefined" platform config.

You're right :-) The platform needs to be EXACTLY "BroadlinkRM", anything else will not work: https://broadlink.kiwicam.nz/#platform-options

Indeed I saw that, issue is whenever I change the platform to "BroadlinkRM" in the config, it refreshes and reverts back to "homebridge-broadlink-rm-pro" :/

I even just Uninstalled the plugin entirely from HOOBS, rebooted the Pi, and re-installed it and named it BroadlinkRM from the popup during the install process and I ended up with the following config:
{ "platform": "homebridge-broadlink-rm-pro" }

So I changed it to:
{ "platform": "BroadlinkRM" }

And it still reverted back.

Ok I think I've gotten myself closer to figuring this out. I've gone and found the config file on the Pi and edited myself, and discovered it has 2 separate platform configs:

"platforms":[{"platform":"BroadlinkRM",{"platform":"homebridge-broadlink-rm-pro"}]

When I choose to edit the configuration in HOOBS it's clearly allowing me to only see/edit the second, and hence renaming it correctly reverts because there are then 2 of the same name. If I add options manually into the BroadlinkRM platform and restart the bridge, I start to actually see things take effect in the log!

Apologies for spamming this thread, but I just added a hosts and accessories section to the config manually and it seems to be working, but trying to use the Learn button it creates throws the following error:

BroadlinkRM[ERROR] Learn Code (Couldn't learn code, device not found)

Apologies for spamming this thread, but I just added a hosts and accessories section to the config manually and it seems to be working, but trying to use the Learn button it creates throws the following error:

BroadlinkRM[ERROR] Learn Code (Couldn't learn code, device not found)

I'm having the same issue

BroadlinkRM[ERROR] Learn Code (Couldn't learn code, device not found)

Suffering from the same issue. Any idea?

Has anyone had any luck with this? I'm seeing the same error: [9/25/2023, 1:26:36 PM] [BroadlinkRM] [ERROR] Learn Code (Couldn't learn code, device not found)

I've confirmed the device is unlocked, and have tried automatic detection as well as manual setup.

HomeBridge is running on an M1 Mac mini, on the same network/subnet as the Broadlink Pro RM4.

config.json

{
    "bridge": {
        "name": "Homebridge 318C",
        "username": "0E:C7:03:7E:31:8C",
        "port": 51191,
        "pin": "514-75-647",
        "advertiser": "bonjour-hap"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "platform": "BroadlinkRM",
            "name": "BroadlinkRM",
            "hosts": [
                {
                    "address": "192.168.0.70",
                    "mac": "e8:16:56:25:ce:e0",
                    "isRFSupported": true,
                    "isRM4": true
                }
            ],
            "logLevel": "debug",
            "_bridge": {
                "username": "0E:68:B2:8A:63:81",
                "port": 45152
            }
        }
    ]
}

Still not managed to get any further with this myself.
Been stuck with a BroadLink that's doing nothing due to this plugin bug...

I'm having the same issue, i think? What's interesting is that in the log it shows the plugin "adding RF support to device [mac address] with type 5213"

But then it says device not found when i try to use learn. I've tried auto and specifying host info. Ensures lock was off. Even deleted the device from my broadlink acct, started a new acct, and readded the device quitting the app once it was connected to the network but before it was added to my acct and a room since i saw that recommended on an old post.

Will watch to see if anyone else has any luck (or if anyone sees I'm doing something else wrong since this is a first go for me)

Hi, same issue here with a RM4 Pro. Running Homebridge on a Pi, the plugin configuration looks a lot like @brad-agencyroot 's. I also noticed that the plugin successfully catches the mac address of the device while using auto-discovery (it can even fetch the type number: 5213). No luck when it comes to the error at hand though :

[ERROR] Learn Code (Couldn't learn code, device not found)

Using auto-discovery or specifying a host in the configuration doesn't change the outcome.

I'm having the same issue, I have an RM4 Pro. The plugin cannot auto discover it and even if I specify the IP/MAC addresses, it still won't work.

What I have tried/made sure of:

  • Device is unlocked in the Broadlink app settings
  • I even tried to completely reset the RM4 Pro and tried to make it work right after making the WiFi setup
  • I have downgraded the plugin to older versions
  • I have run the plugin from a Raspberry Pi and a Mac, each time of course being on the same network as the RM4 Pro
  • I have specified the hosts object/array with IP/Mac addresses, doesn't help at all

I don't know anymore how to troubleshoot this, even in debug/trace mode the logs don't say much.

Thank you @ggroel but it doesn't really help unfortunately, your configuration is specific to you and for instance you have disabled RF everywhere, whereas RF is exactly what I want to do in my case.

I think I was able to isolate the issue within the dependency used to discover devices also forked by @kiwi-cam (https://github.com/kiwi-cam/broadlinkjs-rm)

I ran the lib by itself and here are my findings in my specific case:

  • I call the discover() method to initiate the process
  • Very quickly, the device responds (first message received through the onMessage binding) after the initial socket is created in discover()
  • Device creation succeeds, mac address is successfully retrieved
  • Device type is also found (0d21011, 0x5213) matching an "Broadlink RM4 Pro" in the rm4PlusDeviceTypes array
  • All assertions in addDevice method are okay
  • After that, the authenticate() method on the previously created Device is called
  • The socket.on('message', (response) => { ...}) callback in setupSocket() is never called, so I think either the message sent in authenticate() fails, or the RM4 Pro just stops responding for some reason

I would be happy to debug more and get to the bottom of it. I only have a non-working device so I can't compare with a functioning right behaviour.

For anyone else here struggling with this issue. I've managed to find a solution!

Which is simply to revert the firmware on the Broadlink hub to this version using the manual software update via url in device properties.