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

DRU Heater support #29

Closed sweebee closed 9 years ago

sweebee commented 9 years ago

Hi,

I have a DRU Heater at home. It has a 433Mhz remote that homeduino can receive. I tried to make a protocol with rfcontroljs, but i can't get it to work. Is there someone who can help or create a protocol?

I receive codes like this:

RF receive 298 644 26356 0 0 0 0 0 01101110011010101001101010101010011012" debug: received: [ 298, 644, 26356 ] 01101110011010101001101010101010011012

and this is the remote (4 buttons). m_31967

Icesory commented 9 years ago

Post pls the output for all buttons

sweebee commented 9 years ago

Well, i receive different things every time, rolling code maybe?

set button does not send rf. The other buttons i have to hold to receive rf.

Up: 00:35:28.674 [pimatic-homeduino] debug: data: "RF receive 330 629 26379 0 0 0 0 0 01100110011010101001101010101010011012" 00:35:28.718 [pimatic-homeduino] debug: received: [ 330, 629, 26379 ] 01100110011010101001101010101010011012 00:35:28.808 [pimatic-homeduino] debug: data: "RF receive 311 647 26385 0 0 0 0 0 01100110011010101001101010101010011012" 00:35:28.852 [pimatic-homeduino] debug: received: [ 311, 647, 26385 ] 01100110011010101001101010101010011012 00:35:29.029 [pimatic-homeduino] debug: data: "RF receive 319 648 218 26412 0 0 0 0 01100110011010101001121010101010011013" 00:35:29.071 [pimatic-homeduino] debug: received: [ 218, 319, 648, 26412 ] 12211221122121212112202121212121122123

Down: 00:36:40.432 [pimatic-homeduino] debug: data: "RF receive 324 636 26337 0 0 0 0 0 01100110011010101001101010010101100112" 00:36:40.472 [pimatic-homeduino] debug: received: [ 324, 636, 26337 ] 01100110011010101001101010010101100112 00:36:40.565 [pimatic-homeduino] debug: data: "RF receive 315 643 26369 0 0 0 0 0 01100110011010101001101010010101100112" 00:36:40.606 [pimatic-homeduino] debug: received: [ 315, 643, 26369 ] 01100110011010101001101010010101100112 00:36:40.963 [pimatic-homeduino] debug: data: "RF receive 322 639 26367 0 0 0 0 0 01100110011010101001101010010101100112" 00:36:41.005 [pimatic-homeduino] debug: received: [ 322, 639, 26367 ] 01100110011010101001101010010101100112

Off: 00:37:22.303 [pimatic-homeduino] debug: data: "RF receive 325 637 26358 0 0 0 0 0 01100110011010101001101010101001101012" 00:37:22.343 [pimatic-homeduino] debug: received: [ 325, 637, 26358 ] 01100110011010101001101010101001101012 00:37:22.439 [pimatic-homeduino] debug: data: "RF receive 310 648 26359 0 0 0 0 0 01100110011010101001101010101001101012" 00:37:22.490 [pimatic-homeduino] debug: received: [ 310, 648, 26359 ] 01100110011010101001101010101001101012 00:37:22.570 [pimatic-homeduino] debug: data: "RF receive 303 659 26391 0 0 0 0 0 01100110011010101001101010101001101012" 00:37:22.613 [pimatic-homeduino] debug: received: [ 303, 659, 26391 ] 01100110011010101001101010101001101012

koffienl commented 9 years ago

Do you have a temperatur on your display? If so, chance is that it is not sending up or down command but actual temperature.

sweebee commented 9 years ago

Yes there is. The up and down buttons steer the gas valve. So maybe a different code for every step? But the temperature shows the actual room temperature. it doesn't change when pushing a button.

I tried to put the valve down to the max, but then the rf code still changes.

Icesory commented 9 years ago

I don't see a rolling code. Homeduino is more sensitive as it needed. Pimatic filters the wrong timings.

sweebee commented 9 years ago

I see, so the code is always the same but the timings are wrong? Is there a way to add this to homeduino? This DRU remote?

Icesory commented 9 years ago

I think I can do this at the weekend. Can you change some addresses on the devices? It would make it easier

sweebee commented 9 years ago

This are all the addresses, i tried to assign new codes, but its always the same. But a friend has the same remote, so reading out that remote wil work too, to make it easier?

Here are my addresses:

On (Off and Up together) 08:26:27.294 [pimatic-homeduino] debug: data: "RF receive 320 639 26354 0 0 0 0 0 01100110011010101001101010101001011012" 08:26:27.330 [pimatic-homeduino] debug: received: [ 320, 639, 26354 ] 01100110011010101001101010101001011012

