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

New switch eHome and REV #21

Closed georg90 closed 9 years ago

georg90 commented 9 years ago

Hi, just installed everything and it's working great! Really like this solution and I want to replace my pilight installation with it.

I need a couple new protocols..for now one for REV devices (rev2 with pilight) and more important, one for eHome. In pilight we couldn't finish the development yet, see: http://forum.pilight.org/Thread-eHome-Switches

So I started adding support for the eHome switch: https://github.com/georg90/rfcontroljs/

Now I have a couple of questions:

  1. I have different pulseLenghts (see paste file) for on/off: Should I just add all (in the right order) ?
  2. Whats systemcode / id ? Do I put just some "dummy" values in there? Since I don't know them..
  3. Once the test passes, how do I proceed to implement this protocol ? (Especially regarding pulsesToBinaryMapping values etc. in the switch7.coffee/js)

Thanks! Hope I can get started once somebody cleared this out..so we'll have two more protocols :)

I also added the pulses: http://pastebin.com/eAL05f1F

For rev: http://pastebin.com/8J6Dtn4F

Icesory commented 9 years ago

To 1: I cant see different Pulseleghts for on|off on - 307, 944, 9712 off - 307, 944, 9748

A valid Pulse timing has a range from +-40% (307+-124 = 183 and 431)(9730+-3892=5838 and 13622)

To 2: You define in the protocol (the switch7.coffee file) how are the received bits are interpret. Look into the other protocol files. there you can see how to handle the bitmaping.

To 3: If your protocol ready and the test passes then you push it to your github account and make a pullrequest. Sweetpi can this merge then.

georg90 commented 9 years ago

So my test would look like this:

    { 
      protocol: 'switch7'
      pulseLengths: [183, 431, 5838, 13622],
      pulses: [
        '01010101010101100101010101010110011001100110011002'
        '10100101010101100101010101010110011001100110011002'
      ],  
      values: [
         { id: 24, unit: 29, state: true }
         { id: 24, unit: 29, state: false }
      ]
    },
Icesory commented 9 years ago

No. pimatic calculates the maximum and minimum puselenghts during the runtime. you set the default values [307, 944, 9712]

georg90 commented 9 years ago

Thanks!

01010 101010101100 101010101010 110011001100110011002  <-- 1
01010 101011001100 101010101010 110011001100110011002  <-- 2
01010 110010101100 101010101010 110011001100110011002  <-- 3
01010 110011001010 101010101010 110011001100110011002  <-- 4
 on           id            sys             footer?            

01010 101010101100 110011001100 110011001100110011002  <-- 1
01010 110011001010 110011001100 110011001100110011002  <-- 2
01010 110011001010 110011001100 110011001100110011002  <-- 3
01010 110011001010 110011001100 110011001100110011002  <-- 4
 on         id      sys           footer?

doesn't work :-/ https://github.com/georg90/rfcontroljs/commit/5aac9d7292163adba6639cd653a0400c343ed7b5 As the footer is just two digits with most of the switches..is the whole thing the footer? Still don't understand what id and unit in my test should look like..

Icesory commented 9 years ago

You are on an wrong way. the footer is only the '02' For me it is to complex to explain the protocol files in english. I am a German guy

georg90 commented 9 years ago

Okay, thank you :) That's the same spot I got stuck when trying to develop the protocol for pilight..

We can speak German if you don't mind. I'm from Germany, too ;-) (Can translate the important parts later?!)

georg90 commented 9 years ago

decoding works, encoding doesn't: https://github.com/georg90/rfcontroljs/commit/f9946fbd5b001d4d273e0bc3a8335ed3207a02eb

1) #encodeMessage() should create the correct pulses for switch7:
     AssertionError: "01010101010101010101101002" == "01010101010101100101010101010110011001100110011002"
Icesory commented 9 years ago

for receiving the "decodePulses:" function is called. for sending the "encodeMessage:" function is called. You musst work on this function too.

Icesory commented 9 years ago

https://github.com/Icesory/rfcontroljs/commit/71baabb05aef897d79fb6925cb75ac5f229b1450

georg90 commented 9 years ago

for receiving the "decodePulses:" function is called. for sending the "encodeMessage:" function is called. You musst work on this function too.

I did my testing, but since the decoding part was wrong anyway always ended up with an error..

great stuff! working as expected :-) Thank you :-)

Do you send a pull request to sweetpi?

georg90 commented 9 years ago

Okay, this has to stay open for REV support.

FYI: http://wiki.pilight.org/doku.php/rev_v1-2

I tried to decode and ended up with:

on

 0101 0101 0101 0101 
 0110 0110 0110 0110 
 0101 1010 0101 1010 02

 1 1 1 1 <-- housecode
 0 0 0 0 <-- fix
 1 0  <-- unit 1 <-- state inverse 0 <-- state 

 0101 0101 0101 0101
 0110 0110 0110 0110
 1010 0101 0101 1010 02
 1 1 1 1
 0 0 0 0
 0 1 1 0

 0101 0101 0101 0101
 0110 0110 0110 1010
 0101 0101 0101 1010 02

 1 1 1 1
 0 0 0 0
 1 1 1 0

off
 0101 0101 0101 0101
 0110 0110 0110 0110
 0101 1010 1010 0101 02

 1 1 1 1
 0 0 0 0
 1 0 0 1

 0101 0101 0101 0101
 0110 0110 0110 0110
 0101 1010 1010 0101 02

 1 1 1 1
 0 0 0 0
 1 0 0 1

what pulse lenght do I use? I used [178, 559, 5736] where 178 is the smallest I received and 5736 the highest..

Icesory commented 9 years ago

It is done. https://github.com/Icesory/rfcontroljs/commit/aa345a037369ba1e465b8c2c2ea560c61073f94d Have made a exact copy of the pilight rev2 protocol

georg90 commented 9 years ago

Nice man! Really like to know how you decode this, so if you have time to explain.. ;-) Will you send a pull request?

Icesory commented 9 years ago

I have read the code from pilight and rewrite this for pimatic. A pull request is open since some days. https://github.com/pimatic/rfcontroljs/pull/25