[WITHDRAWN - Use the new Broadlink integration by @tomw] NATIVE Broadlink RM/RM Pro/RM Mini/SP driver

NOTE: New BETA Release - RC HVAC Manager - Details HERE

Broadlink RM2/RM2 Pro/RM3 Pro/RM3 Mini/SP driver (BETA)

WARNING: DO NOT purchase a "BestCon" or "RM4" or "RM4C" or "Powered by FastCon" device to use with this driver. The "BestCon" devices are designed to be CLOUD ONLY and do not have local control when configured and used by the Broadlink Universal Remote app.

IF you have accidentally purchased an RM4 device (or already own one), You MAY be able to unlock it. Note that an unlocked RM4 device can NOT be used with any of the Broadlink apps.

.

Features:

  • Supports sending Broadlink IR Codes (on RM/RM Pro/ RM Mini devices)
    • (HEX string encoded and Base64 encoded)
  • Supports sending Broadlink RF Codes (on RM Pro devices)
    • (HEX string encoded and Base64 encoded)
  • Supports sending Pronto IR Codes (on RM/RM Pro/ RM Mini devices)
  • Learn IR Codes (on RM/RM Pro/ RM Mini devices)
  • Learn RF Codes (on RM Pro devices)
  • Relay/Switch on/off (on SP devices)
  • Temperature (on devices with embedded temperature sensors)
  • Driver can be used standalone or with the management application
    NOTE: The application will not manage any devices created manually.

Before you begin:

  1. Make sure you hubitat is upgraded to Hubitat platform v2.1.8 or greater
  2. Make sure that your Broadlink device is on the same local network as the Hubitat. This is done by installing the device with the eControl or IHC app. This driver will co-exist with these apps. If your device will not configure with either of these apps, it will not work with this driver.
  3. The IP Address of your Broadlink device. (If you wish to use the driver standalone), you will need to determine the IP address of the device from your router. As with all WiFi smart home devices, it is recommended that you assign an static IP to the device (using DHCP reservation on your router). If you will be using the management application, the application will determine and manage the IP Address for you.

NOTE 1: The driver does NOT connect to the broadlink cloud server, and only connects to the Broadlink device directly on your LAN.
NOTE 2: The application/driver can NOT import existing codes from the eControl or IHC app.

.

Installing the package:

  1. On the web interface, go to "drivers code", then click on "New driver"
  2. Copy/Paste the driver code into the editor, then click "Save". This will create a user driver named "Broadlink (BETA)"
  3. On the web interface, go to "Apps code", then click on "New App"
  4. Copy/Paste the App code into the editor, then click "Save". This will create a user Application named "Broadlink Device Manager (BETA)"

.


Using the Application
The application allows management of devices (automatically installing the driver for discovered devices), Management of IR and RF codes (Learning and Manual entry) and automatic sharing of codes between the application and drivers. Manually installed drivers can not be used by the application and can not share codes using the application.


Installing the Application:

  1. Click on "Apps", then click "Add User App". On the user application list, click on "Broadlink Device Manager (BETA)".
  2. When the software disclaimer is displayed, click on "Done" to complete installation of the application. You will be returned to the Hubitat "Apps" menu.
  3. Click on "Broadlink Device Manager (BETA)" to launch the application.

.

Installing Devices (Application):

  1. from the Applications main menu, click on "Devices". The devices page will load (this may take up to a minute).
  2. The application will present a list of available devices.
  3. Click on the device you wish to configure.
  4. The application will present the "Configure Device" page. You can use the name of the device provided by the device, or enter the desired name is the area provided and click "done".
  5. The application will create the driver for the selected device, then return to the "Devices" page. The device page will now show any remaining available (unconfigured) devices and currently configured devices.
  6. To install additional devices, proceed from step 3.
  7. When done working with devices, click on "Done" to return to the main menu.

NOTE: It is highly recommended that you use the "static DHCP" function of your router to assign static IP addresses to your Broadlink devices. If this is not possible, you can still use the devices, but they will stop working if their IP Address changes. To correct the IP Address used by the application and device drivers, run the application and go to the "Devices" page. During the device discovery process, the application will update the IP Address used for each configured device.

.

