Integration with Broadlink TC2 and Broadlink Hub with Raspberry Pi

@Danielhiversen @oliverdog No i don’t get any error it triggers even it blinks led on the RM pro but it don’t turn on the light. once i relearn the code it works.

i will try to update rm firmware and i will try again. i will update you guys thanks.

any one have try this ?

USING E-CONTROL REMOTES

If you already have your remotes learned on E-Control app you can use this method to “copy” trem to HA.

First get or learn all the remotes you want to add on HA in E-Control

Download
Get the script from here.
Dump the data from the app
Open the E-Control app on your mobile device. On the left side menu choose “Share” and then “Share to other phones in WLAN”. It will generate the files you will need for the script.
Get data from your Android device
Connect your Android device to your computer and browse the SD card / External Storage folder “/broadlink/newremote/SharedData/”. You need to get the following files and put them in the same folder as this script.:
jsonSubIr jsonButton jsonIrCode
Install Requirements
Run pip install simplejson. You must install simplejson in the same python version you will use to run the scripts. You can ensure that the current version is installed by attempting to install again and confirming that you see “Requirement already satisfied”.
Get the data from the device
Navigate to the folder you downloaded and run python getBroadlinkSharedData.py. Follow the steps on screen. NOTE: These scripts were only tested with Python 2.7.
Install python-broadlink library:
git clone https://github.com/mjg59/python-broadlink.git
cd python-broadlink
sudo python setup.py install
Test the codes Use the sendcode script you have already downloded to test the codes you got from the device You need to edit the script with your RM Pro IP Address and MAC Address and with the code in hex format. When run the script, you know the code works when get message Code sent… Not every code works.
Convert the hex codes to base64 Use this tool to convert the hex codes to base64 for use with Home Assistant.

@Danielhiversen @oliverdog IR codes work fine but RF codes im facing problem it just does not work no matter how many times i relearn code after a day or no it stops working i tried replacing RM pro but problem is same…it works fine with E-control app… i have 3 light and one rf socket which i want to control…is there any HTTP method to control this 3 lights ? RM firmware is v20025

@oliverdog @Danielhiversen i just upgraded to Home Assistant 0.36.1 i get an error when i open HA

this is the error message in HA log file. please help me

17-01-28 11:57:24 homeassistant.bootstrap: Not initializing switch.broadlink because could not install dependency broadlink==0.3
17-01-28 11:57:41 homeassistant.bootstrap: Not initializing sensor.broadlink because could not install dependency broadlink==0.3
17-01-28 11:57:58 homeassistant.bootstrap: Not initializing sensor.broadlink because could not install dependency broadlink==0.3

Please stop pinging me. I will help you when I have time.

You will find some info by searching: https://community.home-assistant.io/search?q=could%20not%20install%20dependency%20broadlink%3D%3D0.3

edit: See here: Broadlink RM Mini 3 [could not install dependency]

sorry about that

it worked thank you.

when I learn a code it does not show in logbook, it shows as a notification in the frontend. how can I copy it?

You can also find the code under Developer Tools → States.

1 Like

Hi I just used the

getBroadlinkSharedData.py

script to get the TC2 codes dumped.

I have a TC2 2 Gang, but the TC2.TXT files contains 6 codes … (Button ID from 245 to 250).

But I should have 2 codes no (or maybe 4, but not 6)???

Following these instructions

and getting the error
Input strings must be a multiple of 16 in length

I do not understand these phrases of the instruction

“If not working keep going 3,4,5,6 time until it works with the script.”

meand duplicate the code 3, 4, 5, 6 times???

Hi I have a strange problem.

I control a TC2 switch (RF433) from the RMPRO in HASS. When I trigger the switch with the automation, the signal sent is 2-3 times, so the TC2 goes ON, then OFF, then ON again. Same for when sending the signal OFF (goes OFF, then ON, then OFF).

