question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

This might be a very stupid question (or a suggestion to improve the docs). I can’t seem to understand how to add a TC2 switch as an accessory. I’ve got the homebridge server running and added the “platform” accessory to the Home app on my iPhone. This is my config.json:

{
  "bridge":{
    "name":"Homebridge",
    "username":"CD:22:3D:E3:CE:30",
    "port":51826,
    "pin":"031-45-156"
  },
  "description":"Homebridge",
  "accessories":[

  ],
  "platforms":[
    {
      "platform":"BroadlinkRM",
      "name":"Broadlink RM",
      "accessories":[
        {
          "name":"My Switch",
          "type":"switch",
          "disableAutomaticOff": false,
          "onDuration": 5,
          "data":{
            "on":"2600500000012...",
            "off":"2600500000012..."
          }
        }
      ]
    }
  ]
}

Besides the predefined “Learn” and “Scan-Frequency” accessories, the configuration also added the “My Switch” switch.

Now my question is how do I find the on/off HEX codes in the data section? I tried both the “Learn” and “Scan Freq” options, but nothing happened in the log, and I tried playing with the RM Pro 2 and TC2 switch (turn on/off by touch, with Broadlink iPhone app, entering learn mode for the switch (long press), and basically anything I could think of.

Your guidance would be appreciated!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
sendormcommented, Jun 10, 2017

Hello you can get the codes through Broadlink RM Plugin Lite in your android phone. Android emulators also work. The one emulator I found that works with e-control app is bignox. Just use your e-control app and then use the Broadlink RM Plugin Lite to get the codes. There is a tutorial here. If you are using ios for e-control, just make a backup and download that backup from you android emulator’s e-control app. Also don’t forget to paste the code you get from the plugin twice in order for the code to work.

0reactions
7mllm7commented, Aug 21, 2019

So… back in 2018 I asked this question, and then found a solution - however, I did not update my solution here. Now in 2019 I encountered the same issue, and from Google reached this same thread, and was mad at myself for not posting anything…

KARMA!

The problem was basically finding my Broadlink’s “remotes” (TC2) RF frequency, so I can add them to my config.json file.

So here is how I solved it (using my iPhone and Mac):

  1. Add remotes (again, in my case TC2) to Broadlink e-Control app (I did it from iOS, install it if needed)
  2. Plug iPhone to computer and create iTunes backup
  3. Copy iTunes backup from its location to some readable place on your harddrive (otherwise next step will fail due to permissions)
  4. Download and install iExplorer, and use it to explore the created backup
  5. Locate and export the cn.com.broadlink.e-Control folder to somewhere on your harddrive
  6. Open BroadLinkDeviceList.sqlite in some online SQLite browser
  7. Get relevant subirID by SELECT * FROM 'broadlink_subir'; based on the name of the remote in the app
  8. Get buttons by SELECT * FROM 'broadlink_button';, where the subirID is what you identified in previous step
  9. Get hex codes by SELECT buttonid, lower(hex(code)) FROM 'broadlink_code'; - these are the hex codes of all of the buttons, and you’ll need the ones you’re trying to add
  10. In my setup, SSH to your Raspberry Pi (ssh pi@192.168...)
  11. cd /var/homebridge
  12. Backup config.json cp config.json config.old.json - remember that if you do it more than once then you’ll overwrite the previous backup each time
  13. Copy hex code from SQLite and paste it TWICE inside config.json (my preference is vi /var/homebridge/config.json) - add remote entry in JSON if needed, as appear in the documentation. Twice means if your code is "ABCD", then the code that you’ll paste inside config.json will be "ABCDABCD" - yup!
  14. sudo systemctl restart homebridge to restart service

And that’s it - that’s how you get the RF frequency HEX

Read more comments on GitHub >

github_iconTop Results From Across the Web

Settings | Typical Colors 2 Wiki - Fandom
Settings are options to change how the game feels and plays out, and it can be found on top of the screen on...
Read more >
Installing TC2 Software Updates - NewTek Knowledge Base
In order to install TC2 software updates, follow the listed steps: Download the Update. 1) Exit the TC2 software to view the Windows...
Read more >
EFI-TC2 - Holley
Davis Technologies Holley EFI-TC2 www.moretraction.com. Holley® ECU Setup. The Holley® EFI must be configured to allow the. Traction Control signals to ...
Read more >
How to install and configure broadlink tc2 smart light switch RF
1. I have good technical electricity knowledge so, I unscrewed and removed the old light switch from my wall and replaced it with...
Read more >
TC1& TC2 Tension Cells Installation & Operation Manual
Complete installation by installing field wiring and leveling the vessel as described in the next section. 7. After leveling vessel, install safety wires...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found