Off 07:47:11.475 [pimatic-homeduino] debug: data: "RF receive 319 643 26327 0 0 0 0 0 01100110011010101001101010101001101012" 07:47:11.516 [pimatic-homeduino] debug: received: [ 319, 643, 26327 ] 01100110011010101001101010101001101012

Up 07:48:26.426 [pimatic-homeduino] debug: data: "RF receive 323 639 26356 0 0 0 0 0 01100110011010101001101010101010011012" 07:48:26.465 [pimatic-homeduino] debug: received: [ 323, 639, 26356 ] 01100110011010101001101010101010011012

Down 07:49:04.332 [pimatic-homeduino] debug: data: "RF receive 325 637 26323 0 0 0 0 0 01100110011010101001101010010101100112" 07:49:04.373 [pimatic-homeduino] debug: received: [ 325, 637, 26323 ] 01100110011010101001101010010101100112

sweebee commented 9 years ago

Additional info i followed:

A code is selected automatically for all Mertik Maxitrol electronics from among 65,000 random codes available. The receiver has to learn the code of the handset: • Press and hold the receiver’s resetbutton until you hear two (2) acoustic signals. After the sec- ond, longer acoustic signal, release the reset button.

• Within the subsequent 20 seconds press the (small flame) button on the remote handset until you hear an additional long signal confirming the code is set.

NOTE: This is a one time setting only, and is not required when changing the batteries in the remote or receiver.

Icesory commented 9 years ago

Yes pls post the codes from the other remote. Only with a different I can see the right adress coding

sweebee commented 9 years ago

Unfortunately the remote was different, and not 433Mhz. I will try to find a different one.

sweebee commented 9 years ago

Okay, i got the same remote from a neighbor, this are the codes from that one:

On 16:47:06.326 [pimatic-homeduino] debug: data: "RF receive 305 615 23020 0 0 0 0 0 01101001011010100110011001101001011012" 16:47:06.363 [pimatic-homeduino] debug: received: [ 305, 615, 23020 ] 01101001011010100110011001101001011012

Off 16:47:34.123 [pimatic-homeduino] debug: data: "RF receive 292 619 22983 0 0 0 0 0 01101001011010100110011001101001101012" 16:47:34.173 [pimatic-homeduino] debug: received: [ 292, 619, 22983 ] 01101001011010100110011001101001101012

Up 16:47:44.835 [pimatic-homeduino] debug: data: "RF receive 303 611 22968 0 0 0 0 0 01101001011010100110011001101010011012" 16:47:44.873 [pimatic-homeduino] debug: received: [ 303, 611, 22968 ] 01101001011010100110011001101010011012

Down 16:47:58.180 [pimatic-homeduino] debug: data: "RF receive 284 627 23076 0 0 0 0 0 01101001011010100110011001101010100112" 16:47:58.219 [pimatic-homeduino] debug: received: [ 284, 627, 23076 ] 01101001011010100110011001101010100112

Icesory commented 9 years ago

The informatios are a little bit less. So i can make a switch protocol that should work. But when later some other guy need this protocol too and we got more informations the protocol and the configuration can be changed. In fact to this after a update of the homeduino plugin it is possible, that your config is broken.

Icesory commented 9 years ago

I have start the first version for the DRU protocol. You can download it from my git repository or you wait until @sweetpi has merged it into the official release. https://github.com/Icesory/rfcontroljs/commit/64566ea19253f00a1adbac5f46392952e71641a3#diff-1

As device you should use the HomeduinoRFButton Device. https://github.com/pimatic/pimatic-homeduino#buttons-device-example

sweebee commented 9 years ago

Thank you! I tried it but it didn't work?

Up received: 18:02:57.487 [pimatic-homeduino] debug: data: "RF receive 327 635 26351 0 0 0 0 0 01100110011010101001101010101010011012" 18:02:57.527 [pimatic-homeduino] debug: received: [ 327, 635, 26351 ] 01100110011010101001101010101010011012 18:02:57.565 [pimatic-homeduino] debug: switch9: { id: 168, unit: 64, state: true }

in config:

{ "id": "up", "text": "+", "protocols": [{ "name": "switch9", "options": { "unit": 64, "id": 168, "state": true } }] }

but when i press it, nothing happens.

Icesory commented 9 years ago

can you post your complete buttons device? And use pls markdown. https://help.github.com/articles/github-flavored-markdown/#fenced-code-blocks

