pimatic/rfcontroljs

Protocol request: Eurodomest 972080

incmve opened this issue · 26 comments

I got this RF device, very cheap to get at Action.

I got this data from it, is it enough to get this in a protocol?
First run all buttons.

1 ON
RF receive 284 888 346 9660 0 0 0 0 01010110010101011010100110011001010101011010101002
1 OFF
RF receive 295 886 9626 0 0 0 0 0  01010110010101011010100110011001010101011010100102
2 ON
RF receive 294 887 9620 0 0 0 0 0 01010110010101011010100110011001010101011010011002
2 OFF
RF receive 294 887 9636 0 0 0 0 0 01010110010101011010100110011001010101011010010102
3 ON
RF receive 245 915 319 9621 0 0 0 0 01010110010101011010100110011001010101011001101002
3 OFF
RF receive 287 891 360 9621 0 0 0 0 01010110010101011010100110011001010101011001100102
4 ON
RF receive 289 892 9652 0 0 0 0 0 01010110010101011010100110011001010101010110101002
4 OFF
RF receive 291 891 9617 0 0 0 0 0 01010110010101011010100110011001010101010110100102
All ON
RF receive 282 892 357 9632 0 0 0 0 01010110010101011010100110011001010101010101100102
All OFF
RF receive 282 894 416 9604 0 0 0 0 01010110010101011010100110011001010101010101011002

img 2014-10-14 13 10 42
img 2014-10-14 13 10 16
img 2014-10-14 13 10 30

The timings look like "switch2" or "switch3". Did you try them?

No I didn't try it yet, no idea what my unit and id is 🎅
How can I find that?

look at the debug output of pimatic-homeduino it should be in there when you press a button

With my kaku I see an id but not with this one

13:27:27.958 [pimatic-homeduino] debug: data: "RF receive 300 881 9581 0 0 0 0 0 01010110010101011010100110011001010101011001100102"
13:27:28.010 [pimatic-homeduino] debug: received: [ 300, 881, 9581 ] 01010110010101011010100110011001010101011001100102
13:27:28.073 [pimatic-homeduino] debug: data: "RF receive 264 918 9624 0 0 0 0 0 01010110010101011010100110011001010101011001100102"
13:27:28.148 [pimatic-homeduino] debug: received: [ 264, 918, 9624 ] 01010110010101011010100110011001010101011001100102
13:27:28.647 [pimatic-homeduino] debug: data: "RF receive 296 885 9603 0 0 0 0 0 01010110010101011010100110011001010101011001100102"
13:27:28.699 [pimatic-homeduino] debug: received: [ 296, 885, 9603 ] 01010110010101011010100110011001010101011001100102
13:27:28.765 [pimatic-homeduino] debug: data: "RF receive 271 903 365 9603 0 0 0 0 01010110210101011010102110011001010101011001100103"
13:27:28.845 [pimatic-homeduino] debug: received: [ 271, 365, 903, 9603 ] 02020220120202022020201220022002020202022002200203
13:27:29.182 [pimatic-homeduino] debug: data: "RF receive 292 889 9575 0 0 0 0 0 01010110010101011010100110011001010101011001100102"
13:27:29.235 [pimatic-homeduino] debug: received: [ 292, 889, 9575 ] 01010110010101011010100110011001010101011001100102
13:27:29.452 [pimatic-homeduino] debug: data: "RF receive 282 896 355 9519 0 0 0 0 01010110210101011010100110011001010101011001100123"
13:27:29.500 [pimatic-homeduino] debug: received: [ 282, 355, 896, 9519 ] 02020220120202022020200220022002020202022002200213

Ok it is not one of the implemented protocols and there is something wrong with the pulses from the first post.

Could you please record all buttons again (like in the first post), but this time with the outputs of homeduino (like your last post)?

I have the same device as incmve.

All buttons recorded and the output can be found here :
http://pastebin.com/yhq5JYc5

Per button i did a press and hold, that's why i uploaded it to pastebin ;-)

👍

pimatic-homeduino 0.8.20 with "switch5" protocol is ready for testing. I'm not sure about all buttons, so please test all buttons and report the results.

Offtopic : did you change anything on the KaKu protocol as well?

You can always look on the history: https://github.com/pimatic/rfcontroljs/commits/master/src/protocols/switch1.coffee

I did not changed the KaKu protocol, but I added some error correction for pulse timings, so all protocols should work better now.

Great job, thanks.

Buttons 1 till 4 work ;-) But :

When i press button 1 on the remote the wall outlet switches on directly, but the
debug log & Gui do not receive anything.

When i press & hold the same button for 2 or 3 seconds Debug&GUI does receive the signal, and Gui shows the correct state. (tested with all buttons 1 till 4 on & off)

The "All" buttons do not work, "All on" and "All off" do not turn the switches on or off in the GUI.

press & hold On and off :

