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

I Figured I had started my Journey in this thread so I may as well post the solution I am using. Keeping in mind my issues was getting the RM4 Pro RF learning and sending. I was working with Felipe Martins Diel (Broadlink RM4 PRO is not able to learn or to send RF Signal · Issue #358 · mjg59/python-broadlink · GitHub) who i believe has a fix however it is going to be a while till we see it production. So in the interim this is how I am using it.

Short Version
Ensure you have the latest HA (I am on 0.112.2) not sure which version brought in the first set of fixes

  • Python-broadlink to add the RM4 to the wifi without cloud integration

    broadlink.setup(‘myssid’, ‘mynetworkpass’, 3)

  • Broadlink_Cli to capture the RF codes

    ./broadlink_cli --rfscanlearn --device “0x6026 [IPADDRESS] [MAC]”

  • Add the device into home assistant configuration.yaml
script:
  name_of_the_script:
    sequence:
      - service: broadlink.send
        data:
          host: [RM4 IP ADDRESS]
          packet: sgAsAhEREhESEQIEhEBEhESERISERIRARIiEQESERISERESEhEAAF3AAAAAAAAA==

The Long Version
Installing python-broadlink
Use a device with wifi (so you can connect to the Production Wifi and RM4 AP)

git clone GitHub - mjg59/python-broadlink: Python module for controlling Broadlink RM2/3 (Pro) remote controls, A1 sensor platforms and SP2/3 smartplugs
cd python-broadlink
sudo python setup.py install

Factory Reset (Ensure it is not cloud joined)

  • Reset hold reset button till flashes
  • Hold reset button to get hot spot paring
  • Join Computer to Broadlink WiFi to connect to the RM4

Setup RM using python-broadlink

  • Configure device for Wifi

    python import broadlink
    broadlink.setup(‘myssid’, ‘mynetworkpass’, 3)

  • Allow device time to reboot and connect to wifi (LED should no longer flash)
  • Test device communications

    devices = broadlink.discover(timeout=5) devices[0].auth() > should return true devices[0].host[0]
    Should return IP of Device

Capture RF sequences
NB Fix is underway for RM4 Pro broadlink.learn however not available in HA yet Broadlink RM4 PRO is not able to learn or to send RF Signal · Issue #358 · mjg59/python-broadlink · GitHub

Use broadlink_cli to capture RF codes

  • Capture RF Sequence

    ./broadlink_cli --rfscanlearn --device “0x6026 [IPADDRESS] [MAC]”

  • Test Sequence from HA: Developer Tools > Services
    • Service: broadlink.send

    host: 192.168.1.13
    packet: sTgaAAcQBxAHDwgIDhAHEAcPCA8HCA4IDgkOCQ7+AAAAA

    • If no action re-capture using broadlink_cli otherwise good to use it for the scripts/switches

Home Assistant Configuration
I am controlling fans so I have a bit more of a complex configuration for fan speed control sending sequence directly

Sending RF Sequences with scripts/automation

script:
  name_of_the_script:
    sequence:
      - service: broadlink.send
        data:
          host: [RM4 IP ADDRESS]
          packet: sgAsAhEREhESEQIEhEBEhESERISERIRARIiEQESERISERESEhEAAF3AAAAAAAAA==

Configuration.yaml Switch

switch:
  - platform: broadlink
    host: [RM4 IP ADDRESS]
    mac: [RM4 MAC ADDRESS]
    type: rm4_pro
    timeout: 15
    switches:
      tv_samsung_power:
        friendly_name: "Samsung TV Power"
        command_on: '[RF SEQUENCE]'
      tv_samsung_volume:
        friendly_name: "Samsung TV Volume"
        command_on: '[RF SEQUENCE]'
        command_off: '[RF SEQUENCE]'
1 Like