BroadLink RM Pro and TC2 for Home Assistant

BroadLink RM Pro is a WiFi to RF/IR gateway for smart home. First of all you need it to control BroadLink TC2 smart switches. Also it is very useful if you want to control IR devices from Home Assistant.

There is a documentation on home-assistant.io on broadlink platform. Here is just a quick summery with notes.

  1. Add new device to BroadLink E-Control app
  2. In the app go to Menu -> Share -> Share to other phones in WLAN -> Cancel
  3. Copy jsonSubIrjsonButton and jsonIrCode files from phone’s /broadlink/newremote/SharedData/folder to PC
  4. Install python 2.7 on PC
  5. Run pip install simplejson
  6. Copy getBroadlinkSharedData.py from NightRang3r’s repository to a folder near files from p.3
  7. Run python getBroadlinkSharedData.py
  8. Select a device to get codes
  9. Find results in a newly created file in the same directory.
  10. Remove all new line symbols from code prior of using it in Home Assistant

Home Assistant TC2 configuration example and how to make a light component based on switch component:

switch:
  – platform: broadlink
    host: 192.168.2.93
    mac: "78:0F:77:00:C8:95"
    timeout: 15
    switches:
      living_room_lights_power:
        friendly_name: "Living room lights power"
        command_on: ‘6RRGAN8JCRYJFhYJCRYJFgkWCRYWCRYJFgkJFgkWCRYJFhYJCRYJFgkWFgkWCRYJFgkWCQkWFgkWCQkWCRYJFgkWFgkJFgkAAUg=’
        command_off: ‘6RRGAN8JFgkWCQkWFgkWCRYJFgkWCRYJCRYJFgkWCRYWCQkWCRYWCRYJCRYWCQkWCRYJFgkWFgkWCRYJCRYJFhYJCRYJFgkAAUg=’
      hallway_lights_power:
        friendly_name: "Hallway lights power"
        command_on: ‘6RRGAN8JFgkJFgkWCRYJFhYJCRYWCQkWCRYJFhYJFgkJFhYJFgkJFhYJCRYJFhYJFgkJFhYJFgkWCQkWFgkJFhYJCRYJFgkAAUg=’
        command_off: ‘6RRGAN8JFgkJFgkWFgkJFhYJCRYJFgkWFgkJFhYJCRYWCRYJCRYWCQkWFgkWCRYJCRYWCQkWCRYJFgkWCRYWCRYJFgkWCQkAAUg=’

light:
  – platform: template
    lights:
      living_room:
        friendly_name: "Living room lights"
        value_template: ""
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.living_room_lights_power
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.living_room_lights_power
      hallway:
        friendly_name: "Hallway lights"
        value_template: ""
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.hallway_lights_power
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.hallway_lights_power

Leave a Reply

Your email address will not be published. Required fields are marked *