```json 
{
    "your": "config"
}
+```  with out the +

looks like this

{
    "your": "config"
}
sweebee commented 9 years ago
{
      "id": "kachel-keuken",
      "name": "Kachel keuken",
      "class": "HomeduinoRFButtonsDevice",
      "buttons": [
          {
          "id": "uit",
          "text": "Uit",
          "protocols": [
            {
              "name": "switch9",
              "options": {
                "unit": 65,
                "id": 168,
                "state": false
              }
            }
          ]
        },
        {
          "id": "aan",
          "text": "Aan",
          "protocols": [
            {
              "name": "switch9",
              "options": {
                "unit": 65,
                "id": 168,
                "state": true
              }
            }
          ]
        },
        {
          "id": "up",
          "text": "▲",
          "protocols": [
            {
              "name": "switch9",
              "options": {
                "id": 168,
                "unit": 64,
                "state": true
              }
            }
          ]
        },
        {
          "id": "down",
          "text": "▼",
          "protocols": [
            {
              "name": "switch9",
              "options": {
                "unit": 71,
                "id": 168,
                "state": false
              }
            }
          ]
        }
      ]
    },
Icesory commented 9 years ago

The config looks right. How do installed the new protocol? And get you a rf message in pimatic, when you press a button

sweebee commented 9 years ago

I get 'Done' in pimatic when i push a button. And [pimatic-homeduino] debug: data: "ACK" in the log file.

I downloaded al your files from your frcontroljs and uploaded it to:

pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/rfcontroljs/

schermafbeelding 2015-01-17 om 18 58 55

Icesory commented 9 years ago

Have you the possibility to check the rf message with a second arduino?

sweebee commented 9 years ago

unfortunately not.

Icesory commented 9 years ago

you can make a fast test. go into the folder pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/rfcontroljs/lib and open the file switch9.js go to this line pulseLengths: [300, 600, 23000] and replace it with this pulseLengths: [320, 640, 26330]

sweebee commented 9 years ago

Replaced it, but still not working.

Icesory commented 9 years ago

So late online xD. Pimatic-homeduino works so far? Do you use it with other RF stuff? (I try to locate the failure)

sweebee commented 9 years ago

Yea, just back from night work. I use it with 4 Kaku switches, 3 kaku dimmers, 1 kaku pir and one doorbel. all working great.

Icesory commented 9 years ago

Nice. Can you flash the the raw example from RFControl on the arduino. You must set the receiver pin in the code an upload it to the arduino. After this open a terminal program and look on the serial port for communication (pair:8N1 baud:11520). When you press now a button you get a lot of numbers this I need. Best for all buttons. On, off, up, down

sweebee commented 9 years ago

Im not using an arduino, I'm using an Attiny45.

Icesory commented 9 years ago

The Attiny is an active filter? It is highly recommended to use a Arduino. It reduces the cpu load by 40%

sweebee commented 9 years ago

yes as an active filter, my cpu load is about 5%

Icesory commented 9 years ago

Ah I don't own a active filter. But it gives the possibility to get the raw code. @sweetpi how can he do it?

sweebee commented 9 years ago

Looks like i have to make a Raspberry Pi with transmitter/receiver for a friend this week, so when I have finished that, i could read the rf code that pimatic is sending for the heater.

sweetpi commented 9 years ago

You could modify the virtualhomeduino code to print the raw timings: https://github.com/pimatic/virtualhomeduino/blob/master/vhduino.cpp#L82-L89

This is the c program that is used if you don't use a arduino. It's like the serial connection but it just reads from the stdinput. Ofcause it only works on the raspberry pi.

sweebee commented 9 years ago

i got this from plight-raw (raw data), don't know if you can use it.

Up: http://pastebin.com/pXrqqV3S Down: http://pastebin.com/Sn7JkciZ Off: http://pastebin.com/NxTGyRZv On: http://pastebin.com/YJSUkbZm

sweebee commented 9 years ago

I have a arduino now and i receive this from the remote:

Up:

13:00:58.232 [pimatic-homeduino] debug: data: "RF receive 326 638 22472 0 0 0 0 0 0110100101100110011010101001101010101010011012"
13:00:58.233 [pimatic-homeduino] debug: received: [ 326, 638, 22472 ] 0110100101100110011010101001101010101010011012
13:00:58.365 [pimatic-homeduino] debug: data: "RF receive 305 659 22412 0 0 0 0 0 0110100101100110011010101001101010101010011012"
13:00:58.366 [pimatic-homeduino] debug: received: [ 305, 659, 22412 ] 0110100101100110011010101001101010101010011012