Learning IR Codes: (From the Application)

  1. From the application main menu, click on "Remote Codes".
  2. When the application opens the "Remote Codes" page, it imports any remote codes that have been stored in the driver.
  3. If you have more than one configured device, he application presents the available devices at the top of the page. Click on the device you wish to use to select it for use with learning codes. If you have only one device, it is automatically selected.
  4. Click on "Learn IR code"
  5. Follow the instructions presented on the "Learn IR Code" page.

Learning RF Codes: (From the Application)

  1. From the application main menu, click on "Remote Codes".
  2. When the application opens the "Remote Codes" page, it imports any remote codes that have been stored in the driver.
  3. If you have more than one configured device, he application presents the available devices at the top of the page. Click on the device you wish to use to select it for use with learning codes. If you have only one device, it is automatically selected.
  4. Click on "Learn RF code"
  5. Follow the instructions presented on the "Learn RF Code" page.

.

NOTE: You can also learn an IR or RF code from the Hubitat driver page for your device. Code learned in this way will NOT appear in the application as an available code UNLESS you synchronize the codes to the application. Once synchronized, the codes are available to all configured devices.

.

.


STANDALONE OPERATION
Manually installed drivers are standalone. The can not use codes that have not been learned by, or entered into, the specific driver. Standalone drivers are not manageable by the management application.


Installing the driver (Standalone):

  1. Click on "Devices", then click "Add Virtual Device". On the device creation page, set "Device Name" to a unique name, and set "Type" to "Broadlink (BETA)", then click "Save Device".
  2. On the Device edit page, Enter the devices IP Address in "IP" under preferences and click "Save Preferences"
  3. Once the device edit page reloads, click on the "initialize" control, to configure the driver to the device. If all works, the driver will populate a deviceConfig attribute under current state.

At this point, the driver is functional. If your device has a temperature sensor or a relay/switch, the driver will poll the device every 5 minutes for status updates (This will be configurable in subsequent versions)

.

Learning IR Codes: (From the driver)

  1. Click on the LearnIR button.
  2. Within 30 seconds, point your remote at the device and press the button you wish to learn.
  3. If successful, the read code will be displayed in the "CODEDATA" attribute under "Current States" . You can copy the code for use in the "Send Code" control or in Rule Machine.
    NOTE: The "IR_Status" attribute displays instructions/status during the learn process

Learning RF Codes: (From the driver)

  1. Click on the "Learn RF control.
  2. Within 30 seconds, Press and hold the button you wish to learn.
  3. When Prompted (by the RF_Status attribute), release the button, then start pressing and releasing the button repeatedly.
  4. If successful, the read code will be displayed in the "CODEDATA" attribute under "Current States" . You can copy the code for use in the "Send Code" control or in Rule Machine.
    NOTE: The "RF_Status" attribute displays instructions/status during the learn process
  5. To test the code, click on the "SendLastCode" control. This control will send the last code that was learned from or sent to the device.

Saving IR/RF Codes: (From the driver)

  1. Learn a code with the "learnIR" or "learnRF" control
    -or-
  2. paste a code into the "SendCode" or "SendProntoCode" control and click on the control.
  3. Enter a name for the code into the "StoreCode" control, and click on the control

.


Sending IR/RF codes:


  1. (From the driver) Paste a previously learned or found IR or RF code into the "Send Code" control and click on it. This control will accept a code that is a HEX STRING or a Base64 encoded byte array (As used by Home Assistant and other platforms

-OR-

  1. (From the driver) Paste a Pronto format code into the "Send Pronto Code" control and click.

-OR-

  1. Create an action in Rule Machine to send a code.
    a) Select action type "Set Mode or Variables, Run Custom Action"
    b) Select "Run Custom Action"
    c) Select "Actuator" under "Select capability of action device"
    d) Select your device in the list
    e) Choose "SendCode" or "SendProntoCode" as the action, select "string" as the parameter type, then paste the code into the "string value" field
    -or-
    e) Choose "SendStoredCode" and specify the name of the stored code in the "string value" field
    f) Click "done with this action".

.

Sending Stored IR/RF Codes:

  1. (From the driver) - Enter the name of a stored code into the "SendStoredCode" control, and click on the control
    -OR-
  2. Create a Dashboard tile. Select the device that should send the code. Select the "Button" template. Enter the NAME of the stored code in the "Button Number" field.

