mlfunston / node-red-contrib-broadlink-control

Set of node-red nodes to manage the Broadlink home automation device suite
MIT License
44 stars 24 forks source link

TC2 dont work #2

Closed ententeak closed 5 years ago

ententeak commented 5 years ago

"Remote" Broadlink RM Pro (RM2 - "old" black version) platform OpenHabian Pine64 with NodeRed plugin

Almost everything works (IR blaster, RF remote for STBox) But i cant get working original Broadlink TC2 light switches..

When set "Inject" >> "RM node" >> "Debug"

I get in debug window

{"remote":"10","button":"55","status":"OK","code":[-23,0,70,0,-33,9,9,22,9,22,22,9,22,9,9,22,9,22,22,9,22,9,9,22,22,9,9,22,22,9,22,9,22,9,9,22,9,22,22,9,9,22,9,22,22,9,9,22,9,22,9,22,22,9,22,9,22,9,22,9,22,9,9,22,9,22,9,22,22,9,9,0,1,72],"_code":[-23,0,70,0,-33,9,9,22,9,22,22,9,22,9,9,22,9,22,22,9,22,9,9,22,22,9,9,22,22,9,22,9,22,9,9,22,9,22,22,9,9,22,9,22,22,9,9,22,9,22,9,22,22,9,22,9,22,9,22,9,22,9,9,22,9,22,9,22,22,9,9,0,1,72],"f":1}

this is basicaly the same as any other working output. Only with this difference this dont send signal to RM2 - didn't light the LED signal like the official (android) app do..

Learning dont work either..

mlfunston commented 5 years ago

TC2 devices are not defined in the node at present. I don't have one to test either, but if you get the type ID by discovering it, we might be able to set it up as a defined device.

I'll upload a new version soon so that you can get the type ID.

ententeak commented 5 years ago

I'm not sure how do you mean "to discover", but when i run HTTP bridge in "RM Plugin" for Tasker on my phone, i get this codes, if this help you... ("Jednotlačítkový vypínač" = "single button switch" in czech)

First TC2 (Living Room): {"code":"e9144600df090916091616091609091609161609160909161609091616091609160909160916160909160916160909160916091616091609160916091609091609160916160909000148","codeLength":148,"sendUrl":"http://192.168.1.67:9876/send?deviceMac\u003db4430dc30b72\u0026codeId\u003d55","displayName":"Living Room • Button 1 On","index":0,"type":0,"remoteType":14,"delay":0,"repeat":0,"name":"Jednotlačítkový vypínač","learnedByMac":"b4430dc30b72","id":"55","remoteName":"Living Room","order":0},{"code":"e9144600df090916091616091609091609161609160909161609091616090916091616090916091609160916160909160916091609160916160916091609160909160916091609000148","codeLength":148,"sendUrl":"http://192.168.1.67:9876/send?deviceMac\u003db4430dc30b72\u0026codeId\u003d56","displayName":"Living Room • Button 1 Off","index":1,"type":0,"remoteType":14,"delay":0,"repeat":0,"name":"Jednotlačítkový vypínač","learnedByMac":"b4430dc30b72","id":"56","remoteName":"Living Room","order":0}

And second TC2 (bedroom): {"code":"e9144600df090916160909160916160909161609160916090916091616090916091616090916091616090916160916091609160916091609091616090916160909160916091609000148","codeLength":148,"sendUrl":"http://192.168.1.67:9876/send?deviceMac\u003db4430dc30b72\u0026codeId\u003d57","displayName":"Ložnice • Button 1 On","index":0,"type":0,"remoteType":14,"delay":0,"repeat":0,"name":"Jednotlačítkový vypínač","learnedByMac":"b4430dc30b72","id":"57","remoteName":"Ložnice","order":0},{"code":"e9144600df091609160916091609160916090916160916090916160909160916091609160916160909161609091616090916091616091609091609161609160909161609091609000148","codeLength":148,"sendUrl":"http://192.168.1.67:9876/send?deviceMac\u003db4430dc30b72\u0026codeId\u003d58","displayName":"Ložnice • Button 1 Off","index":1,"type":0,"remoteType":14,"delay":0,"repeat":0,"name":"Jednotlačítkový vypínač","learnedByMac":"b4430dc30b72","id":"58","remoteName":"Ložnice","order":0}

