pimatic / rfcontroljs

nodejs modul with protocol support for different 433mhz switches and weather stations for the RFControl Arduino library.
GNU General Public License v3.0
49 stars 54 forks source link

Added protocol doorbell3 for WP515S doorbell. #85

Closed primatic closed 8 years ago

primatic commented 8 years ago

WP515S doorbell (smart-home.com.hk/docs/product_pdf/WP515S.pdf) protocoll added as doorbell3. doorbell has 16 position switch aka house code (" to avoid interference"), and a 8 position unit code. pos=>id 01=>0 0000 02=>C 1100 03=>4 0100 04=>F 1111 05=>7 0111 06=>B 1011 07=>3 0011 08=>A 1010 09=>2 0010 10=>E 1110 11=>6 0110 12=>D 1101 13=>5 0101 14=>9 1001 15=>1 0001 16=>8 1000

sweetpi commented 8 years ago

There is something wrong with either your protocol parsing or the test case, the test does fail:

Your example is:

01010101001010101100110002

grouped:

01 01 01 01 00 10 10 10 11 00 11 00 02

However there is no mapping for 00 and 11.

  pulsesToBinaryMapping = {
    '01': '0'
    '10': '1'
    '02': ''
  }
primatic commented 8 years ago

I'll update it asap. I think (from the recorded sequence) it should be 0 10 10 10 10 01 01 01 01 10 01 10 01 2 (as can be inferred from the encodeMessage sequence as well) I also found out that the last part of the sequence (10 01 10 01 2) is actually defining the 'melody' of the doorbell, which comes with 3 melody settings: (10 01 10 01 2), (01 10 01 01 2) and (10 01 01 01 2).

one thing that I did not know how to enforce is that the sequence is repeated 100 times when pressing the original doorbell, and only 6 times when transmitting using pimatic. Can you give a hint how to 'fix' this?

sweetpi commented 8 years ago

Is repeating 100x really necessary? This really would flood the 433mhz channel and would lead to a lot rf conflicts.

primatic commented 8 years ago

Well, I just recorded the message using audio recording from 433 receiver, and the push button of the doorbell actually transmits the sequence about 100 times. It works with 6 times as well, so no need for a change. Since my setup is not complete (433 transmitter hooked-up to raspi, receiver to pc), and I have trouble running the tests locally on raspi (Error: Cannot find module './lib/coffee-script/register'), I hope my updated test scenario passes the test now.