Down:


13:01:34.074 [pimatic-homeduino] debug: data: "RF receive 324 639 22460 0 0 0 0 0 0110100101100110011010101001101010010101100112"
13:01:34.074 [pimatic-homeduino] debug: received: [ 324, 639, 22460 ] 0110100101100110011010101001101010010101100112
13:01:34.207 [pimatic-homeduino] debug: data: "RF receive 331 645 250 22424 0 0 0 0 0112120101120110011010101001101010010101100113"
13:01:34.207 [pimatic-homeduino] debug: received: [ 250, 331, 645, 22424 ] 1220201212201221122121212112212121121212211223

Off:

13:02:06.940 [pimatic-homeduino] debug: data: "RF receive 326 638 22460 0 0 0 0 0 0110100101100110011010101001101010101001101012"
13:02:06.941 [pimatic-homeduino] debug: received: [ 326, 638, 22460 ] 0110100101100110011010101001101010101001101012
13:02:07.073 [pimatic-homeduino] debug: data: "RF receive 308 657 22460 0 0 0 0 0 0110100101100110011010101001101010101001101012"
13:02:07.075 [pimatic-homeduino] debug: received: [ 308, 657, 22460 ] 0110100101100110011010101001101010101001101012

On:

13:02:23.214 [pimatic-homeduino] debug: data: "RF receive 323 641 22468 0 0 0 0 0 0110100101100110011010101001101010101001011012"
13:02:23.214 [pimatic-homeduino] debug: received: [ 323, 641, 22468 ] 0110100101100110011010101001101010101001011012
13:02:23.347 [pimatic-homeduino] debug: data: "RF receive 327 661 250 22436 0 0 0 0 0012120101100110011010101001101010101001011013"
13:02:23.347 [pimatic-homeduino] debug: received: [ 250, 327, 661, 22436 ] 1120201212211221122121212112212121212112122123
Icesory commented 9 years ago

Now i lost a little bit the overview, Can you please describe exactly what you received with which system and from which remote?

sweebee commented 9 years ago

I received that codes directly from the remote with Pimatic and an arduino. I used the attiny before. I'm nog using the attiny anymore.

Icesory commented 9 years ago

The new ones are 8 unit longer then the old ones.

01100110011010101001101010101001011012 old
01101001 01100110011010101001101010101001011012 new

With pilight received codes are long as the old ones. Some thing is strange here

sweebee commented 9 years ago

This could be the issue because my attiny didn't work very well?

Icesory commented 9 years ago

Are you able to make a serial connection to the arduino?

When yes. Stop pimatic. Start a SerialMonitor Send this command

RF send 4 PIN 323 641 22468 0 0 0 0 0 0110100101100110011010101001101010101001011012

replace PIN with the pin number from your sender on the arduino.

sweebee commented 9 years ago

I opened the monitor. and received READY, but i can't type??

Icesory commented 9 years ago

With a linux monitor i cant help you. for this you musst google. On windows you can use the arduino IDE or HTerm

sweebee commented 9 years ago

I tried this: echo -e "RF send 4 PIN 323 641 22468 0 0 0 0 0 0110100101100110011010101001101010101001011012" > /dev/ttyUSB0

and serial sends ACK but heater does nothing

Icesory commented 9 years ago

PIN! You must change this.

sweebee commented 9 years ago

echo -e "RF send 4 4 323 641 22468 0 0 0 0 0 0110100101100110011010101001101010101001011012" > /dev/ttyUSB0

output: ACK

but no response from heater.

But don't know if baudrate is right etc. Tried with arduino software i get ready but when i send a command nothing happens.

Icesory commented 9 years ago

Try this, it is the on command

RF send 4 4 323 641 22468 0 0 0 0 0 01100110011010101001101010101001011012
sweebee commented 9 years ago

Nothing happens. when I try a code from a light (kaku switch) it works with the light. but the code from the heater does nothing to the heater.

Its just strange, every other receiver works when sending RF send but not the heater. Could this be a different problem? with filtering?

Icesory commented 9 years ago

Can you please capture the raw timings with pilight new? and please make the files bigger. I need more data to verify the code.

sweebee commented 9 years ago

Pilight-raw you mean? Is that possible with homeduino?

Icesory commented 9 years ago

the data from pilight-raw is very good. i can use it.

sweebee commented 9 years ago

I have installed pilight but how do i get pilight-raw communicate with homeduino?