Edit: Discover node give me only this in debug node: array[2] 0: object mac: "b4430dc30b72" ip: "192.168.1.60" type: "RM2 Pro Plus" 1: object mac: "b4430dc5674b" ip: "192.168.1.61" type: "OEM branded SPMini"

ententeak commented 5 years ago

just little notice: TC2's don't work for me even under "original" VladimirSFilippov's nodes...

Edit: another test: Normaly i'm using node-red on Pine64 with OpenHABian, so i've decided to test it on my "main" Windows-powered PC. Thus i've installed node.js, node-red, this plugin and "SharedData" folder (BTW: on android its in "/sdcard/broadlink/newremote/SharedData/" accessible with any file explorer) After start, i've created basic flow "Inject timestamp">"RM">"debug" Set RM's MAC,IP, SharedData Test IR/RF codes, all working Test TC2 (433MHz RF).. no roesponse from RM2 Pro.. not evel LED blink... so, same resultas my Pine64 controller :(

mlfunston commented 5 years ago

Yes, I did some research on it. At the moment, the only way to control the TC2 is via the RF codes through an RM Pro device. Not the best, but it does work fine apparently.

mlfunston commented 5 years ago

PS - I put some notes in the Readme on this. You may need to send the code multiple times to make sure it is sent correctly when using RF signals from the RM Pro. So if sending once doesn't work, copy 2, 3, 4, 5, 6 times into the send packet and try that.

mreyad commented 5 years ago

I have similar setup with same problem with TC2. I am using OpenHab2 with node-red for home automation. The broadlink RM pro controlling the RF and IR devices using the "node-red-contrib-broadlink".

For light switches, I have TC2 and generic RF light switches. I agree with @mlfunston that sometimes you need to repeat the RF code to switch ON or OFF the light, but this way didn't work with TC2.

Before I've been using python script and execute the python command line every time I want to control the switch, it is working and still working with all types of switches (normal and TC2), but I decided to change the way of controlling to node-red, because the response time was faster.

the script name is: BlackBeanControl

I experience the same as @ententeak mentioned, that the RM Pro is not blinking while sending the command to TC2.

Just a quick comparison between the RF code to generic RF light switch and TC2: Generic switch: [120,"2",52,0,13,36,13,36,37,12,13,0,1,111,37,12,13,36,13,36,13,36,37,12,13,36,37,12,13,36,37,12,37,12,37,12,13,36,13,36,37,12,37,12,13,36,13,36,13,36,13,36,13,36,13,36,0,0,0,0]

Generic switch - HEX code: 782f34000d240d24250c0d00016f250c0d240d240d24250c0d24250c0d24250c250c250c0d240d24250c250c0d240d240d240d240d240d2400000000

TC2: [-23,"2",70,0,-33,9,9,22,22,9,22,9,9,22,22,9,9,22,22,9,9,22,22,9,22,9,9,22,9,22,9,22,22,9,9,22,22,9,22,9,9,22,9,22,9,22,9,22,22,9,9,22,22,9,9,22,22,9,9,22,22,9,22,9,9,22,9,22,22,9,9,0,1,72]

TC2 - Hex code: e9144600df090916160916090916160909161609091616091609091609160916160909161609160909160916091609161609091616090916160909161609160909160916160909000148

I could see that the differences are the negative numbers in TC2 code, I think this might be the issue.

davecyf commented 3 years ago

Looking for the same to work, -23 is the decimal signed 2's complement of E9, so the two lines of code is identical but in different coding type, Since your post is two year back, any update?