TC2 setup
See original GitHub issueThis 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:
- Created 6 years ago
- Comments:12 (3 by maintainers)
Top GitHub Comments
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.
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):
subirID
bySELECT * FROM 'broadlink_subir';
based on the name of the remote in the appSELECT * FROM 'broadlink_button';
, where thesubirID
is what you identified in previous stepSELECT 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 addssh pi@192.168...
)cd /var/homebridge
cp config.json config.old.json
- remember that if you do it more than once then you’ll overwrite the previous backup each timevi /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!sudo systemctl restart homebridge
to restart serviceAnd that’s it - that’s how you get the RF frequency HEX