.


Using the generateIR command:
The generateIR command allow the driver to build and send an IR code to a device that uses a bitmapped command structure (many portable AC units, mini-split and split systems)
The parameters are:

  • offBurst - The burst pair used for a ZERO bit
    IE: 0D0C
  • onBurst - The burst pair used for a ONE bit
    IE: 0D29
  • leadIn - The burst pair(s) used for the command lead in
    IE: 000507000CB36938
  • bitmaps - The binary encoded command data
    IE: 00101000110001100000000000001000000010000111111110010000000011001000010010000000110000000000000000000000000000000000010011010001
  • leadOut - The burst pair(s) used for the command lead out
    IE: 0E000290

Version History - Broadlink:

  • v0.17 : Initial public beta

  • v0.18: Fixed IR/RF learn data parsing when device response does not respond with a payload

  • v0.19: Fixed error in parseAuthData, added code management functions - StoreCode(), SendStoredCode(), SendLastCode

  • v0.20: Fix for unexpected IR Learn behaviour on RM Mini devices

  • v0.21: Verified fix for unexpected IR Learn behaviour on RM Mini devices

  • v0.22: Added support for sending code from a Dashboard

  • v0.23: fixed issue when driver crashes when used with RM3 Pro Plus

  • v0.30: Beta release of Broadlink Manager App

  • v0.31:
    APP: Fixed manual code entry would not accept Base64 codes or codes with padding
    APP: Added splash screen on initial install to ensure proper installation of the application
    APP: Reworked manual code entry to allow cancelling

  • v0.32:
    APP: added automatic device IP update for configured devices (go to device management page to automatically update all child devices
    DRIVER: fixed issue with deviceConfiguration reset function

  • v0.33:
    APP: made automatic code import optional

  • v0.36:
    APP: fixes to issue where deviceNetworkID is changed to the device IP address causing an app crash
    DRIVER: prevent changing/updating deviceNetworkId unless in standalone mode

  • v0.40:
    APP: Fix issue that caused "rogue" devices and issue that prevented their removal
    DRIVER: & APP: Fixed issue where Base64 codes that were encoded without the IR-lead-out data would be rejected as invalid

  • v0.41:
    DRIVER: add generateIR command to simplify use with HVAC/AC systems

  • v0.44:
    a) Miscellaneous bug fixes
    b) Fixed - issue that caused crash in device discovery
    c) Added - extra error handling to (hopefully) prevent application errors
    d) Added - detection of missing devices (configured devices that do not appear in the list of discovered devices)
    e) Added - detection and notification, in the available devices list, of cloud locked devices
    f) Added - indication, in the available devices list, of unsupported device

  • v0.46:
    a) Fixed - bug that caused broadlink codes to be interpreted as base64 codes
    b) Added - Option to select number of times a code is re-transmitted

  • v0.47:
    Added - Instructions to assist in unlocking a cloud locked device are presented when trying to configure a locked device.

  • v0.49:
    Added - Support for RM4 devices that have not been cloud locked - RM4 mini, RM4c Mini, RM4 pro, etc.

  • v0.50:
    fixed - code transmission failed when code sent to a child device that did not have code repeats explicitly set (child device create by app < v0.46)
    .

.

Latest stable Broadlink package is v0.41

Latest available Broadlink package isv0.50

Latest RC HVAC Manager package is available HERE

32 Likes

Wow this is great, will try it when I get the chance!

1 Like

I’ve had a brand new one in its box for over two years. Time to break it out I think :+1::+1:

2 Likes

Will this support multiple broadlink devices? (I want to put them in each room)

Yes. Install a virtual device for each physical device.

3 Likes

Perfect, i'm ordering some now on Amazon.

Thanks for sharing!

I get this error with learnIR. Any idea what could be going wrong?

I have an RM Mini 3, and I can see the LED on the device light up as it goes in to learning mode and then go off after I press the button on my IR remote. But it seems to break down when handling the reply.

Here's device state, in case it helps.

  • {"devType":10039,"hasAuth":true,"relayCount":0,"internalID":"01000000","hasIR":true,"hasTemp":false,"IP":"10.0.0.111","devTypeName":"RM Mini","MAC":"(redacted)","isPro":false,"KEY":"F114214C27FBDC10AEC508AC27154179","Name":"\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd"}
  • temperature : -100

