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

Add FA20RF support #35

Closed Xento closed 9 years ago

Xento commented 9 years ago

Could you add support for FA20RF smoke detecors? It is already supported by fhemduino, there you could get the protocol from. I looked at your code but I don't really understand where to implement the different timings. Is there any documentation?

Icesory commented 9 years ago

Ca you post the protocol Dokumentation? Think next weekend I got time to make some work

Xento commented 9 years ago

Here is the file used by fhemduino. https://github.com/mdorenkamp/fhemduino/blob/master/lib/FA20RF.cpp

Xento commented 9 years ago

I think I understood how it works. I will try it by myself. But we need a special device definiton in pilight because it acts like a pir when receiving. It sends the alarm every 2-3 seconds when on and this stops when the alarm turns off. When you want to send alarm you have to send the alarmsignal every 2-3 seconds so that the smokedector stays on.

leader21 commented 9 years ago

what about protocol name "alarm1" ? i'm having this device too, so i could check if your protocol works for me also.

sweetpi commented 9 years ago

But we need a special device definiton in pilight because it acts like a pir when receiving.

ups pilight?

In pimatic we can either abuse a pir-sensor (there is an autoreset option) or we can create a new alarm device.

Xento commented 9 years ago

The best would be a new alarm device where you could set an interval for repeating the signal.

Xento commented 9 years ago

When I press the test button on one smokedetector I receive ths from homeduino: received: [ 744, 1464, 2807, 8092, 17292 ] 3002020101010102020201010101020101010102020202010204

Look at my fork for the changes I did. https://github.com/Xento/rfcontroljs/blob/master/lib/controller.js https://github.com/Xento/rfcontroljs/blob/master/lib/protocols/alarm1.js

In my eyes it should work now, but it doesn't.

Icesory commented 9 years ago

Why do you want to encode a message? Think this isn't necessary.

Icesory commented 9 years ago

And you killed a bit. ....010-204 You have 204 declared as a nothing but I think it is one bit more to decode. So only 04 is the header

Xento commented 9 years ago

The decoding is nessesary to detect which smokedetector sends the alarm. Yeah you were right, I missed a bit. Now receiving works but sending not. This is received when i press the testbutton: 3002020101010102020201010101020101010102020202010204 And this is send when sending via pimatic: 0020201010101020202010101010201010101020202020102003 The 3 at the beginning is missing and 03 at the end should only be 4.

Icesory commented 9 years ago

The decoding is necessary. But why do you want to send from pimatic? How should this work?

But it looks right.

Xento commented 9 years ago

You could use the smokedetecors as alarmsirens. For example if you are not at home and one windowsensor detects that a window was opened.

Icesory commented 9 years ago

That is a nice feature. I have look in to the fhemduino protocol and your implementation is right. Strange that you get a wrong encoded message.

Can you create the coffeescript source file? The normal language for pimatic is coffeescript.

Xento commented 9 years ago

Finaly I got it working: https://github.com/pimatic/rfcontroljs/pull/40 I can understand coffescript a bit, normaly I try to copy&paste things and use try&error to get the coffescript working. Could you create the coffescript?

Xento commented 9 years ago

I made a rule, to continuosly send an alarm: if SomeSwitch is turned on or [SomeSwitch is on and smokedetecor is turned off] then switch smokedetector on and after 4 seconds switch smokedetector off

Xento commented 9 years ago

@leader21 could you test the protocol, too?

Icesory commented 9 years ago

I will implent this to pimatic but i think the coffeescript ist not right. Why do you need a loop in the encoding part?

Xento commented 9 years ago

The rf signal must be repeated a few times until the smokedetecros responses. I thought a loop would be much nicer and more dynamic than repeating the pulse string. In fhemduino the repetion is configureable.

Icesory commented 9 years ago

Homeduino sends the RF message normally 7 times. I have merged your work into my reporsitory. can you take a look on this? I made some changes to fit it into the pimatic coding style

Xento commented 9 years ago

Without the loop I have to switch the device on and off for about 3 or 4 times until it goes on.

Xento commented 9 years ago

And your version sends the signal when turning off the switch.

Icesory commented 9 years ago

Homeduino sends the RF message normally 7 times. I have merged your work into my reporsitory. can you take a look on this? I made some changes to fit it into the pimatic coding style

Xento commented 9 years ago

Double post? I used your changes.

Icesory commented 9 years ago

Oh yes double post. Sorry I have found the failure while sending

Xento commented 9 years ago

Ok, this looks better, but the problem with the sending/receiving is still there. I have to turn the switch on and of multiple times until it works.

Icesory commented 9 years ago

And now?

Xento commented 9 years ago

Now it works

Icesory commented 9 years ago

Nice. And the other protocols?

Xento commented 9 years ago

Home Easy Advanced works, too. I can't test the belldoor, because it was a user request and I don't have one