kiwi-cam / homebridge-broadlink-rm

[This fork supports TV accessories] Broadlink RM Mini and Pro plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
300 stars 95 forks source link

I cant get the broadlink plugin to work #684

Open Moralkeule opened 6 months ago

Moralkeule commented 6 months ago

I am trying to get the broadlink plugin to run on my hoobs with this code { "platform": "BroadlinkRM", "name": "Broadlink RM", "hideScanFrequencyButton": true, "hideLearnButton": true, "hideWelcomeMessage": true, "hosts": [ { "address": "192.168.178.77", "mac": "e8:16:56:06:da:18", "isRFSupported": true, "isRM4": true, "accessories": [ { "name": "Klima", "type": "fan", "data": { "on": "260060000001218f12131312121312141114121311141235133412351236123512361135123612131213113612141213123512121114121312361213113613351114113612351137120004e60001224813000bec0001224812000bee0001214812000d05000000000000", "off": "260060000001218f12131312121312141114121311141235133412351236123512361135123612131213113612141213123512121114121312361213113613351114113612351137120004e60001224813000bec0001224812000bee0001214812000d05000000000000", "speed": "260058000001239112131214121311141113121313131235123611371136123511371136123611141236111412351114121411141213121411141236111412361136113711361236110004ec0001244911000bf40001234811000d050000000000000000000000000000" } } ] } ] }

I am not really good at this so i dont know whats wrong with it.

arthur-moebios commented 6 months ago