19:55:37.612 [pimatic-homeduino] debug: data: "RF receive 884 300 9541 0 0 0 0 0 01101010010101101001101001010110101010101010011012"
19:55:37.655 [pimatic-homeduino] debug: received: [ 300, 884, 9541 ] 10010101101010010110010110101001010101010101100102
19:55:37.696 [pimatic-homeduino] debug: switch5: { id: 465695, unit: 0, all: true, state: false }
19:55:44.699 [pimatic-homeduino] debug: data: "RF receive 884 299 9581 0 0 0 0 0 01101010010101101001101001010110101010101010100112"
19:55:44.742 [pimatic-homeduino] debug: received: [ 299, 884, 9581 ] 10010101101010010110010110101001010101010101011002
19:55:44.784 [pimatic-homeduino] debug: switch5: { id: 465695, unit: 0, all: true, state: true }

@sweetpi forgot to mention i tested with a band filter ;-(

Tested again without the band filter, now 1 button press works like a charm.
The "All" buttons do not work, "All on" and "All off" do not turn the switches on or off in the GUI.

pimatic-homeduino 0.8.20 with "switch5" protocol is ready for testing. I'm not sure about all buttons, so please test all buttons and report the results.

I can confirm, my Pi receives the signals as switch5 now.
The only thing not working is the All on/off buttons

All on:

13:29:53.545 [pimatic-homeduino] received: [ 276, 310, 889, 9617 ] 02021220120212122020201220122012020202121202201203
13:29:53.586 [pimatic-homeduino] switch5:  { id: 979295, unit: 0, all: true, state: false }
13:29:53.658 [pimatic-homeduino] data: "RF receive 285 896 9620 0 0 0 0 0 01010110010101011010100110011001010101010101100102"
13:29:53.696 [pimatic-homeduino] received: [ 285, 896, 9620 ] 01010110010101011010100110011001010101010101100102
13:29:53.737 [pimatic-homeduino] switch5:  { id: 979295, unit: 0, all: true, state: false }
13:29:53.782 [pimatic-homeduino] data: "RF receive 287 894 9602 0 0 0 0 0 01010110010101011010100110011001010101010101100102"
13:29:53.821 [pimatic-homeduino] received: [ 287, 894, 9602 ] 01010110010101011010100110011001010101010101100102
13:29:53.864 [pimatic-homeduino] switch5:  { id: 979295, unit: 0, all: true, state: false }
13:29:53.909 [pimatic-homeduino] data: "RF receive 282 900 9574 0 0 0 0 0 01010110010101011010100110011001010101010101100102"
13:29:53.970 [pimatic-homeduino] received: [ 282, 900, 9574 ] 01010110010101011010100110011001010101010101100102
13:29:54.016 [pimatic-homeduino] switch5:  { id: 979295, unit: 0, all: true, state: false }
13:29:54.055 [pimatic-homeduino] data: "RF receive 293 889 9611 0 0 0 0 0 01010110010101011010100110011001010101010101100102"

All off

13:30:14.370 [pimatic-homeduino] received: [ 284, 899, 9544 ] 01010110010101011010100110011001010101010101011002
13:30:14.411 [pimatic-homeduino] switch5:  { id: 979295, unit: 0, all: true, state: true }
13:30:14.456 [pimatic-homeduino] data: "RF receive 288 894 9606 0 0 0 0 0 01010110010101011010100110011001010101010101011002"
13:30:14.521 [pimatic-homeduino] received: [ 288, 894, 9606 ] 01010110010101011010100110011001010101010101011002
13:30:14.565 [pimatic-homeduino] switch5:  { id: 979295, unit: 0, all: true, state: true }
13:30:14.605 [pimatic-homeduino] data: "RF receive 283 899 9569 0 0 0 0 0 01010110010101011010100110011001010101010101011002"
13:30:14.643 [pimatic-homeduino] received: [ 283, 899, 9569 ] 01010110010101011010100110011001010101010101011002
13:30:14.684 [pimatic-homeduino] switch5:  { id: 979295, unit: 0, all: true, state: true }
13:30:14.728 [pimatic-homeduino] data: "RF receive 292 888 9598 0 0 0 0 0 01010110010101011010100110011001010101010101011002"

Thanks for the feedback. The all button should know work probably. Could you test again with pimatic-homeduino v0.8.21.

Thanks for the quick addition, tested the All buttons, they work like a charm ;-)

Great :)

Has anyone an working excample of how to put this in the config?

greetings Hans


{
      "id": "switch",
      "name": "switch",
      "class": "HomeduinoRFSwitch",
      "protocols": [
        {
          "name": "switch5",
          "options": {
            "id": 979295,
            "unit": 1
          }
        }
      ]
    }

Thank you.
This is not working.
Is there a way to check if the transmitter is working?
And yes stupidly i bought only one set

Thanks

