Broadlink RM-PRO and TC2 switch

great job , now im using NightRang3r/Broadlink-e-control-db-dump/blob/master/getBroadlinkSharedData.py to get a tc2 switch code , but tat code not work for me , did u have any suggestion?

My problem same like u b4 , i really dunno how to fix my problem :cry:

Hi Luis_Goh, can you send me what your getBroadlinkSharedData.py is returning?

now i already get my tc2 switch hex code
e90a4200df0909160916091609160916160909160916091616090916160909161609091616090916160916091609091609160916091609160916091616091609091616091609 after tat i convert to base64
6QpCAN8JCRYJFgkWCRYJFhYJCRYJFgkWFgkJFhYJCRYWCQkWFgkJFhYJFgkWCQkWCRYJFgkWCRYJFgkWFgkWCQkWFgkWCQ==
but this code still NOT WORKING for my TC2 switch…

This print is your first part of the script getBroadlinkSharedData.py,
when you input the ID, the script print another informations about the code of this specific device.

Send me this return, Copy an Paste Here.

If the return send 6 codes, you need to copy the first and the second to concatenate and put the result string where: in the send_data

Ex.:
cod1 = “CLKJDLKJSLKJFSLKJFLSKDJLKDF”
cod2 = “asdasdfasldfjasdf”
device.send_data(binascii.unhexlify(cod1 + cod2))

this works to me

1 Like

ok , u mean use
Button Name: | Button ID: 64 | Code: e90a4200ef0909160916160916091609091616090916160909161609160916090916160916091609091616090916091609161609091609161609160916091609160916090916
+
Button Name: | Button ID: 65 | Code: e90a4200ee0916090916091616090916091609161609160916090916091609161609160909160916160916091609160916090916091609161609091616090916160909160916
convert to base64 code ?

Yes That is,

you just need to concatenate code 64 to code 65 to turn on and change the order to turn off like this:

TURN ON
e90a4200ef0909160916160916091609091616090916160909161609160916090916160916091609091616090916091609161609091609161609160916091609160916090916e90a4200ee0916090916091616090916091609161609160916090916091609161609160909160916160916091609160916090916091609161609091616090916160909160916

TURN OFF
e90a4200ee0916090916091616090916091609161609160916090916091609161609160909160916160916091609160916090916091609161609091616090916160909160916e90a4200ef0909160916160916091609091616090916160909161609160916090916160916091609091616090916091609161609091609161609160916091609160916090916

now you put one of this values in a variable like:
myhex = “e90a4200e…”

and then you pass this variable to this command:
device.send_data(binascii.unhexlify(myhex))

get this code here

in the line 17 has a variable “codeData” put one of the values in this variable,
and the line 21 change the command to this one:
device.send_data(binascii.unhexlify(codeData))

ps.: to use this binascii.unhexlify you will need to import this library in the top of the file
import binascii

1 Like

thx u very much ,is work for me:slight_smile:

Any assistance would be great, I am stuck at the point on getting the results from using the ‘getBroadlinkSharedData’ for the TC2 2 gang plug. I get the following output:

Button Name: 1-Gang | Button ID: 88 | Code: e9144600df090916160916090916160916090916160916090916160916091609091616090916160909161609160916090916091616090916091609160916160916090916160909000148

Button Name: 1-Gang | Button ID: 89 | Code: e9144600df091609160916091609160916091609160916091609160909160916091609160916091609160916160909160916160916090916160916091609091609161609160909000148

Button Name: 2-Gang | Button ID: 90 | Code: e9144600df091609160909161609091609161609160909161609091616091609160916091609160909160916160916090916160916090916160916091609160909160916160909000148

Button Name: 2-Gang | Button ID: 91 | Code: e9144600df091609091609161609160909160916160916091609160909161609160909160916091616091609160916091609160916090916160916091609091609161609160909000148

Button Name: | Button ID: 92 | Code: e9144600df091609091609160916160909161609160916090916091609160916160916091609160909160916160916091609160916091609160909161609091616090916160909000148

Button Name: | Button ID: 93 | Code: e9144600df090916091609160916160909161609091616091609091609161609160916091609091609161609091609160916091616091609160916090916091609161609160909000148

Apologies managed to suss it out by looking back at @NightRanger and @masterkenobi comments. Basically what worked for me after testing was to muliply the above code 6 times (same as masterkenobi) then convert to base64: http://tomeko.net/online_tools/hex_to_base64.php?lang=en1

The TC2 sounds very interesting, did anybody figured out if its possible to receive the status of the TC2 somehow? I know z-wave devices can, but some comments above somebody mentioned pressing the physical button changes the switch in the app, can someone confirm?

no, it doesn’t change the state in HA if press the switch physically