Hi! Your config json is a bit confusing. The accessories key must be not under host configuration. Let me show you:


            "platform": "BroadlinkRM",
            "name": "BroadlinkRM4Pro",
            "hideScanFrequencyButton": true,
            "hideLearnButton": true,
            "hideWelcomeMessage": true,
            "hosts": [
                {
                    "address": "192.168.0.121",
                    "mac": "ec:0b:ae:84:fd:90",
                    "isRFSupported": true,
                    "isRM4": true
               }
            ],
            "accessories": [
                {
                    "name": "RF Scan",
                    "type": "learn-code",
                    "scanFrequency": false,
                    "host": "e8:16:56:1c:6d:a1"
                } ```

A tip top to use is in your router reserve the rm4 ip address, or remove the hosts section to plug-in auto discover the device. Just add the accessories 

Make sure your device is in v62092 firmware. The last version not work with this plug-in
Moralkeule commented 6 months ago

I still dont get the device

{ "platform": "homebridge-broadlink-rm-pro", "name": "Broadlink RM", "hideScanFrequencyButton": true, "hideLearnButton": true, "hideWelcomeMessage": true, "hosts": [ { "address": "192.168.178.77", "mac": "e8:16:56:06:da:18", "isRFSupported": true, "isRM4": true } ], "accessories": [ { "name": "RF Scan", "type": "learn-code", "scanFrequency": false, "host": "e8:16:56:1c:6d:a1" }, { "name": "Klima", "type": "fan", "data": { "on": "260060000001218f12131312121312141114121311141235133412351236123512361135123612131213113612141213123512121114121312361213113613351114113612351137120004e60001224813000bec0001224812000bee0001214812000d05000000000000", "off": "260060000001218f12131312121312141114121311141235133412351236123512361135123612131213113612141213123512121114121312361213113613351114113612351137120004e60001224813000bec0001224812000bee0001214812000d05000000000000", "speed": "260058000001239112131214121311141113121313131235123611371136123511371136123611141236111412351114121411141213121411141236111412361136113711361236110004ec0001244911000bf40001234811000d050000000000000000000000000000" } } ] }

arthur-moebios commented 6 months ago

What's the version of firmware? Now I figure out you are trying to get this working on hoobs, did you mean homebridge right?

brentleeper commented 6 months ago

Hello. I am facing a similar issue. I am also using Hoobs. I have correctly configured the plugin with the host using the RM4 pro ip and Mac address. However when attempting to learn or scan I get

2/7/2024, 3:30:11 PMBroadlink Rm Pro BridgeBroadlink RM[INFO] Learn Code (Couldn't learn code, device not found) 2/7/2024, 3:30:14 PMBroadlink Rm Pro BridgeERROR[Broadlink Rm Pro Bridge 5D73@On] The write handler for the characteristic 'On' on the accessory 'Scan Frequency' was slow to respond!

Auto discovery fails for the RM4 Pro. However I also have a mini and the mini works without issue. After using the mini I completely removed the bridge and plug-in and then reinstalled from scratch before attempting the RM4 Pro.

brentleeper commented 6 months ago

Here is my config


    "accessories": [],
    "platforms": [
        {
            "platform": "BroadlinkRM",
            "name": "Broadlink RM",
            "hideScanFrequencyButton": false,
            "hideLearnButton": false,
            "hideWelcomeMessage": true,
            "hosts": [
                {
                    "address": "redacted",
                    "mac": "redacted",
                    "isRFSupported": true,
                    "isRM4": true
                }
            ]
        }
    ]
}```
brentleeper commented 6 months ago

The firmware on my RM4 Pro is V62093

brentleeper commented 6 months ago

Downgraded to V62092 using http://124.71.130.238/RMBL4-62092-8720-BL-FC-3389.upd.bin

arthur-moebios commented 6 months ago

Downgraded to V62092 using

http://124.71.130.238/RMBL4-62092-8720-BL-FC-3389.upd.bin

Great! Now remove from your config the hosts key. The plug-in will discover automatically the rm4

brentleeper commented 6 months ago

Was able to discover the device but RF learning fails. I attempted to use python-broadlink and was able to control the device and extract the RF packet. But not sure how that translates to HEX to use in the config in this plugin.

The packet I got is

b'r\xc0v\x00\xc0\xc2\x04\x00\x1a\x0c\x18\x0e\x19\x1b\x0c\r\x18\x1a\r\x1a\r\x19\r\x19\r\x1a\n\x1c\x0b\x1b\x0c\r\x19\x1a\r\r\x19\x19\r\x1a\x0c\x19\x0e\x19\x0c\x1a\x0c\r\x19\x1a\r\x00\x01\xc1\r\r\x1a\x0c\x1a\x0c\x18\x1b\x0c\x0e\x18\x1a\r\x1a\x0c\x1a\x0c\r\x1a\x0c\x1a\r\x18\x0e\x18\x0f\x18\x1a\x0c\x0e\x18\x1a\r\x19\x0e\x19\r\x19\x0c\x1b\x0b\x1a\r\x19\x0c\x0e\x19\x19\r\r\x1a\x19\r\x19\x0b\x1b\x0c\x1b\x0c\x19\r\r\x18\x1b\x0c\x00\x05\xdc'
arthur-moebios commented 6 months ago

Was able to discover the device but RF learning fails.

I attempted to use python-broadlink and was able to control the device and extract the RF packet. But not sure how that translates to HEX to use in the config in this plugin.

The packet I got is


b'r\xc0v\x00\xc0\xc2\x04\x00\x1a\x0c\x18\x0e\x19\x1b\x0c\r\x18\x1a\r\x1a\r\x19\r\x19\r\x1a\n\x1c\x0b\x1b\x0c\r\x19\x1a\r\r\x19\x19\r\x1a\x0c\x19\x0e\x19\x0c\x1a\x0c\r\x19\x1a\r\x00\x01\xc1\r\r\x1a\x0c\x1a\x0c\x18\x1b\x0c\x0e\x18\x1a\r\x1a\x0c\x1a\x0c\r\x1a\x0c\x1a\r\x18\x0e\x18\x0f\x18\x1a\x0c\x0e\x18\x1a\r\x19\x0e\x19\r\x19\x0c\x1b\x0b\x1a\r\x19\x0c\x0e\x19\x19\r\r\x1a\x19\r\x19\x0b\x1b\x0c\x1b\x0c\x19\r\r\x18\x1b\x0c\x00\x05\xdc'

Now remove all host key from accessories like the learn-code you added. Restart homebridge and try again

arthur-moebios commented 6 months ago

Was able to discover the device but RF learning fails.

I attempted to use python-broadlink and was able to control the device and extract the RF packet. But not sure how that translates to HEX to use in the config in this plugin.

The packet I got is


b'r\xc0v\x00\xc0\xc2\x04\x00\x1a\x0c\x18\x0e\x19\x1b\x0c\r\x18\x1a\r\x1a\r\x19\r\x19\r\x1a\n\x1c\x0b\x1b\x0c\r\x19\x1a\r\r\x19\x19\r\x1a\x0c\x19\x0e\x19\x0c\x1a\x0c\r\x19\x1a\r\x00\x01\xc1\r\r\x1a\x0c\x1a\x0c\x18\x1b\x0c\x0e\x18\x1a\r\x1a\x0c\x1a\x0c\r\x1a\x0c\x1a\r\x18\x0e\x18\x0f\x18\x1a\x0c\x0e\x18\x1a\r\x19\x0e\x19\r\x19\x0c\x1b\x0b\x1a\r\x19\x0c\x0e\x19\x19\r\r\x1a\x19\r\x19\x0b\x1b\x0c\x1b\x0c\x19\r\r\x18\x1b\x0c\x00\x05\xdc'

I don't know how to convert too. All my codes I've extracted using the learn-code accessory

arthur-moebios commented 6 months ago

Use { "name": "RF Scan", "type": "learn-code", "scanFrequency": false },

scanFrequency: true will extract the hex code from a ref controller instead of ir

brentleeper commented 6 months ago

Can you include this in a full example?

arthur-moebios commented 6 months ago

Can you include this in a full example?

Use this as your config for Broadlink plug-in in homebridge


            "platform": "BroadlinkRM",
            "name": "Broadlink",
            "hideScanFrequencyButton": true,
            "hideLearnButton": true,
            "hideWelcomeMessage": true,
            "accessories": [
                { 
"name": "RF Scan", 
"type": "learn-code", 
"scanFrequency": false }
}

Then you restart homebridge. And notice a switch called "RF Scan" in home app

When you turn it on, will turn off automatically 

After turn it on, press your remote pointed to Broadlink rm4 and on homebridge ui log will appear a hex code for the ir 
brentleeper commented 6 months ago

I'm not doing ir. Only rf.

arthur-moebios commented 6 months ago

In this case all you need is change scanFrequency to true in RF Scan accessory

brentleeper commented 6 months ago

Thanks for the explanation. I will try this tomorrow.

Also when I scanned with the app I only had success when I was able to manually set the frequency.

I am not sure if that is possible.

brentleeper commented 6 months ago

Sorry for the delay. This does not work. The only way I can get this to work is by using the official app and even in the app it only works when I explicitly set the frequency that is listed in the FCC registration.

arthur-moebios commented 6 months ago

Oh @brentleeper, that's sad

JasonGoldenDDT commented 4 days ago

Just adding my experience here. I have issues with RM3 dropping off network and returning every 30-45 minutes, likely due to congested wifi environment.

I attempted to add the hosts manually as described in this post and found it broke them. I reverted back to auto discovery method and it restored functionality.

Using latest builds of plugin, OS, and Homebridge as of this post.

brentleeper commented 3 days ago

Just adding my experience here. I have issues with RM3 dropping off network and returning every 30-45 minutes, likely due to congested wifi environment.

I attempted to add the hosts manually as described in this post and found it broke them. I reverted back to auto discovery method and it restored functionality.

Using latest builds of plugin, OS, and Homebridge as of this post.

I forked this repo and added a cli script called custom_device_creator, you can run this to create a custom device. I also made a server which can use the custom device. When the server gets a request it determines the payload to send to the RM3. Been using it daily since I wrote it.

Trying to set this up before was very challenging.

https://github.com/brentleeper/python-broadlink

JasonGoldenDDT commented 3 days ago

I'm not advanced enough to fully understand the implications and usage of your changes. Though I appreciate your time and effort on this project.

How should I adjust my environment to account for these changes? I'm using 4.4.18 at the moment and manually setting hosts in the config still breaks. What version should I install to test?

brentleeper commented 3 days ago

I'm not sure, that's why I made my fork. I couldn't figure this out and so I made it simple using the script I mentioned. Beyond that I will not be of any help unfortunately. Best wishes.