ev:19022020-01-07 10:43:20.674 pm errorjava.lang.ArrayIndexOutOfBoundsException: 0 on line 963 (parseDataIR)

dev:19022020-01-07 10:43:20.647 pm debugBLTest - parseDataIR: parsing response packet. IP [0a00006f] 5AA5AA555AA5AA5500000000000000000000000000000000000000000000000093CBFBFF2A27EE030200EADD7442F7C801000000AFBE0000

dev:19022020-01-07 10:43:20.644 pm debugBLTest - parseDataIR - received description: index:00, mac:(redacted), ip:0a00006f, port:50, type:LAN_TYPE_UDPCLIENT, payload:5AA5AA555AA5AA5500000000000000000000000000000000000000000000000093CBFBFF2A27EE030200EADD7442F7C801000000AFBE0000

The latest version, available in the first post, should fix this.

I have posted a new version, v0.19, that adds some IR/RF code management functions, and some minor bugfixes... It is available in the first post.

1 Like

Thanks for the quick update.

It works now, but it's pretty finicky. If I execute learnIR, it very quickly goes into IR_Status ERROR. If I start rapidly pushing the intended button and then execute learnIR, it usually goes to IR_Status Learned Code and then back to IDLE.

It seems like there is a timing issue in the communication, at least on my system. Maybe since learnIR is able to be re-attempted manually, you could just retry on ERROR (for a reasonable amount of time) when the learning process is initiated?

Sending commands from CODEDATA with Send Code works well. I also used it successfully with some of the stored codes I have from @rob121 's broadlinkgo implementation. Pretty cool!

EDIT: This was with v0.18, just so that is clear. I'll give it another shot with v0.19 later.

I am not seeing this on my system... I'm testing with a RM2 Pro Plus2...

The learnIR() function already uses a 30 second timeout, and the learnRF() function uses a 30 second timeout per step.

If the learnIR() function is giving you trouble, please post the log of the function being executed so I can figure out whats going wrong.

Very cool! Is this all local, or does it have to go out to a broad link cloud service?

Terrific! Many thanks for contributing this.

Yes.

2 Likes

I've got amazon.com open in another browser window...before I buy more Broadlink devices, do you have specs on which hardware is supported by the driver?

For example, I found that the Broadlink Mini Bean has a different device fingerprint from the Broadlink Mini 3 (as used by [broadlinkgo](broadlinkgo/knowndevices.go at master · rob121/broadlinkgo · GitHub and [homebridge-broadlink-rm(Broadlink RM mini 3 - unknown device 5f36 · Issue #515 · lprhodes/homebridge-broadlink-rm · GitHub)).

I updated to support that recently:

But I don't have the device so if somone test it let me know, either way @cybrmage feel free to crib from my code, if this works better, I'll be happy to stop using my own, less dependency is best!

rob121Owner

5m

I updated to support that recently:

(Where "that" is the Broadlink RM Mini Bean.)

Yes, absolutely...I didn't mean to suggest that you don't support it now, just to point out the difference between hardware models (and a source for device fingerprints).

In the RM line of products, there are basically just 3 devices: RM, RM Pro and RM Mini.

They all support the same communications methods and protocol, regardless of branding. The different device IDs differentiate between various different brandings and hardware revisions, BUT the protocol hides them, and the protocol is all the same... If you get a device with an ID that is not in the list... not to worry... A single line of code will resolve that...

1 Like

I am confused by the device naming, but I have a device that I have used with both broadlinkgo and cybrmage's BETA driver.

I bought it from Amazon from this page: https://www.amazon.com/Broadlink-RM-Mini3-Universal-Controller-Compatible/dp/B01FK2SDOC

I don't recall it being named "Black Bean" at the time, but that is definitely the model I bought from Amazon in July, 2019. Maybe they have transitioned to new variants or changed the product ID in the meantime, so YMMV.

It shows up as ID 10039 (0x2737) in cybrmage's driver. broadlinkgo doesn't list the ID, but my devices work there (and worked prior to Rob's recent update).

Is this thread crashing chrome on Android for anyone else? It does for me.

2 Likes