Broadlink RM-PRO and TC2 switch

I have this error on: python getBroadlinkSharedData.py

ID: 1 | Name: Audio
ID: 2 | Name: User-Defined Aircon
ID: 3 | Name: Amplituner
ID: 4 | Name: Grzejnik
Select accessory ID: 1
[+] You selected:  Audio
Traceback (most recent call last):
  File "getBroadlinkSharedData.py", line 65, in <module>
    jsonIrCodeData = json.loads(jsonIrCode)
  File "C:\Python27\lib\site-packages\simplejson\__init__.py", line 517, in loads
    return _default_decoder.decode(s)
  File "C:\Python27\lib\site-packages\simplejson\decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "C:\Python27\lib\site-packages\simplejson\decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
  File "C:\Python27\lib\site-packages\simplejson\scanner.py", line 79, in scan_once
    return _scan_once(string, idx)
  File "C:\Python27\lib\site-packages\simplejson\scanner.py", line 47, in _scan_once
    return parse_array((string, idx + 1), _scan_once)
  File "C:\Python27\lib\site-packages\simplejson\decoder.py", line 250, in JSONArray
    value, end = scan_once(s, end)
  File "C:\Python27\lib\site-packages\simplejson\scanner.py", line 45, in _scan_once
    _scan_once, object_hook, object_pairs_hook, memo)
  File "C:\Python27\lib\site-packages\simplejson\decoder.py", line 174, in JSONObject
    key, end = scanstring(s, end, encoding, strict)
  File "C:\Python27\lib\site-packages\simplejson\decoder.py", line 69, in py_scanstring
    "Unterminated string starting at", s, begin)
simplejson.errors.JSONDecodeError: Unterminated string starting at: line 1 column 5176 (char 5175)

Anyone can help?

Hello

can you help me with TC2, l take the 3 file from android app but canā€™t make it work when i run
python getBroadlinkSharedData.py file nothing happen i install python-3.6.3 but nothing work can you help me ?

Have you tried with python2.7.14?

Hello
Yes, i try it and work but when i run getBroadlinkSharedData it give Room TC2.text file nothing inside it i follow what say here:


but canā€™t understand the step from 5 to 11 can you help ?

You have named each button in the App? If there is nothing in the TC2 file then either it failed or there were no codes for it to find. Iā€™m not sure if it works with RF codes I only use IR codes. The rest of the steps can only be done if there is something in the TC2 file. So did you get the three json files from your phone? Are they in the same dir as the getBroadlinkSharedData.py file?

Hi there,

I am getting error while sharing from iPhone to e-Control app running on Nox. I can see my iPhone from where I share the files, start downloading but no progress and gives error. What might be wrong?

Slightly OT, do you know how to take out the blue light of the switch when the switch is off?

I am not sure if I understood right, but the progress bars are not visible in ios version of the program. You should first make a backup with the ios program then reach that program from the bigbox android emulator and choose cloud backup list and restore from there. If you did all those and still getting error you might try a different emulator.

Thanks for the response. Iā€™ve done all these with several emulators, no way. In the meantime my lovely mother came to my home with her Android phone and I used her phone to copy the files.

Hi All, just wanted to follow up to see if anyone actually has the TC switches working now in HA? Doesnā€™t look like anyone found a good solution? Hope we can find an easy way given a lot of us have no neutral wire at our switches. Thanks in advance.

Iā€™ve been running a few TC2ā€™s for nearly a year in HA. A little painful to setup but once the RF codes are learnt, theyā€™re reliable to use in HA. Theyā€™re not, however, reliable to use themselves. Iā€™ve had two of them do this weird flashing then cause the lights to flash then turn off. Itā€™s very annoying but seems to be relating to the temperature and the capacitive touch glassā€¦

Looking for another light switch solution nowā€¦

There is no neutral connection on those switches. Thatā€™s why if you donā€™t use them with classic incandescent lights youā€™ll get the random flashings (they normally output the power needed through the resistance of the light, if the lights are classic, it wont light up, but if they are led you have problems). If you are using them with led lights you have to use the capacitor which is provided with the box. Just connect the capacitor near your lights and all those weird flashing, turning on out of no where etc behavior will vanish.

I can give that a try but Iā€™m not sure it will fix the issues. Iā€™ve replaced one TC2 already and it was good for a few months before it started exhibiting this behaviour again.

Seems a common problem (not my video): https://youtu.be/JAB7Cq3wCjs

I run three of these switches, two 3 gang and one 2 gang and so far two of them have failed. I do run LEDs but without the capacitor, I will give the capacitors a try.

Hi havent fully read the thread but after skimming seems like one of the problems is getting the Hex code, which is the problem I had from RM Plugin (free andriod app) to work in Hass. Easy solution, goto http://tomeko.net/online_tools/hex_to_base64.php and enter the Hex code and convert to Base64. Enter this code into your switch command and it works. So if your on Android its a 2 minute operation. Add your switch to Broadlink e-Control App. Install RM Plugin Lite and follow the instructions there to get the Hex codes. Conver tHex codes on free website and add as a normal switch.

3 Likes

Hello.i have just bought 2 TC2 switches. please show me how to add them to hass.
It failed when I tried to get codeData

Guide to Setting up Hass.io with Broadlink RMPro+ and Broadlink TC2 via RF433

NOTE - I have run this process using a Android 10 phone running the old Broadlinl e-Control app version 3.8.16

  1. Have you RMPro+ powered up and ready
  2. Install Tasker and RM plugin on your Android device
  3. Ensure RM Plugin has its HTTP Bridge option selected and switched on
  4. Set up the Broadlink TC2 using the Broadlink e-Control app to connect to the RMPro+
  5. Toggle all the switches on the TC2 via the Broadlink app including ā€˜All Onā€™ and ā€˜All Offā€™
  6. In the e-Contol app click the hamburger menu/share/share to other phones in WLAN
    
  7. In RM plugin go to General Settings/Force import data from e-Control
    
  8. In RM plugin, select the link for Codes List or navigate to: http://[android_ip]:9876/codes on your PC
  9. Select the code you want and copy and paste into this page: http://tomeko.net/online_tools/hex_to_base64.php. Save then result to a text file for reference
  10. In your Hass.io switches.yaml place in each TC2 switch config:
switches:
    garage_light_2:
      friendly_name: Garage Light 2
      command_off: base64code
      command_on:  base64code
    garage_light_main:
      friendly_name: Garage Light Main
      command_off:  base64code
      command_on:  base64code

Sorry to bring up my old topic but Iā€™ve been struggling all day with some new TC2 switches, I have tried the Developer Service Call method and the Broadlink Manager method. Both go into learning mode but I just canā€™t figure out how to send the commands for learning from my TC2 wall switch.

The RM Plugin has a HTTP Bridge. You can enable it and go to the http address and see the list there. Much much easier. I would edit your post with this info. No need to go with OCR, screenshots or manually copying the info.
You can learn, send, see the learned commands, etc via the HTTP server.

1 Like

Thanks - edited

@mdmc95 - Hi, thank you for your guide. However, I do not understand what Broadlink app to use. I have at this moment only IHC for EU installed and in it I have all the RF Wall switches (TC2 and TC1). I tried to install e-Control but besides being deprecated, I cannot login to re-setup the devices - I think they killed the app.
Also, by doing what you stated from the IHC app - the RM Plugin (I have the full version bought) does not pick up any code. Nor IR or RF.
I need to find a way to extract the RF codes for the TC2 /1 switches that I have :frowning: . Can you please help me?