Closed TheChatty closed 1 year ago
From the RAW pulse data we get for the BeSmart_Sx: 20 bit, PWM short: 230 long: 510 reset: 800, e.g.
https://triq.org/pdv/#AAB10300E801FC1008819081908181909081908181908181908181818255
or BeSmart_Sx.ook
:
242 502
511 245
216 532
498 244
242 503
242 498
513 245
507 219
232 525
513 245
210 526
244 506
512 239
218 525
218 528
515 247
215 508
236 516
235 498
243 4107
For the AC114-xxB we get: 88 bit, PWM short: 200 long: 500 reset: 800, e.g.
or AC114-xxB.ook
:
5166 601
599 197
191 594
598 197
195 592
199 595
197 593
597 197
590 196
194 598
595 198
194 593
198 596
199 595
594 196
592 196
594 198
592 197
195 597
198 594
574 219
193 597
595 198
592 198
194 593
600 196
192 594
199 593
597 198
195 593
595 197
590 198
195 594
200 598
196 594
198 594
196 594
198 595
197 592
198 591
597 197
196 596
200 595
197 589
199 594
198 596
198 594
200 586
198 593
200 595
199 596
593 197
192 591
199 597
199 594
594 196
590 198
594 197
195 597
197 598
593 197
196 590
598 196
590 198
593 200
592 244
5177 597
Not sure what the data fields are though? Any info on that?
Top two links from first post describe the SignalDuino RF protocol. I am able to send the follwing commands:
canvas up --> set sduino sendMsg u56#0xA347969601000B7F8#R3
canvas stop --> set sduino sendMsg u56#0xA3479696010023978#R3
canvas down --> set sduino sendMsg u56#0xA3479696010043B78#R3
fan light --> set sduino sendMsg P78#0x53490#R4
fan 5min --> set sduino sendMsg P78#0x53481#R4
fan higher --> set sduino sendMsg P78#0x53488#R4
fan lower --> set sduino sendMsg P78#0x53484#R4
@zuckschwerdt What can I help you with? Do you need multiple samples from the same key presses or samples from each key? Is the code from SignalDuino any help to you?
You can try a flex decoder to make sure we got things right:
rtl_433 -R 0 -X 'n=name,m=OOK_PWM,s=200,l=500,r=800,bits>=20'
This should output codes for both senders.
If that works out we need to identify more fields, there should at least be an ID field. Can you change a "house code" on these? Or do IDs reset on battery change? What changes in the output if you do?
Oh, and a sample of each would be great. Just upload here as zip. https://triq.org/rtl_433/ANALYZE.html
@zuckschwerdt: The general purpose decoder outputs codes for both senders and each button.
Each button was pressed 4 times (and saved to independent files). I used your -X settings. I have no info about the bits and I don't know how reset and pair them to cause new key bits.
@zuckschwerdt Can I help more?
There is just the long sync to handle, use it like this:
rtl_433 -R 0 -X 'n=name,m=OOK_PWM,s=200,l=500,y=5250,r=800,bits>=20'
And you can read all codes.
You get:
{65}5cb86969feffbc480
{65}5cb86969feffdb670
{65}5cb86969feffdc680
{65}5cb86969feffdc680
{65}5cb86969fefff4800
{65}5cb86969feffdb670
{20}acb77
{20}acb7b
{20}acb7e
{20}acb6f
That's all there is. Write a .conf file (see https://github.com/merbanan/rtl_433/tree/master/conf) or use just on the command line.
Use ,match=
to select actions, and use ,countonly
for a shorter output. E.g.
rtl_433 -R 0 -X 'n=AC114-down-press,m=OOK_PWM,s=200,l=500,y=5250,r=800,bits>=20,match={65}5cb86969feffbc480,countonly'
Is it possible to adjust sync length in source code thus non-flex decoders will pick up the signal? I want to use OMG using rtl_433_ESP and an ESP has not got enough resources for flex decoders.
These are very simple signals. You can just write a decoder for them. If you are lazy and want something fast just change one of the existing decoders (e.g. generic_motion.c).
We can't merge these simple "doorbell"-style decoders, but you can write/change your own one for ESP.
# rtl_433 -R 0 -X 'n=AC114,m=OOK_PWM,s=200,l=500,y=5250,r=800,bits>=20'
time : 2023-03-26 13:37:30
model : AC114 count : 3 num_rows : 3 rows :
len : 65 data : 5cb86969feffdc680,
len : 65 data : 5cb86969feffdc680,
len : 65 data : 5cb86969feffdc680
codes : {65}5cb86969feffdc680, {65}5cb86969feffdc680, {65}5cb86969feffdc680
With adjusted [generic_motion.c]:
# tail -n 11 generic_motion.c
r_device const generic_motion = {
.name = "AC114-01B",
.modulation = OOK_PULSE_PWM,
.short_width = 200,
.long_width = 500,
.sync_width = 5250,
.gap_limit = 1200,
.reset_limit = 800,
.decode_fn = &generic_motion_callback,
.fields = output_fields,
};
# rtl_433 -R 87
Registered 1 out of 243 device decoding protocols [ 87 ]
... no output when button pushed ...
You do need to change the check also: https://github.com/merbanan/rtl_433/blob/3264d01d65f386529619eecadf1471c4cf42ee5a/src/devices/generic_motion.c#L42-L47
I modified line 43 to check for either 20 (BeSmart) or 65 (AC114) bits.
On my mac with RTL2832U it works.
Ony my ESP with CC1101:
How to output all bits of bitbuffer? Like code = ...
?
Change char code_str[6];
into char code_str[20];
then change sprintf
to
sprintf(code_str, "%02x%02x%02x%02x%02x%02x%02x%02x", b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]);
Thank you very much for your strong support. It now works very well with RTL2832U. I need to tackle CC1101 further...
One more question: Is there a simple way to convert above codes to esphome raw codes?
Dumping received AC114 stop signal looks in esphome raw format similar to this:
code: [-599, 596, -199, 196, -571, 618, -174, 219, -594, 197, -595, 198, -596, 596, -173, 615, -199, 195, -595, 596, -198, 195, -571, 222, -593, 198, -594, 596, -197, 593, -173, 616, -199, 594, -199, 197, -595, 198, -572, 618, -174, 219, -593,
596, -197, 592, -174, 219, -596, 596, -199, 196, -594, 198, -571, 619, -173, 219, -593, 595, -198, 592, -174, 218, -596, 198, -595, 198, -596, 198, -570, 222, -570, 222, -593, 198, -594, 197, -571, 618, -174, 219, -595, 197, -596, 198, -571, 222, -570,
222, -592, 197, -595, 197, -571, 221, -595, 198, -594, 197, -595, 596, -173, 218, -570, 222, -594, 197, -595, 595, -173, 615, -174, 618, -199, 196, -596, 197, -596, 597, -173, 218, -593, 595, -199, 593, -197, 593, -173, 616, -223]
This is close enough for matching further signals but it looks like it's not close enough if I send this via esphome. It's not picked up by the orginal receiver.
Since this is PWM coded a single 0-bit should be 600,-200
and the 1-bit 200,-600
. The +/- is pulse/gap format. Just out output each bit that way.
Also you can open https://triq.org/pdv/ then click the plus symbol and choose "Raw pulse data" and paste your example above to see the raw esphome pulses:
I was looking for the opposite. Like having a .cu8 sample and convert it to the above raw pulse format.
After converting (transform all bits to 600,-200 / 200,-600) use the resulting codes in pdv to compare if you got it right :)
I needed to get the bits then converted them with Excel formulas to pulses. For AC114 it is important to send the high preamble (but it was not shown in esphome raw dump... luckily rtl_433 and my SDR did).
For sake of documentation - here are the working codes in esphome raw format:
button:
- platform: template
name: AC114 stop
on_press:
- lambda: get_cc1101(transciver).beginTransmission();
- remote_transmitter.transmit_raw:
code: [-1,5200,-600,600,-200,200,-600,600,-200,200,-600,200,-600,200,-600,600,-200,600,-200,200,-600,600,-200,200,-600,200,-600,200,-600,600,-200,600,-200,600,-200,600,-200,200,-600,200,-600,600,-200,200,-600,600,-200,600,-200,200,-600,600,-200,200,-600,200,-600,600,-200,200,-600,600,-200,600,-200,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,600,-200,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,600,-200,200,-600,200,-600,200,-600,600,-200,600,-200,600,-200,200,-600,200,-600,600,-200,200,-600,600,-200,600,-200,600,-200,600,-200]
repeat:
times: 4
wait_time: 0ms
- lambda: get_cc1101(transciver).endTransmission();
- platform: template
name: AC114 up
on_press:
- lambda: get_cc1101(transciver).beginTransmission();
- remote_transmitter.transmit_raw:
code: [-1,5200,-600,600,-200,200,-600,600,-200,200,-600,200,-600,200,-600,600,-200,600,-200,200,-600,600,-200,200,-600,200,-600,200,-600,600,-200,600,-200,600,-200,600,-200,200,-600,200,-600,600,-200,200,-600,600,-200,600,-200,200,-600,600,-200,200,-600,200,-600,600,-200,200,-600,600,-200,600,-200,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,600,-200,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,600,-200,200,-600,600,-200,600,-200,200,-600,600,-200,600,-200,600,-200,600,-200,600,-200,600,-200,600,-200,600,-200]
repeat:
times: 4
wait_time: 0ms
- lambda: get_cc1101(transciver).endTransmission();
- platform: template
name: AC114 down
on_press:
- lambda: get_cc1101(transciver).beginTransmission();
- remote_transmitter.transmit_raw:
code: [-1,5200,-600,600,-200,200,-600,600,-200,200,-600,200,-600,200,-600,600,-200,600,-200,200,-600,600,-200,200,-600,200,-600,200,-600,600,-200,600,-200,600,-200,600,-200,200,-600,200,-600,600,-200,200,-600,600,-200,600,-200,200,-600,600,-200,200,-600,200,-600,600,-200,200,-600,600,-200,600,-200,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,600,-200,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,200,-600,600,-200,200,-600,200,-600,200,-600,200,-600,600,-200,600,-200,600,-200,200,-600,600,-200,600,-200,200,-600,600,-200,600,-200,600,-200,600,-200]
repeat:
times: 4
wait_time: 0ms
- lambda: get_cc1101(transciver).endTransmission();
- platform: template
name: BeSmart minus
on_press:
- lambda: get_cc1101(transciver).beginTransmission();
- remote_transmitter.transmit_raw:
code: [200,-500,500,-200,200,-500,500,-200,200,-500,200,-500,500,-200,500,-200,200,-500,500,-200,200,-500,200,-500,500,-200,200,-500,200,-500,200,-500,200,-500,500,-200,200,-500,200,-500]
repeat:
times: 5
wait_time: 4ms
- lambda: get_cc1101(transciver).endTransmission();
- platform: template
name: BeSmart plus
on_press:
- lambda: get_cc1101(transciver).beginTransmission();
- remote_transmitter.transmit_raw:
code: [200,-500,500,-200,200,-500,500,-200,200,-500,200,-500,500,-200,500,-200,200,-500,500,-200,200,-500,200,-500,500,-200,200,-500,200,-500,200,-500,500,-200,200,-500,200,-500,200,-500]
repeat:
times: 5
wait_time: 4ms
- lambda: get_cc1101(transciver).endTransmission();
- platform: template
name: BeSmart light
on_press:
- lambda: get_cc1101(transciver).beginTransmission();
- remote_transmitter.transmit_raw:
code: [200,-500,500,-200,200,-500,500,-200,200,-500,200,-500,500,-200,500,-200,200,-500,500,-200,200,-500,200,-500,500,-200,200,-500,200,-500,500,-200,200,-500,200,-500,200,-500,200,-500]
repeat:
times: 5
wait_time: 4ms
- lambda: get_cc1101(transciver).endTransmission();
- platform: template
name: BeSmart 5min
on_press:
- lambda: get_cc1101(transciver).beginTransmission();
- remote_transmitter.transmit_raw:
code: [200,-500,500,-200,200,-500,500,-200,200,-500,200,-500,500,-200,500,-200,200,-500,500,-200,200,-500,200,-500,500,-200,200,-500,200,-500,200,-500,200,-500,200,-500,200,-500,500,-200]
repeat:
times: 5
wait_time: 4ms
- lambda: get_cc1101(transciver).endTransmission();
@zuckschwerdt Thank you for your support and all the great tools you made.
SignalDuino already has support for AC114-xxB and BeSmart_Sx.
Using rtl_433_ESP both devices are reported as "unknown protocol".
Raw message from AC114-xxB:
Raw message from BeSmart_Sx: