Broadlink RM-PRO and TC2 switch

you have TC2 switch? Can they dim a non smart bulb?

No. It can’t dim any lights. It just an on/off switch

Hi everyone,

I have the same TC2 switch. I have the same problem which i’m unable to learn the command from home assistant. :frowning:

Who said TC2 is supported? Am I missing something here?

Ow so you mean is not supported yet on TC2? I was asking around and i got a reply from Daniel that use the latest broadlink file and i was just trying out it works but its not. :frowning:

isn’t??

I know that thread. but where does it says TC2 is supported? @Danielhiversen you didn’t say anything about TC2 is supported, right? The last reply I got from you is [quote=“Danielhiversen, post:6, topic:7904”]
TC2 needs to be supported by the library we are using, before we can add support for it
[/quote]

Daniel is a great guy and great programmer … but not in clarity :smiley:

Hehe. :wink:
I am sorry for the confusion.
I am a bit confused my self by all the different Broadlink devices :slight_smile:

that’s alright Daniel. You’ve been great help for all of us. Keep up the good work we do appreciate every time you reply to us. Happy new year everyone!!!

You may be interested on this talk:

https://github.com/mjg59/python-broadlink/issues/54#issuecomment-271367580

1 Like

Thanks. Since my phone is not rooted, I am following the getBroadlinkSharedData.py method. Unfortunately, I cannot find jsonSubIr, jsonButton or jsonIrCode files. This is what I see…

Nvm about this. I can view the files via my phone explorer. Don’t know why it is not showing in my PC.

@oliverdog

I tried to run the script but it returns this error…

$ python3 getBroadlinkSharedData.py
  File "getBroadlinkSharedData.py", line 32
    print "ID:", jsonSubIrData[i]['id'], "| Name:", jsonSubIrData[i]['name']
              ^
SyntaxError: Missing parentheses in call to 'print'

Please help.

Use python2

Thanks. But now I am receiving this error…

$ python2 getBroadlinkSharedData.py
Traceback (most recent call last):
  File "getBroadlinkSharedData.py", line 20, in <module>
    import simplejson as json
ImportError: No module named simplejson

FYI, I installed simplejson using pip3 install simplejson. When I tried to reinstall it using pip, it says…

$ pip install simplejson
Requirement already satisfied: simplejson in /usr/local/lib/python3.4dist-packages

I manage to install Python2 in my Windows PC and manage to generate the text file filed with the TC2 codes. Will try to use the codes in my configuration soon.

@Danielhiversen

I put the codes into my configuration…

switch:
  platform: broadlink
  host: 192.168.1.000
  mac: 'AA:AA:AA:AA:AA:AA'
  switches:
    carporch_light:
      command_on: 'e9144600df090916091616090916091616091609160916091609160916090916160916091609160909161609091609161609160916090916091609161609160916090916160909000148'
      command_off: 'e9144600df090916091609160916160909161609160909160916091609161609160916091609091616091609160916090916091609160916160916091609160909161609160909000148'

It is not working. Any idea why?

That looks like hex format,
You have to convert it to the correct format,
You can try:

I am sorry. How do I use this…?

from base64 import b64encode, b64decode
hex_data  = "e9144600df090916160916090916091616090916160916090916160916090916160909161609091616091609160916091609160916091609091609160916160909161609091609000148"
packet = hex_data.decode('hex')
b64encode(packet).decode('utf8')