Portisch / RF-Bridge-EFM8BB1

Alternative Firmware for the Sonoff RF Bridge EFM8BB1 chip
293 stars 124 forks source link

Reading Klik Aan Klik Uit (KAKU) devices #209

Open SuperR1902 opened 3 years ago

SuperR1902 commented 3 years ago

Latest firmware used?

RF-Bridge-EFM8BB1-20190220.hex

Information

Klik aan klik uit, KAKU

Sniffed data

07:41:03.284 CMD: rfraw 177 07:41:03.293 MQT: stat/rf-bridge/RESULT = {"RfRaw":"ON"} 07:41:03.378 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:03","RfRaw":{"Data":"AAA055"}} 07:41:05.311 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:05","RfRaw":{"Data":"AA B1 04 0140 04B0 00C8 049C 3818281828 55"}} 07:41:05.338 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:05","RfRaw":{"Data":"AA B1 04 0136 00D2 0492 04C4 381828 55"}} 07:41:05.560 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:05","RfRaw":{"Data":"AA B1 05 0140 099C 04A6 00D2 2A9E 481828383828382828383828382838283828382838283828283828382838283828383828382828382838382828383828382828380828082828383828382808282838 55"}} 07:41:05.577 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:05","RfRaw":{"Data":"AA B1 04 014A 00C8 04B0 04A6 381828 55"}} 07:41:05.846 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:05","RfRaw":{"Data":"AA B1 05 0168 0974 0488 00AA 2A9E 481828383828382828383828382838283828382838283828283828382838283828383828382828382838382828383828382828383828382828383828382838282838 55"}} 07:41:05.858 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:05","RfRaw":{"Data":"AA B1 04 014A 00C8 04A6 049C 381828 55"}} 07:41:06.892 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:06","RfRaw":{"Data":"AA B1 04 0136 00DC 04BA 04BA 381828 55"}} 07:41:07.112 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:07","RfRaw":{"Data":"AA B1 05 014A 0992 04A6 00C8 2A94 481828383828382828383828382838283828382838283828283828382838283828383828382828382838382828383828382828383828382828383828382838282838 55"}} 07:41:07.134 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:07","RfRaw":{"Data":"AA B1 04 0140 00D2 04B0 04A6 381828 55"}} 07:41:07.355 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:07","RfRaw":{"Data":"AA B1 05 0168 097E 0488 00AA 2A9E 481828383828382828383828382838283828382838283828283828382838283828383828382828382838382828383828382828383828382828383828382838282838 55"}} 07:41:07.373 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:07","RfRaw":{"Data":"AA B1 04 0154 00C8 04A6 049C 381828 55"}} 07:41:11.449 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:11","RfRaw":{"Data":"AA B1 04 0140 00DC 04BA 04B0 381828 55"}} 07:41:11.669 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:11","RfRaw":{"Data":"AA B1 05 0140 09A6 04B0 00C8 2AA8 481828383828382828383828382838283828382838283828283828382838283828383828382828382838382828383828382828383828382828080828382838282808 55"}} 07:41:11.687 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:11","RfRaw":{"Data":"AA B1 04 0140 00C8 04B0 04B0 381828 55"}} 07:41:11.909 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:11","RfRaw":{"Data":"AA B1 05 015E 0974 0488 00A0 2AA8 481828383828382828383828382838283828382838283828283828382838283828383828382828382838382828383828382828383828382828383828382838282838 55"}} 07:41:11.927 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:41:11","RfRaw":{"Data":"AA B1 04 014A 00BE 04B0 049C 381828 55"}}

This is the output from RFRAW 166

07:46:59.043 CMD: rfraw 166 07:46:59.052 MQT: stat/rf-bridge/RESULT = {"RfRaw":"ON"} 07:46:59.154 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:46:59","RfRaw":{"Data":"AAA055"}} 07:47:01.762 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:47:01","RfRaw":{"Data":"AAA6050D6FE0CB6E55"}} 07:47:06.584 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:47:06","RfRaw":{"Data":"AAA6050D6FE0CB6E55"}}

How to identify the actual code from the rest?

In another app, the 'remote code' is identified as 02407CD201.

In other words, how to identify what line to convert in https://bbconv.hrbl.pl/ ?

SuperR1902 commented 3 years ago

1 hour of further thinkering later:

I found the

07:55:07.969 CMD: rfraw AAA8050D6FE0CB6E55 07:55:07.978 MQT: stat/rf-bridge/RESULT = {"RfRaw":"ON"} 07:55:08.593 MQT: tele/rf-bridge/RESULT = {"Time":"2021-11-05T07:55:08","RfRaw":{"Data":"AAA055"}}

Based on another topic: https://github.com/Portisch/RF-Bridge-EFM8BB1/issues/131 21:07:10 MQT: sonoff_F81779/tele/RESULT = {"RfRaw":{"Data":"AAA60507D781476655"}} Replace the begining with AAA8 and re-send it using "rfraw [data]". Your receiver should react as if you had activated your sensor/button manually. 21:09:27 CMD: rfraw AAA80507D781476655 21:09:27 MQT: sonoff_F81779/stat/RESULT = {"RfRaw":"ON"} 21:09:27 MQT: sonoff_F81779/tele/RESULT = {"RfRaw":{"Data":"AAA055"}}

This turned the switch ON!

The off command for my switch was almost the same, except for 1 number:

AAA8050D6FE0CB7E55 (switch off) AAA8050D6FE0CB6E55 (switch on)

How could I have known to change the AAA6 to AAA8 without stumbling unto that topic?

SuperR1902 commented 3 years ago

After installing MQTT on Home Assistant I could listen to the Tosmota and control the light via:

add to configuration.yaml switch:

Add the yourswitchname entity to the dashboard