Maybe a stupid question from me but did you change the ID and unit in my example to your UD/unit?
If your still having problems please post in the forums http://forum.pimatic.org/

there are no stupid questions, just stupid people.
In this case me.
The ground-cable was faulty.
I have to resolder it.

Thank you very much

I just bought a set eurodomest 972080.
Checked the messages from the remote and added the device to config.json with the id and unit that I received.
When pushing the button in Pimatic I get a warning message, red circle with a cross, Oops..., unit is not defined.
These are my doings:

Message:

2015-11-15 18:01:38debug [pimatic-homeduino]: doorbell1: { id: 1229, unit: 149, state: true }
18:01:38debug [pimatic-homeduino]: led4: { id: 19669, command: 'code:01101111' }
18:01:38debug [pimatic-homeduino]: contact3: { id: 733865, contact: false }
18:01:38debug [pimatic-homeduino]: contact2: { id: 733865, contact: false }
18:01:38debug [pimatic-homeduino]: switch15: { id: 314710, unit: 1, state: true, all: false }
18:01:38debug [pimatic-homeduino]: switch14: { id: 314710, unit: 1, all: false, state: true }
18:01:38debug [pimatic-homeduino]: switch5: { id: 733865, unit: 1, all: false, state: true }
18:01:38debug [pimatic-homeduino]: received: [ 300, 880, 9584 ] 01100101101001011010011001100110011010011010101002
18:01:38debug [pimatic-homeduino]: data: "RF receive 300 880 9584 0 0 0 0 0 01100101101001011010011001100110011010011010101002"

Device in config.json:

{
  "id": "switch",
  "name": "switch",
  "class": "HomeduinoRFSwitch",
  "protocols": [
    {
      "name": "switch5",
      "options": {
        "id": 733865,
        "unit": 1
      }
    }
  ]
}

What am I doing wrong?

After writing my last message I discovered a difference in the code of the switch5.js that was installed with the pimatic-arduino plugin and the switch5.js from the latest rfcontrol.
The one from the pimatic-arduino plugin contains the code:

  return "" + id + unit + "1012"

The one in the latest rfcontrol contains the code:

  return "" + id + unitCode + inverseState + "02";

After updating the switch5.js in the pimatic-arduino plugin it all works.

The working switch5.js code contains the following code :

module.exports = function(helper) {
  var binaryToPulse, protocolInfo, pulsesToBinaryMapping;
  pulsesToBinaryMapping = {
    '10': '0',
    '01': '1',
    '02': ''
  };
  binaryToPulse = {
    '0': '10',
    '1': '01'
  };
  return protocolInfo = {
    name: 'switch5',
    type: 'switch',
    values: {
      id: {
        type: "number"
      },
      all: {
        type: "number"
      },
      unit: {
        type: "number"
      },
      state: {
        type: "boolean"
      }
    },
    brands: ["Eurodomest"],
    pulseLengths: [295, 886, 9626],
    pulseCount: 50,
    decodePulses: function(pulses) {
      var all, binary, id, result, state, unit, unitCode;
      binary = helper.map(pulses, pulsesToBinaryMapping);
      id = helper.binaryToNumber(binary, 0, 19);
      unitCode = helper.binaryToNumber(binary, 20, 22);
      state = !helper.binaryToBoolean(binary, 23);
      all = false;
      unit = ((function() {
        switch (unitCode) {
          case 0:
            return 1;
          case 1:
            return 2;
          case 2:
            return 3;
          case 4:
            return 4;
          default:
            all = true;
            return 0;
        }
      })());
      if (all) {
        state = !state;
      }
      return result = {
        id: id,
        unit: unit,
        all: all,
        state: state
      };
    },
    encodeMessage: function(message) {
      var id, inverseState, state, unitCode;
      id = helper.map(helper.numberToBinary(message.id, 20), binaryToPulse);
      if (message.all) {
        unitCode = (message.state ? 6 : 7);
        state = !message.state;
      } else {
        unitCode = ((function() {
          switch (message.unit) {
            case 1:
              return 0;
            case 2:
              return 1;
            case 3:
              return 2;
            case 4:
              return 4;
          }
        })());
        state = message.state;
      }
      unitCode = helper.map(helper.numberToBinary(unitCode, 3), binaryToPulse);
      inverseState = (state ? binaryToPulse['0'] : binaryToPulse['1']);
      return "" + id + unitCode + inverseState + "02";
    }
  };
};

This is just what I'm looking for. How can I update the switch5.js file on the pi? Where is it located?

txs!

Hi, pergola73,
switch5.js is located deep down in the pimatic-homeduino module.
Mine is located in:
/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/rfcontroljs/lib/protocols/

Read, update, change by using WinSCP.
http://winscp.net/eng/download.php

Succes.

You don't need to manually change the file, because it is in the master branch. You just need to update pimatic-homeduino and the actual rfcontroljs will be downloaded.