A bit annoying.

  - platform: broadlink
    host: 192.168.1.90
    mac: 'b4:43:0d: 
    switches:
      storageroom:
        command_on: '6RRGAN8JFgkJFgkWCRYWCQkWFgkWCRYJCRYJFhYJCRYJFhYJCRYJFhYJCRYJFgkWCRYJFhYJCRYJFhYJFgkWCQkWCRYWCQkAAUjpFEYA3wkWCQkWCRYJFhYJCRYWCRYJFgkJFgkWFgkJFgkWFgkJFgkWFgkJFgkWCRYJFgkWFgkJFgkWFgkWCRYJCRYJFhYJCQABSOkURgDfCRYJCRYJFgkWFgkJFhYJFgkWCQkWCRYWCQkWCRYWCQkWCRYWCQkWCRYJFgkWCRYWCQkWCRYWCRYJFgkJFgkWFgkJAAFI6RRGAN8JFgkJFgkWCRYWCQkWFgkWCRYJCRYJFhYJCRYJFhYJCRYJFhYJCRYJFgkWCRYJFhYJCRYJFhYJFgkWCQkWCRYWCQkAAUjpFEYA3wkWCQkWCRYJFhYJCRYWCRYJFgkJFgkWFgkJFgkWFgkJFgkWFgkJFgkWCRYJFgkWFgkJFgkWFgkWCRYJCRYJFhYJCQABSOkURgDfCRYJCRYJFgkWFgkJFhYJFgkWCQkWCRYWCQkWCRYWCQkWCRYWCQkWCRYJFgkWCRYWCQkWCRYWCRYJFgkJFgkWFgkJAAFI'
        command_off: '6RRGAN8JCRYJFgkWCRYJFgkWFgkJFhYJCRYWCRYJCRYWCRYJCRYWCRYJCRYWCQkWFgkJFgkWCRYJFgkWFgkWCQkWFgkWCQkAAUjpFEYA3wkJFgkWCRYJFgkWCRYWCQkWFgkJFhYJFgkJFhYJFgkJFhYJFgkJFhYJCRYWCQkWCRYJFgkWCRYWCRYJCRYWCRYJCQABSOkURgDfCQkWCRYJFgkWCRYJFhYJCRYWCQkWFgkWCQkWFgkWCQkWFgkWCQkWFgkJFhYJCRYJFgkWCRYJFhYJFgkJFhYJFgkJAAFI6RRGAN8JCRYJFgkWCRYJFgkWFgkJFhYJCRYWCRYJCRYWCRYJCRYWCRYJCRYWCQkWFgkJFgkWCRYJFgkWFgkWCQkWFgkWCQkAAUjpFEYA3wkJFgkWCRYJFgkWCRYWCQkWFgkJFhYJFgkJFhYJFgkJFhYJFgkJFhYJCRYWCQkWCRYJFgkWCRYWCRYJCRYWCRYJCQABSOkURgDfCQkWCRYJFgkWCRYJFhYJCRYWCQkWFgkWCQkWFgkWCQkWFgkWCQkWFgkJFhYJCRYJFgkWCRYJFhYJFgkJFhYJFgkJAAFI'
        friendly_name: 'Storageroom'


  - alias: "Storageroom light on"
    initial_state: 'on'
    trigger:
      - platform: state
        from: 'off'
        to: 'on'
        entity_id: binary_sensor.door_window_sensor_158d000111a31c
    action:
      service: switch.turn_on
      entity_id: switch.storageroom
  - alias: "Storageroom light off"
    initial_state: 'on'
    trigger:
      - platform: state
        from: 'on'
        to: 'off'
        entity_id: binary_sensor.door_window_sensor_158d000111a31c
    action:
      service: switch.turn_off
      entity_id: switch.storageroom

I converted the TC2 signal following the instructions

Your TC2 code is so long.
The length of TC code is usually 148 and converted code is like a below.
“6RRGAN8JCRYWCQkWCRYJFhYJCRYWCQkWFgkJFgkWFgkJFgkWCRYWCRYJCRYWCQkWFgkWCRYJFgkWCRYJFgkWCQkWCRYWCQkAAUg=”
But it doesn’t now work in HA

You have to add ‘AAA=’ between the last ‘g’ and ‘=’ like this.
“6RRGAN8JCRYWCQkWCRYJFhYJCRYWCQkWFgkJFgkWFgkJFgkWCRYWCRYJCRYWCQkWFgkWCRYJFgkWCRYJFgkWCQkWCRYWCQkAAUgAAA==”
It will work well.

1 Like

No my problem,solved, was the position of the door sensor (vertical), putting them horizontal worked.

The code is 6 times long, only code working

Hi All,

Does anyone know how to get the states of the switches into frontend?

At the moment, when I turn on/off on the TC2 physically, the states on frontend do not change.

Also I can’t figure out how to change the title of the switch from “Switch”. I tried changing friendly_name to “Main” and Main (without quotes). Is this a bug or a configuration issue?

This is my config:
switch:

  • platform: broadlink
    host: 10.160.0.80
    mac: ‘34:EA:34:E7:F8:D6’
    friendly_name: Main
    timeout: 30

@osiris You can’t get the state from the TC2 switches because they are RF based switches so if you turn on/off physically you will not be able to see the change in HA.

Regarding the display of the switches names you should create a group and add it to the view you would like to see it in, for example, the default view, it should be something like this:

 switch:
  platform: broadlink
  host: 10.0.0.12
  mac: 'B4:00:00:00:00:00'
  timeout: 15
  switches:
    entrance_light:
      friendly_name: "Entrance Light"
      command_on: 'AAAAAAAAAAAAAAAAAAAAAAAA=='
      command_off: 'AAAAAAAAAAAAAAAAAAAAAAAA=='

    side_light:
      friendly_name: "Side Lights"
      command_on: 'AAAAAAAAAAAAAAAAAAAAAAAA=='
      command_off: 'AAAAAAAAAAAAAAAAAAAAAAAA=='


group:
  default_view:
    view: yes
    icon: mdi:home 
    entities:
      - group.g_entrance

  g_entrance:
    name: Entrance
    entities:
      - switch.entrance_light
      - switch.side_lights
1 Like

Thanks @NightRanger !

Any suggestions on how I can now get states on my lights setup? change the bulbs perhaps?

Use wifi light bulbs or zwave light switches instead of rf that are supported by HA.

1 Like