Hi Guys,

My HA version is 0.40 and I replaced the broadlink.py to use MP1 & MP2 powerstrips.
http://pastebin.com/AGu9Tph8

I resolved the TC2 issue like below.
Just add 4 zero number to the code and convert it.

My original TC2 code is “e9144600df091609160909161609091609160916091616091609160916091609160909160916091616091609091609161609091616090916091609160916160916091609160909000148”

I added 0000 to it
“e9144600df0916091609091616090916091609160916160916091609160916091609091609160916160916090916091616090916160909160916091609161609160916091609090001480000”

And then convert it at the site http://tomeko.net/online_tools/hex_to_base64.php?lang=en1
If you do it, you can get the output like the below.
“6RRGAN8JFgkWCQkWFgkJFgkWCRYJFhYJFgkWCRYJFgkWCQkWCRYJFhYJFgkJFgkWFgkJFhYJCRYJFgkWCRYWCRYJFgkWCQkAAUgAAA==”

Because of the 4 zero, every converted code end with ‘AAA==’
I have 9 TC2 and they are all working well.

BTW I have some RF Relay which has 120 code length. They also have the problem ‘Input strings must be a multiple of 16 in length’
Below is the problem code:
‘e90834003710133336111333371113333711123413321333123336123611133312331300020b14313710133237111333371113333711133300000000’
I tried to add and remove 0, make it double, I didn’t resolve this problem.

The 120 length code has to be repeated 5 times to work.
Now it works well.

Anybody using those with air conds? Want to get the Broadlink mini and wonder if it will work to switch the air cond in and off?

Hi,

If you mean will the Broadlink Mini will work with an Aircon, yes it will, using IR. You just need to learn the IR codes from the remote.

Hi Guys! HELP ME, please!

I have a Google home and I can switch all TC2 switch with it trough IFTTT Maker.
But I can’t switch other things. I have an LED light with own remote. I set it up like TC2 RF codes, but don’t workin with Google home + IFTTT maker: (This LED switch works well in Home Assistant.)

THIS IS NOT WORKING with IFTTT, but works well in Home Assistant:

galerialed:
  friendly_name: "LED on/off"
  command_on: 'sgY0ACkRKREpESkRKRENKikRKRIMKg0qDSoNKikRDSoNKikRDSoNKg0qDSoNKg0qDSopEQ0AAZAAAAAA'
  command_off: 'sgY0ACkRKREpESkRKRENKikRKRIMKg0qDSoNKikRDSoNKikRDSoNKg0qDSoNKg0qDSopEQ0AAZAAAAAA'

THIS IS OK in IFTTT and in Home Assistant as well:

room:
  friendly_name: "Living Room"
  command_on: '6RRGAN8JFgkWCQkWFgkWCRYJFgkWCQkWCRYJFgkWFgkJFgkWCRYJFhYJFgkJFhYJFgkWCQkWFgkJFgkWCRYJFgkWCRYWCQkAAUgAAA=='
  command_off: '6RRGAN8JFgkJFhYJFgkJFhYJCRYJFgkWCRYJFhYJCRYJFhYJCRYWCRYJCRYWCRYJFgkWCRYJCRYJFgkWCRYWCRYJFgkJFgkAAUgAAA=='

I don’t understand, what is the different,

you can use emulated_hue and so bypass IFTTT

don’t know about your question

hello, someone please help me to get code from e-control app and work it on HA so far i got the file from econtrol app

for econtrol-db-dump

i got rmt.db

when i run econtrol-db-dump.py i get below error

C:\Users\mohammed\Downloads\Broadlink-e-control-db-dump-master\Broadlink-e-control-db-dump-master>econtrol-db-dump.py
  File "C:\Users\mohammed\Downloads\Broadlink-e-control-db-dump-master\Broadlink-e-control-db-dump-master\econtrol-db-dump.py", line 21
    print "Accessory ID: " + str(row[0]) + " | Accessory Name: " + row[1]
                         ^
SyntaxError: invalid syntax

for getBroadlinkSharedData
i got

jsonbutton
jsonlrcode
jsonsublr

when i run getBroadlinkSharedData.py i get this error

C:\Users\mohammed\Downloads\Broadlink-e-control-db-dump-master\Broadlink-e-control-db-dump-master>getBroadlinkSharedData.py
  File "C:\Users\mohammed\Downloads\Broadlink-e-control-db-dump-master\Broadlink-e-control-db-dump-master\getBroadlinkSharedData.py", line 32
    print "ID:", jsonSubIrData[i]['id'], "| Name:", jsonSubIrData[i]['name']
              ^
SyntaxError: Missing parentheses in call to 'print'

Use python 2 not python 3