Code Monkey home page Code Monkey logo

pimatic-homeduino's Introduction

pimatic-homeduino

Plugin for using various 433 Mhz devices and sensors with a connected Arduino with homeduino sketch or directly with capable hardware like the Raspberry Pi. It is based on the homeduinojs driver implementation.

This plugins supports all 433 MHz devices with rfcontroljs protocol implementations.

Drivers

The plugin can be used with two different hardware combinations:

  • A. Computer with connected Arduino (with homeduino sketch) and 433 MHz transmitter and receiver (recommended)
  • B. Raspberry Pi (or Banana Pi or Hummingboard) with 433 MHz transmitter and receiver

A.Connected Arduino (recommended)

Hardware


You can load the plugin by editing your config.json to include:

{
  "plugin": "homeduino",
  "driver": "serialport",
  "driverOptions": {
    "serialDevice": "/dev/ttyUSB0",
    "baudrate": 115200
  },
  "receiverPin": 0,
  "transmitterPin": 4,
  "dstSearchAddressPin": 12
}

in the plugins section. For all configuration options see homeduino-config-schema

Since pimatic v0.9 you can add and setup the homeduino plugin via GUI in the plugins menu! Please be informed to set the baudrate to 57.600 when using an Arduino on 8MHz to avoid communication issues. Learn more here

The pin numbers are Arduino pin numbers. The receiverPin must be either 0 (INT0) or 1 (INT1). The transmitterPin must be a digital pin between 2 (D2) and 13 (D13).

nano-pins

B. Raspberry Pi with (optional) ATTiny45 / 85 Prefilter

You can load the plugin by editing your config.json to include:

{
  "plugin": "homeduino",
  "driver": "gpio",
  "driverOptions": {},
  "receiverPin": 17,
  "transmitterPin": 23
}

in the plugins section. For all configuration options see homeduino-config-schema

The pin numbers in this case are BCM GPIO Numbers.

Devices

Devices must be added manually to the device section of your pimatic config.

A list with all supported protocols and protocol-options can be found here.

RF Actors

RF Actors like the "HomeduinoRFSwitch" can be controlled or send to outlets with multiple protocols. Just add more protocols to the protocols array. You can also set if a protocol is used for sending or receiving. Default is true for both. In some cases the target receiver does not recognize the transmission. To improve this you can change the amount of message repeats. By default this is set to seven.

Switch example:

A "HomeduinoRFSwitch" can only use switch protocols.

{
  "id": "rfswitch",
  "name": "RFSwitch",
  "class": "HomeduinoRFSwitch",
  "protocols": [{
    "name": "switch1",
    "options": {
      "id": 42,
      "unit": 0
    }
  }]
}
Multi protocol switch example:
    {
      "id": "switchmp",
      "name": "Multi Switch",
      "class": "HomeduinoRFSwitch",
      "protocols": [
        {
          "name": "switch1",
          "options": {
            "id": 9509718,
            "unit": 0
          },
          "send": true,
          "receive": true,
          "rfrepeats": 4
        },
        {
          "name": "switch1",
          "options": {
            "id": 9509718,
            "unit": 1
          },
          "send": false,
          "receive": true,
          "rfrepeats": 9
        }
      ]
    }
Buttons Device example:

A "HomeduinoRFButtonsDevice" can use switch and command protocols.

{
  "id": "homeduino-buttons",
  "name": "Buttons",
  "class": "HomeduinoRFButtonsDevice",
  "buttons": [
    {
      "id": "test-button",
      "text": "test",
      "protocols": [{
        "name": "switch1",
        "options": {
          "unit": 0,
          "id": 42,
          "state": true
        }
      }]
    }
  ]
}
Dimmer device example:

The "HomeduinoRFDimmer" can only use dimmer protocols. The equivalent to dimmer1 is the switch1 protocol.

{
  "id": "dimmer",
  "name": "Dimmer",
  "class": "HomeduinoRFDimmer",
  "protocols": [
    {
      "name": "dimmer1",
      "options": {
        "id": 7654321,
        "unit": 0
      },
      "send": true,
      "receive": true
    }
  ]
}
Shutter sensor example:

Can use switch protocols.

{
  "id": "homeduino-contact",
  "name": "Shutter Controller",
  "class": "HomeduinoRFShutter",
  "protocols": [{
    "name": "switch1",
    "options": {
      "unit": 0,
      "id": 42
    }
  }]
}

RF Sensors

RF Sensors receiving data from any kind of external sensor over 433Mhz messages.

Weather station sensor example:

This is the basic sensor with only temperature and humidity

{
  "id": "rftemperature",
  "name": "Temperature",
  "class": "HomeduinoRFTemperature",
  "protocols": [{
    "name": "weather2",
    "options": {
      "id": 42,
      "channel": 1
    }
  }]
}

For weather stations like the Alecto WS-4500 you should use the weather station device

{
  "id": "weatherstation",
  "name": "Weather Data",
  "class": "HomeduinoRFWeatherStation",
  "protocols": [
    {
      "name": "weather5",
      "options": {
        "id": 120
      }
    }
  ],
  "values": [
    "rain",
    "temperature",
    "humidity"
  ]
}

It supports different values to display rain, temperature, humidity, windGust, windDirection, avgAirspeed, lowBattery and battery. The ordering corresponds to the display ordering in the frontend. lowBattery is an boolean value and battery is an percentage value from 0 to 100. Most protocols supports only an lowBattery value.

Has your sensor a known offset for an value, then you can add a preprocessing to correct the values. For the "HomeduinoRFTemperature" these are (The following is an example)

  "processingTemp": "$value + 10",
  "processingHum": "$value * 0.5",

And for the "HomeduinoRFWeatherStation" these are

  "processingTemp": "($value - 1.2) * 0.9",
  "processingHum": "$value",
  "processingWindGust": "$value",
  "processingAvgAirspeed": "$value",
  "processingWindDirection": "$value + 45",
  "processingRain": "$value",
PIR sensor example:
{
  "id": "homeduino-pir",
  "name": "PIR",
  "class": "HomeduinoRFPir",
  "protocols": [{
    "name": "pir1",
    "options": {
      "unit": 0,
      "id": 17
    }
  }],
  "resetTime": 6000
}
Contact sensor example:
{
  "id": "homeduino-contact",
  "name": "Contact",
  "class": "HomeduinoRFContactSensor",
  "protocols": [{
    "name": "contact1",
    "options": {
      "unit": 0,
      "id": 42
    }
  }]
}

Some contacts only emit an event on open. For this you can set autoReset to true:

{
  "id": "door-contact",
  "name": "door-Contact",
  "class": "HomeduinoRFContactSensor",
  "protocols": [
    {
      "name": "contact2",
      "options": {
        "id": 43690
      }
    }
  ],
  "autoReset": true,
  "resetTime": 3000
}
Generic RF Sensor with Arduino sender
{
  "id": "homeduino-generic-sensor",
  "name": "RFGenericSensor",
  "class": "HomeduinoRFGenericSensor",
  "protocols": [{
    "name": "generic",
    "options": {
      "id": 42
    }
  }],
  "attributes": [
    {
      "name": "temperature",
      "type": 3,
      "decimals": 2,
      "baseValue": 0,
      "unit": "°C",
      "label": "Temperature"
    }
  ]
}

Local Sensors

Local sensors are connected to the arduino. This can be a simple read of an digital pin or an bus sensor like the DS18B20

DHT11/22 sensor example:
{
  "id": "homeduino-temperature",
  "name": "DHT",
  "class": "HomeduinoDHTSensor",
  "type": 22,
  "pin": 13
}
DST Dallas DS18B20 sensor example:
{
  "id": "homeduino-temperature-dst",
  "name": "DST",
  "class": "HomeduinoDSTSensor",
  "pin": 12,
  "address" : "104AE9B50008000E",
  "interval" : 10000
}
AnalogSensor example:

An AnalogSensor can read analog pins of the Arduino and display there value. An optional preprocessing can be applied. Pin numbering starts at 14 (A0) for the first analog pin.

{
  "id": "homeduino-analog-sensor",
  "name": "AnalogSensor",
  "class": "HomeduinoAnalogSensor",
  "attributes": [
    {
      "name": "voltage",
      "unit": "V",
      "label": "Voltage",
      "pin": 14,
      "interval": 50000,
      "processing": "($value / 1023) * 5"
    }
  ]
}

The analog value is between 0 and 1023 and can be preprocessed by an expression. In this example the value is scale to a value between 0 and 5.

ContactSensor example:

An ContactSensor can read digital pins of the Arduino and display the state of it.

{
  "id": "homeduino-contact-sensor",
  "name": "ContactSensor",
  "class": "HomeduinoContactSensor",
  "pin": 9,
  "interval": 10000,
  "inverted": true
}

The pin must be set. Interval and inverted are optional. They are set by default to interval = 10000 and inverted = false.

PIR sensor example:

A PIR sensor can read digital pins of the Arduino and display the presence state of it.

{
  "id": "homeduino-pir",
  "name": "PIR",
  "class": "HomeduinoPir",
  "pin": 9,
  "interval": 10000,
  "inverted": true
}

The pin must be set. Interval and inverted are optional. They are set by default to interval = 10000 and inverted = false.

Local Actor

A local actor is an output on the Arduino like an digital pin or a PWM.

Pin switch example:

The "HomeduinoSwitch" can toggle the state of an pin on the arduino.

{
  "id": "pin-switch",
  "name": "Pin Switch",
  "class": "HomeduinoSwitch",
  "inverted": false,
  "pin": 13
}
AnalogDimmer example:

The AnalogDimmer activates one of the PWM channels on the Arduino. At the moment only the following pins are allowed 3,5,6,9,10,11. The Dimmer maps an value from 0-100 to 0-255. The PWM frequency is about 490Hz.

{
  "id": "analogDimmer1",
  "name": "analogDimmer",
  "class": "HomeduinoAnalogDimmer",
  "pin": 9
}

pimatic-homeduino's People

Contributors

heizelmann avatar icesory avatar kenci avatar leader21 avatar michbeck100 avatar mwittig avatar ronaldsteen avatar sweebee avatar sweetpi avatar yves911 avatar zholer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pimatic-homeduino's Issues

[0.9] Frontend device config switch typeof(id) = string prevents detection (switch1)

Hi there,

I added a HomeduinoRFSwitch (switch1) device but the event didn't register. Debug showed successfull detection so I went digging.
Turns out that the id was set as a string via the frontend edit device dialog which prevented the doesProtocolMatch detection in homeduino.coffee. The id in the config.json for this switch was indeed a string and after changing it to a number everything started working

I don't know where this originates, but I don't have that problem with a switch13, where the id is added as a number to the config.

I am running pimatic 0.9 beta.

Elro Home Easy HE877 problem

Elro Home Easy HE877 switch working with protocol "switch 2".

I have a problem with the receiving mode.

On receiver mode decode the off command from the remote control but the on command decode the same result off.

Any help......

Auriol temperature sensor type IAN 91838 not detected

I have an Auriol weather station with a simple temperature sensor. My pimatic-homeduino logs periodically similar things like this:

21:11:42.635 [pimatic-homeduino] debug: data: "RF receive 444 1992 3955 9330 0 0 0 0 010202010201010202010101010101010101010202020102020202010202010103"
21:11:42.672 [pimatic-homeduino] debug: received: [ 444, 1992, 3955, 9330 ] 010202010201010202010101010101010101010202020102020202010202010103
21:12:13.636 [pimatic-homeduino] debug: data: "RF receive 447 1991 3950 9329 0 0 0 0 010202010201010202010101010101010101010202020102020202010202010103"
21:12:13.673 [pimatic-homeduino] debug: received: [ 447, 1991, 3950, 9329 ] 010202010201010202010101010101010101010202020102020202010202010103
21:12:44.635 [pimatic-homeduino] debug: data: "RF receive 445 1993 3950 9338 0 0 0 0 010202010201010202010101010101010101010202020102020202010202010103"
21:12:44.673 [pimatic-homeduino] debug: received: [ 445, 1993, 3950, 9338 ] 010202010201010202010101010101010101010202020102020202010202010103

but it seems that there is no device detected.

What might be the problem? Isn't it supported.
With Pilight it works well. The pilight config is as follows. Only temperature is valid, humidity is not correct.
"weather": {
"protocol": [ "auriol" ],
"id": [{
"id": 1
}],
"temperature": 0.0,
"humidity": 19.8,
"battery": 1
}

Sorry put the issue in the wrong place first:
see issue #8 in homeduino

Cannot read property 'length' of undefined - using HomeduinoRFShutter - class,Shutter 4 protocol

This has originally been reported as pimatic/pimatic#782 by @TRIROG and on forum - http://forum.pimatic.org/topic/969/homeduinorfshutter-shutter3-how

It can be reproduced as described in pimatic/pimatic#782
Stacktrace:

14:00:23.516 [pimatic] error: Cannot read property 'length' of undefined
14:00:23.537 [pimatic] debug: TypeError: Cannot read property 'length' of undefined
14:00:23.537 [pimatic] debug:>    at Object.module.exports.map (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/rfcontroljs/lib/helper.js:24:20)
14:00:23.537 [pimatic] debug:>    at Object.protocolInfo.encodeMessage (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/rfcontroljs/lib/protocols/shutter4.js:92:24)
14:00:23.537 [pimatic] debug:>    at Object.module.exports.encodeMessage (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/rfcontroljs/lib/controller.js:199:24)
14:00:23.537 [pimatic] debug:>    at Board.rfControlSendMessage (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/lib/board.js:255:24)
14:00:23.537 [pimatic] debug:>    at /home/pi/pimatic-app/node_modules/pimatic-homeduino/homeduino.coffee:335:27
14:00:23.537 [pimatic] debug:>    at tryCatcher (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/util.js:26:23)
14:00:23.537 [pimatic] debug:>    at Promise._settlePromiseFromHandler (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise.js:507:31)
14:00:23.537 [pimatic] debug:>    at Promise._settlePromiseAt (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise.js:581:18)
14:00:23.537 [pimatic] debug:>    at Promise._settlePromiseAtPostResolution (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise.js:245:10)
14:00:23.537 [pimatic] debug:>    at Async._drainQueue (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:128:12)
14:00:23.537 [pimatic] debug:>    at Async._drainQueues (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:133:10)
14:00:23.537 [pimatic] debug:>    at Async.drainQueues (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:15:14)
14:00:23.537 [pimatic] debug:>    at process._tickDomainCallback (node.js:459:13)

on/off events independent of current state

Would it be possible to always trigger the on event for a switch even if the state currently is already on? Same for off.
Example:
I have RF wall switches on both sides of the room. I turn it on on one side of the room and want to turn it off on the other side of the room but current state of this switch offs already off.
Currently I can see that off is received but nothing happens in the rule which uses "if switch2 is turned off..."
Maybe this could also be a general functionality for all switch type devices in pimatic.

transition from pilight to homeduino with Elro HE

My working pilight config:
hardware.json

{
        "433gpio": {
                "sender": 8,
                "receiver": -1
        }

config.json

{
        "office": {
                "name": "Office",
                "actuator1": {
                        "name": "Heater",
                        "protocol": [ "elro_he" ],
                        "id": [{
                                "systemcode": 31,
                                "unitcode": 1
                        }],
                        "state": "off"
                },
                "actuator2": {
                        "name": "Main LED lights",
                        "protocol": [ "elro_he" ],
                        "id": [{
                                "systemcode": 31,
                                "unitcode": 2
                        }],
                        "state": "off"
                }
        }

Sending command over send program its ok, example: send 11111 1 1
But I have no luck with homeduino plugin.
My config:

    {
    "plugin": "homeduino",
    "driver": "gpio",
    "enableReceiving": false,
    "transmitterPin": 8,
    "driverOptions": {},
    }
   {
      "id": "aqua-1-main-lights",
      "name": "Main Lights",
      "class": "HomeduinoRFSwitch",
      "protocols": [{
        "name": "switch2",
        "options": {
          "unitCode": 1,
          "houseCode": 31
        }
      }]
    }

Please, where is my mistake?

HomeduinoRFContactSensor inverted Graph

Hi,

not sure to drop my question/request here; if wrong excuses for that.
When using my HomeduinoRFContactSensor, it's normaly closed.
Status in Homeduino is OK (and adjustable with labels), however when I click on the graph within Pimatic, the statusline is way up the baseline, however when the contact is open, the statusline drops to the baseline. Is it possible to invert the graph? I saw in the .coffee code the HomeduinoContactSensor supports the property inverted, the HomeduinoRFContactSensor not

homeduinorfcontactsensor

Would you be so kind to fix that?
Thanks in advance,
Was

Homedunio + Mediacenter (XBMC)

Hi guys,

i hope you can give a helping hand.

I want to know if it is possible to set up the Rapi with xbmc like RaspMc and use the homeduino without limitations?

SO far ive got the reciver and sender connected to my Pi directly but the XBMC is damn slow/unuseable.
If i connect a Arduino Nano clone via USB, will this will restore the Rapi's Power to make XBMC play FULL HD + DTS Movies as before? Or will this limit the Power of the Rapi no matter what and i shall buy a nother Rapi?

Thank you guys!

HowTo: Add a new protocol

How can i add a new protocol? Is there a tutorial or something similar. I am not good at javascript but i will give my best :)

This is what i get from debug:
19:20:07.231 [pimatic-homeduino] debug: data: "RF receive 1472 490 6956 0 0 0 0 0 010110100101101001100101011010100110101010011001010110011010010112"
19:20:07.246 [pimatic-homeduino] debug: received: [ 490, 1472, 6956 ] 101001011010010110011010100101011001010101100110101001100101101002

and sometimes this:
19:25:46.176 [pimatic-homeduino] debug: data: "RF receive 496 1471 6924 0 0 0 0 0 011010011010010110101010010101101010011001100110100101100101101002"
19:25:46.207 [pimatic-homeduino] debug: received: [ 496, 1471, 6924 ] 011010011010010110101010010101101010011001100110100101100101101002
19:25:46.670 [pimatic-homeduino] debug: data: "RF receive 495 1467 7036 0 0 0 0 0 011010011010010110101010010101101010011001100110100101100101101002"
19:25:46.681 [pimatic-homeduino] debug: received: [ 495, 1467, 7036 ] 011010011010010110101010010101101010011001100110100101100101101002
19:25:46.881 [pimatic-homeduino] debug: data: "RF receive 498 1468 6920 0 0 0 0 0 011010011010010110101010010101101010011001100110100101100101101002"
19:25:46.893 [pimatic-homeduino] debug: received: [ 498, 1468, 6920 ] 011010011010010110101010010101101010011001100110100101100101101002

Is someone willling to help?

Can't install pimatic-homeduino, failed to install [email protected]

I'm trying to install pimatic-homeduino, but it fails on installing the dependencies. I tried installing it as root, install serialport manually, or install with --unsafe-perm, but still the installation fails. I'm thinking this is a bug.

OS: Raspbian GNU/Linux 8
Device: Raspberry Pi B2+

$ npm install pimatic-homeduino --unsafe-perm
[              ....] / extract:bluebird: verb gentlyRm don't care about contents; nuking /usr/share/pimatic/pimatic-app/node_modules/.st
[              ....] / extract:bluebird: verb gentlyRm don't care about contents; nuking /usr/share/pimatic/pimatic-app/node_modules/.st
[              ....] / extract:bluebird: verb gentlyRm don't care about contents; nuking /usr/share/pimatic/pimatic-app/node_modules/.st
[               ...] | preinstall:pimatic-homeduino: sill doParallel preinstall 217


[               ...] / finalize:strip-ansi: sill finalize /usr/share/pimatic/pimatic-app/node_modules/serialport/node_modules/node-pre-g
[               ...] / finalize:strip-ansi: sill finalize /usr/share/pimatic/pimatic-app/node_modules/serialport/node_modules/node-pre-g

> [email protected] install /usr/share/pimatic/pimatic-app/node_modules/serialport
> node-pre-gyp install --fallback-to-build

make: Entering directory '/usr/share/pimatic/pimatic-app/node_modules/serialport/build'
  CXX(target) Release/obj.target/serialport/src/serialport.o
In file included from ../../nan/nan.h:182:0,
                 from ../src/serialport.h:5,
                 from ../src/serialport.cpp:3:
../../nan/nan_maybe_43_inl.h: In function ‘Nan::MaybeLocal<v8::Object> Nan::CloneElementAt(v8::Local<v8::Array>, uint32_t)’:
../../nan/nan_maybe_43_inl.h:221:58: warning: ‘v8::MaybeLocal<v8::Object> v8::Array::CloneElementAt(v8::Local<v8::Context>, uint32_t)’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:3031): Cloning is not supported. [-Wdeprecated-declarations]
   return array->CloneElementAt(GetCurrentContext(), index);
                                                          ^
In file included from ../../nan/nan_new.h:189:0,
                 from ../../nan/nan.h:188,
                 from ../src/serialport.h:5,
                 from ../src/serialport.cpp:3:
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::BooleanObject>::return_t Nan::imp::Factory<v8::BooleanObject>::New(bool)’:
../../nan/nan_implementation_12_inl.h:40:38: warning: ‘static v8::Local<v8::Value> v8::BooleanObject::New(bool)’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:4007): Pass an isolate [-Wdeprecated-declarations]
   return v8::BooleanObject::New(value).As<v8::BooleanObject>();
                                      ^
In file included from ../src/serialport.h:5:0,
                 from ../src/serialport.cpp:3:
../../nan/nan.h: At global scope:
../../nan/nan.h:590:20: error: variable or field ‘AddGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback
                    ^
../../nan/nan.h:590:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCEpilogueCallback callback
       ^
../../nan/nan.h:591:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^
../../nan/nan.h:596:20: error: variable or field ‘RemoveGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback) {
                    ^
../../nan/nan.h:596:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCEpilogueCallback callback) {
       ^
../../nan/nan.h:601:20: error: variable or field ‘AddGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback
                    ^
../../nan/nan.h:601:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCPrologueCallback callback
       ^
../../nan/nan.h:602:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^
../../nan/nan.h:607:20: error: variable or field ‘RemoveGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback) {
                    ^
../../nan/nan.h:607:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCPrologueCallback callback) {
       ^
../../nan/nan.h: In function ‘bool Nan::SetAccessor(v8::Local<v8::Object>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
../../nan/nan.h:1933:16: warning: ‘bool v8::Object::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:2750): Use maybe version [-Wdeprecated-declarations]
     , attribute);
                ^
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:115:116: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
   baton->baudRate = Nan::Get(options, Nan::New<v8::String>("baudRate").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
                                                                                                                    ^
../src/serialport.cpp:116:116: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
   baton->dataBits = Nan::Get(options, Nan::New<v8::String>("dataBits").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
                                                                                                                    ^
../src/serialport.cpp:117:120: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
   baton->bufferSize = Nan::Get(options, Nan::New<v8::String>("bufferSize").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
                                                                                                                        ^
../src/serialport.cpp:119:131: warning: ‘v8::Local<v8::Number> v8::Value::ToNumber() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8166): Use maybe version [-Wdeprecated-declarations]
   baton->stopBits = ToStopBitEnum(Nan::Get(options, Nan::New<v8::String>("stopBits").ToLocalChecked()).ToLocalChecked()->ToNumber()->NumberValue());
                                                                                                                                   ^
../src/serialport.cpp: In function ‘void EIO_AfterOpen(uv_work_t*)’:
../src/serialport.cpp:159:31: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
     int fd = argv[1]->ToInt32()->Int32Value();
                               ^
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:180:29: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
   int fd = info[0]->ToInt32()->Int32Value();
                             ^
../src/serialport.cpp:199:116: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
   baton->baudRate = Nan::Get(options, Nan::New<v8::String>("baudRate").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
                                                                                                                    ^
../src/serialport.cpp:200:116: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
   baton->dataBits = Nan::Get(options, Nan::New<v8::String>("dataBits").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
                                                                                                                    ^
../src/serialport.cpp:201:120: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
   baton->bufferSize = Nan::Get(options, Nan::New<v8::String>("bufferSize").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
                                                                                                                        ^
../src/serialport.cpp:203:131: warning: ‘v8::Local<v8::Number> v8::Value::ToNumber() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8166): Use maybe version [-Wdeprecated-declarations]
   baton->stopBits = ToStopBitEnum(Nan::Get(options, Nan::New<v8::String>("stopBits").ToLocalChecked()).ToLocalChecked()->ToNumber()->NumberValue());
                                                                                                                                   ^
../src/serialport.cpp: In function ‘void EIO_AfterUpdate(uv_work_t*)’:
../src/serialport.cpp:242:31: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
     int fd = argv[1]->ToInt32()->Int32Value();
                               ^
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Write(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:263:29: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
   int fd = info[0]->ToInt32()->Int32Value();
                             ^
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:374:29: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
   int fd = info[0]->ToInt32()->Int32Value();
                             ^
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:493:29: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
   int fd = info[0]->ToInt32()->Int32Value();
                             ^
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:542:29: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
   int fd = info[0]->ToInt32()->Int32Value();
                             ^
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:603:29: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /home/max/.node-gyp/6.9.2/include/node/v8.h:8202): Use maybe version [-Wdeprecated-declarations]
   int fd = info[0]->ToInt32()->Int32Value();
                             ^
serialport.target.mk:94: recipe for target 'Release/obj.target/serialport/src/serialport.o' failed
make: *** [Release/obj.target/serialport/src/serialport.o] Error 1
make: Leaving directory '/usr/share/pimatic/pimatic-app/node_modules/serialport/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.4.13+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/share/pimatic/pimatic-app/node_modules/serialport/build/Release/node-v48-linux-arm/serialport.node" "--module_name=serialport" "--module_path=/usr/share/pimatic/pimatic-app/node_modules/serialport/build/Release/node-v48-linux-arm"
gyp ERR! cwd /usr/share/pimatic/pimatic-app/node_modules/serialport
gyp ERR! node -v v6.9.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/share/pimatic/pimatic-app/node_modules/serialport/build/Release/node-v48-linux-arm/serialport.node --module_name=serialport --module_path=/usr/share/pimatic/pimatic-app/node_modules/serialport/build/Release/node-v48-linux-arm' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/share/pimatic/pimatic-app/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Linux 4.4.13+
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/share/pimatic/pimatic-app/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/share/pimatic/pimatic-app/node_modules/serialport
node-pre-gyp ERR! node -v v6.9.2
node-pre-gyp ERR! node-pre-gyp -v v0.6.18
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/share/pimatic/pimatic-app/node_modules/serialport/build/Release/node-v48-linux-arm/serialport.node --module_name=serialport --module_path=/usr/share/pimatic/pimatic-app/node_modules/serialport/build/Release/node-v48-linux-arm' (1)
/usr/share/pimatic/pimatic-app
└── UNMET PEER DEPENDENCY [email protected]

npm WARN enoent ENOENT: no such file or directory, open '/usr/share/pimatic/pimatic-app/package.json'
npm WARN [email protected] requires a peer of [email protected].* but none was installed.
npm WARN pimatic-app No description
npm WARN pimatic-app No repository field.
npm WARN pimatic-app No README data
npm WARN pimatic-app No license field.
npm ERR! Linux 4.4.13+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "pimatic-homeduino" "--unsafe-perm"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs serialport
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls serialport
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/share/pimatic/pimatic-app/node_modules/npm-debug.log
npm ERR! code 1

on/off inverted

I just switched from pilight to homeduino using the gpio driver. My pimatic config contains

  "plugins": [
    {
      "plugin": "homeduino",
      "driver": "gpio",
      "driverOptions": {},
      "receiverPin": 1,
      "transmitterPin": 0
    }
  ],
  "devices": [
    {
      "id": "pilight-living-sw1",
      "name": "Switch A",
      "class": "HomeduinoRFSwitch",
      "protocols": [
        {
          "name": "switch3",
          "options": {
            "houseCode": 21,
            "unitCode": 16
          }
        }
      ]
    }

It works well, but on and off state of the switch is inverted.

Great plugin, thank you.

Error: Cannot find module 'rfcontroljs'

After adding the homeduino plugin to my pimatic config i get the error above.
Does homeduino requires this plugin? Why isn't it linked via the packages.json?

How can i solve the problem?
Thanks for help.

Update: Having a sleepless night I tried to install it manually and it works fine for now. But why is a manual installation needed?

Support for Daycom Switches (pollin)

Update: Okay I realised by landlord was mistaken something - I can't use these switches in my appartment.
Unfortunately you need the correct wiring (L/N + Lamp)..
I'll leave this open for anybody that want to implement it as there might be others using this.

I have these now at home: http://www.pollin.de/shop/dt/NDY5ODQ0OTk-/Haustechnik/Funkschaltsysteme/Funkschalter_Set_DAYCOM_FSU_131.html

They seem to be (partially) supported by pilight:
http://forum.pilight.org/Thread-Daycom-switch-pollin

They get detected as switch5/contact2:

Button 1 on

debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:32:00debug [pimatic-homeduino]: switch5: { id: 633667, unit: 1, all: false, state: true }
18:32:00debug [pimatic-homeduino]: received: [ 304, 911, 9604 ] 01101001011001100110010110011010101001011010101002
18:32:00debug [pimatic-homeduino]: data: "RF receive 304 911 9604 0 0 0 0 0 01101001011001100110010110011010101001011010101002"
18:32:00debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:32:00debug [pimatic-homeduino]: switch5: { id: 633667, unit: 1, all: false, state: true }
18:32:00debug [pimatic-homeduino]: received: [ 303, 912, 9608 ] 01101001011001100110010110011010101001011010101002
18:32:00debug [pimatic-homeduino]: data: "RF receive 303 912 9608 0 0 0 0 0 01101001011001100110010110011010101001011010101002"
18:32:00debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:32:00debug [pimatic-homeduino]: switch5: { id: 633667, unit: 1, all: false, state: true }
18:32:00debug [pimatic-homeduino]: received: [ 303, 912, 9608 ] 01101001011001100110010110011010101001011010101002
18:32:00debug [pimatic-homeduino]: data: "RF receive 303 912 9608 0 0 0 0 0 01101001011001100110010110011010101001011010101002"
18:32:00debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:32:00debug [pimatic-homeduino]: switch5: { id: 633667, unit: 1, all: false, state: true }
18:32:00debug [pimatic-homeduino]: received: [ 304, 911, 9600 ] 01101001011001100110010110011010101001011010101002
18:32:00debug [pimatic-homeduino]: data: "RF receive 304 911 9600 0 0 0 0 0 01101001011001100110010110011010101001011010101002"
18:32:00debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:32:00debug [pimatic-homeduino]: switch5: { id: 633667, unit: 1, all: false, state: true }
18:32:00debug [pimatic-homeduino]: received: [ 306, 909, 9616 ] 01101001011001100110010110011010101001011010101002
18:32:00debug [pimatic-homeduino]: data: "RF receive 306 909 9616 0 0 0 0 0 01101001011001100110010110011010101001011010101002"
18:32:00debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:32:00debug [pimatic-homeduino]: switch5: { id: 633667, unit: 1, all: false, state: true }
18:32:00debug [pimatic-homeduino]: received: [ 305, 910, 9616 ] 01101001011001100110010110011010101001011010101002
18:32:00debug [pimatic-homeduino]: data: "RF receive 305 910 9616 0 0 0 0 0 01101001011001100110010110011010101001011010101002"

Button 1 off

debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:35:44debug [pimatic-homeduino]: switch5: { id: 633667, unit: 4, all: false, state: true }
18:35:44debug [pimatic-homeduino]: received: [ 298, 917, 9592 ] 01101001011001100110010110011010101001010110101002
18:35:44debug [pimatic-homeduino]: data: "RF receive 298 917 9592 0 0 0 0 0 01101001011001100110010110011010101001010110101002"
18:35:43debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:35:43debug [pimatic-homeduino]: switch5: { id: 633667, unit: 4, all: false, state: true }
18:35:43debug [pimatic-homeduino]: received: [ 296, 917, 9616 ] 01101001011001100110010110011010101001010110101002
18:35:43debug [pimatic-homeduino]: data: "RF receive 296 917 9616 0 0 0 0 0 01101001011001100110010110011010101001010110101002"
18:35:43debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:35:43debug [pimatic-homeduino]: switch5: { id: 633667, unit: 4, all: false, state: true }
18:35:43debug [pimatic-homeduino]: received: [ 254, 308, 911, 9588 ] 12212012122112211221120221122121212112121221212113
18:35:43debug [pimatic-homeduino]: data: "RF receive 308 911 254 9588 0 0 0 0 01101201011001100110012110011010101001010110101003"
18:35:43debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:35:43debug [pimatic-homeduino]: switch5: { id: 633667, unit: 4, all: false, state: true }
18:35:43debug [pimatic-homeduino]: received: [ 310, 905, 9588 ] 01101001011001100110010110011010101001010110101002
18:35:43debug [pimatic-homeduino]: data: "RF receive 310 905 9588 0 0 0 0 0 01101001011001100110010110011010101001010110101002"
18:35:43debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:35:43debug [pimatic-homeduino]: switch5: { id: 633667, unit: 4, all: false, state: true }
18:35:43debug [pimatic-homeduino]: received: [ 311, 903, 9584 ] 01101001011001100110010110011010101001010110101002
18:35:43debug [pimatic-homeduino]: data: "RF receive 311 903 9584 0 0 0 0 0 01101001011001100110010110011010101001010110101002"
18:35:43debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:35:43debug [pimatic-homeduino]: switch5: { id: 633667, unit: 4, all: false, state: true }
18:35:43debug [pimatic-homeduino]: received: [ 314, 854, 933, 9580 ] 01202001012001200220020120012020101001020210202003
18:35:43debug [pimatic-homeduino]: data: "RF receive 314 854 933 9580 0 0 0 0 01202001012001200220020120012020101001020210202003"

Button 2 on

debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:36:27debug [pimatic-homeduino]: switch5: { id: 633667, unit: 3, all: false, state: true }
18:36:27debug [pimatic-homeduino]: received: [ 305, 910, 9592 ] 01101001011001100110010110011010101001011001101002
18:36:27debug [pimatic-homeduino]: data: "RF receive 305 910 9592 0 0 0 0 0 01101001011001100110010110011010101001011001101002"
18:36:26debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:36:26debug [pimatic-homeduino]: switch5: { id: 633667, unit: 3, all: false, state: true }
18:36:26debug [pimatic-homeduino]: received: [ 305, 910, 9588 ] 01101001011001100110010110011010101001011001101002
18:36:26debug [pimatic-homeduino]: data: "RF receive 305 910 9588 0 0 0 0 0 01101001011001100110010110011010101001011001101002"
18:36:26debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:36:26debug [pimatic-homeduino]: switch5: { id: 633667, unit: 3, all: false, state: true }
18:36:26debug [pimatic-homeduino]: received: [ 305, 909, 9604 ] 01101001011001100110010110011010101001011001101002
18:36:26debug [pimatic-homeduino]: data: "RF receive 305 909 9604 0 0 0 0 0 01101001011001100110010110011010101001011001101002"
18:36:26debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:36:26debug [pimatic-homeduino]: switch5: { id: 633667, unit: 3, all: false, state: true }
18:36:26debug [pimatic-homeduino]: received: [ 304, 911, 9600 ] 01101001011001100110010110011010101001011001101002
18:36:26debug [pimatic-homeduino]: data: "RF receive 304 911 9600 0 0 0 0 0 01101001011001100110010110011010101001011001101002"
18:36:26debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:36:26debug [pimatic-homeduino]: switch5: { id: 633667, unit: 3, all: false, state: true }
18:36:26debug [pimatic-homeduino]: received: [ 172, 309, 910, 9628 ] 12212112122112211221121221122121212112122112212103
18:36:26debug [pimatic-homeduino]: data: "RF receive 309 910 172 9628 0 0 0 0 01101001011001100110010110011010101001011001101023"
18:36:26debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:36:26debug [pimatic-homeduino]: switch5: { id: 633667, unit: 3, all: false, state: true }
18:36:26debug [pimatic-homeduino]: received: [ 306, 909, 9612 ] 01101001011001100110010110011010101001011001101002
18:36:26debug [pimatic-homeduino]: data: "RF receive 306 909 9612 0 0 0 0 0 01101001011001100110010110011010101001011001101002"
18:36:26debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:36:26debug [pimatic-homeduino]: switch5: { id: 633667, unit: 3, all: false, state: true }
18:36:26debug [pimatic-homeduino]: received: [ 302, 912, 9620 ] 01101001011001100110010110011010101001011001101002
18:36:26debug [pimatic-homeduino]: data: "RF receive 302 912 9620 0 0 0 0 0 01101001011001100110010110011010101001011001101002"

Button 2 off

debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:36:59debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: false }
18:36:59debug [pimatic-homeduino]: received: [ 304, 912, 9600 ] 01101001011001100110010110011010101001010101101002
18:36:59debug [pimatic-homeduino]: data: "RF receive 304 912 9600 0 0 0 0 0 01101001011001100110010110011010101001010101101002"
18:36:59debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:36:59debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: false }
18:36:59debug [pimatic-homeduino]: received: [ 305, 911, 9588 ] 01101001011001100110010110011010101001010101101002
18:36:59debug [pimatic-homeduino]: data: "RF receive 305 911 9588 0 0 0 0 0 01101001011001100110010110011010101001010101101002"
18:36:58debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:36:58debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: false }
18:36:58debug [pimatic-homeduino]: received: [ 305, 910, 9580 ] 01101001011001100110010110011010101001010101101002
18:36:58debug [pimatic-homeduino]: data: "RF receive 305 910 9580 0 0 0 0 0 01101001011001100110010110011010101001010101101002"
18:36:58debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:36:58debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: false }
18:36:58debug [pimatic-homeduino]: received: [ 305, 910, 9576 ] 01101001011001100110010110011010101001010101101002
18:36:58debug [pimatic-homeduino]: data: "RF receive 305 910 9576 0 0 0 0 0 01101001011001100110010110011010101001010101101002"
18:36:58debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:36:58debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: false }
18:36:58debug [pimatic-homeduino]: received: [ 300, 915, 9584 ] 01101001011001100110010110011010101001010101101002
18:36:58debug [pimatic-homeduino]: data: "RF receive 300 915 9584 0 0 0 0 0 01101001011001100110010110011010101001010101101002"

Button 3 on

debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:37:31debug [pimatic-homeduino]: switch5: { id: 633667, unit: 2, all: false, state: true }
18:37:31debug [pimatic-homeduino]: received: [ 305, 910, 9612 ] 01101001011001100110010110011010101001011010011002
18:37:31debug [pimatic-homeduino]: data: "RF receive 305 910 9612 0 0 0 0 0 01101001011001100110010110011010101001011010011002"
18:37:31debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:37:31debug [pimatic-homeduino]: switch5: { id: 633667, unit: 2, all: false, state: true }
18:37:31debug [pimatic-homeduino]: received: [ 306, 909, 9604 ] 01101001011001100110010110011010101001011010011002
18:37:31debug [pimatic-homeduino]: data: "RF receive 306 909 9604 0 0 0 0 0 01101001011001100110010110011010101001011010011002"
18:37:30debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:37:30debug [pimatic-homeduino]: switch5: { id: 633667, unit: 2, all: false, state: true }
18:37:30debug [pimatic-homeduino]: received: [ 305, 910, 9608 ] 01101001011001100110010110011010101001011010011002
18:37:30debug [pimatic-homeduino]: data: "RF receive 305 910 9608 0 0 0 0 0 01101001011001100110010110011010101001011010011002"
18:37:30debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:37:30debug [pimatic-homeduino]: switch5: { id: 633667, unit: 2, all: false, state: true }
18:37:30debug [pimatic-homeduino]: received: [ 304, 910, 9608 ] 01101001011001100110010110011010101001011010011002
18:37:30debug [pimatic-homeduino]: data: "RF receive 304 910 9608 0 0 0 0 0 01101001011001100110010110011010101001011010011002"
18:37:30debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:37:30debug [pimatic-homeduino]: switch5: { id: 633667, unit: 2, all: false, state: true }
18:37:30debug [pimatic-homeduino]: received: [ 303, 911, 9616 ] 01101001011001100110010110011010101001011010011002
18:37:30debug [pimatic-homeduino]: data: "RF receive 303 911 9616 0 0 0 0 0 01101001011001100110010110011010101001011010011002"

Button 3 off

debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:38:23debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: false }
18:38:23debug [pimatic-homeduino]: received: [ 307, 908, 9608 ] 01101001011001100110010110011010101001010110011002
18:38:23debug [pimatic-homeduino]: data: "RF receive 307 908 9608 0 0 0 0 0 01101001011001100110010110011010101001010110011002"
18:38:23debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:38:23debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: false }
18:38:23debug [pimatic-homeduino]: received: [ 305, 910, 9596 ] 01101001011001100110010110011010101001010110011002
18:38:23debug [pimatic-homeduino]: data: "RF receive 305 910 9596 0 0 0 0 0 01101001011001100110010110011010101001010110011002"
18:38:23debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:38:23debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: false }
18:38:23debug [pimatic-homeduino]: received: [ 306, 909, 9596 ] 01101001011001100110010110011010101001010110011002
18:38:23debug [pimatic-homeduino]: data: "RF receive 306 909 9596 0 0 0 0 0 01101001011001100110010110011010101001010110011002"
18:38:23debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:38:23debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: false }
18:38:23debug [pimatic-homeduino]: received: [ 301, 914, 9592 ] 01101001011001100110010110011010101001010110011002
18:38:23debug [pimatic-homeduino]: data: "RF receive 301 914 9592 0 0 0 0 0 01101001011001100110010110011010101001010110011002"
18:38:23debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:38:23debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: false }
18:38:23debug [pimatic-homeduino]: received: [ 304, 911, 9608 ] 01101001011001100110010110011010101001010110011002
18:38:23debug [pimatic-homeduino]: data: "RF receive 304 911 9608 0 0 0 0 0 01101001011001100110010110011010101001010110011002"

Button 4 on

debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:38:52debug [pimatic-homeduino]: switch5: { id: 633667, unit: 1, all: false, state: false }
18:38:52debug [pimatic-homeduino]: received: [ 305, 910, 9608 ] 01101001011001100110010110011010101001011010100102
18:38:52debug [pimatic-homeduino]: data: "RF receive 305 910 9608 0 0 0 0 0 01101001011001100110010110011010101001011010100102"
18:38:51debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:38:51debug [pimatic-homeduino]: switch5: { id: 633667, unit: 1, all: false, state: false }
18:38:51debug [pimatic-homeduino]: received: [ 305, 910, 9612 ] 01101001011001100110010110011010101001011010100102
18:38:51debug [pimatic-homeduino]: data: "RF receive 305 910 9612 0 0 0 0 0 01101001011001100110010110011010101001011010100102"
18:38:51debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:38:51debug [pimatic-homeduino]: switch5: { id: 633667, unit: 1, all: false, state: false }
18:38:51debug [pimatic-homeduino]: received: [ 301, 915, 9584 ] 01101001011001100110010110011010101001011010100102
18:38:51debug [pimatic-homeduino]: data: "RF receive 301 915 9584 0 0 0 0 0 01101001011001100110010110011010101001011010100102"
18:38:51debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:38:51debug [pimatic-homeduino]: switch5: { id: 633667, unit: 1, all: false, state: false }
18:38:51debug [pimatic-homeduino]: received: [ 300, 915, 9604 ] 01101001011001100110010110011010101001011010100102
18:38:51debug [pimatic-homeduino]: data: "RF receive 300 915 9604 0 0 0 0 0 01101001011001100110010110011010101001011010100102"
18:38:51debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:38:51debug [pimatic-homeduino]: switch5: { id: 633667, unit: 1, all: false, state: false }
18:38:51debug [pimatic-homeduino]: received: [ 302, 913, 9612 ] 01101001011001100110010110011010101001011010100102
18:38:51debug [pimatic-homeduino]: data: "RF receive 302 913 9612 0 0 0 0 0 01101001011001100110010110011010101001011010100102"

Button 4 off

debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:39:14debug [pimatic-homeduino]: switch5: { id: 633667, unit: 4, all: false, state: false }
18:39:14debug [pimatic-homeduino]: received: [ 307, 908, 9612 ] 01101001011001100110010110011010101001010110100102
18:39:14debug [pimatic-homeduino]: data: "RF receive 307 908 9612 0 0 0 0 0 01101001011001100110010110011010101001010110100102"
18:39:14debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:39:14debug [pimatic-homeduino]: switch5: { id: 633667, unit: 4, all: false, state: false }
18:39:14debug [pimatic-homeduino]: received: [ 302, 913, 9604 ] 01101001011001100110010110011010101001010110100102
18:39:14debug [pimatic-homeduino]: data: "RF receive 302 913 9604 0 0 0 0 0 01101001011001100110010110011010101001010110100102"
18:39:14debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:39:14debug [pimatic-homeduino]: switch5: { id: 633667, unit: 4, all: false, state: false }
18:39:14debug [pimatic-homeduino]: received: [ 306, 909, 9612 ] 01101001011001100110010110011010101001010110100102
18:39:14debug [pimatic-homeduino]: data: "RF receive 306 909 9612 0 0 0 0 0 01101001011001100110010110011010101001010110100102"
18:39:14debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:39:14debug [pimatic-homeduino]: switch5: { id: 633667, unit: 4, all: false, state: false }
18:39:14debug [pimatic-homeduino]: received: [ 307, 908, 9604 ] 01101001011001100110010110011010101001010110100102
18:39:14debug [pimatic-homeduino]: data: "RF receive 307 908 9604 0 0 0 0 0 01101001011001100110010110011010101001010110100102"
18:39:14debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:39:14debug [pimatic-homeduino]: switch5: { id: 633667, unit: 4, all: false, state: false }
18:39:14debug [pimatic-homeduino]: received: [ 304, 910, 9624 ] 01101001011001100110010110011010101001010110100102
18:39:13debug [pimatic-homeduino]: data: "RF receive 304 910 9624 0 0 0 0 0 01101001011001100110010110011010101001010110100102"

all off

debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:52:06debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: true }
18:52:06debug [pimatic-homeduino]: received: [ 300, 914, 9624 ] 01101001011001100110010110011010101001011001010102
18:52:06debug [pimatic-homeduino]: data: "RF receive 300 914 9624 0 0 0 0 0 01101001011001100110010110011010101001011001010102"
18:52:05debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:52:05debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: true }
18:52:05debug [pimatic-homeduino]: received: [ 303, 912, 9624 ] 01101001011001100110010110011010101001011001010102
18:52:05debug [pimatic-homeduino]: data: "RF receive 303 912 9624 0 0 0 0 0 01101001011001100110010110011010101001011001010102"
18:52:05debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:52:05debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: true }
18:52:05debug [pimatic-homeduino]: received: [ 300, 914, 9616 ] 01101001011001100110010110011010101001011001010102
18:52:05debug [pimatic-homeduino]: data: "RF receive 300 914 9616 0 0 0 0 0 01101001011001100110010110011010101001011001010102"
18:52:04debug [pimatic-homeduino]: contact2: { id: 633667, contact: false }
18:52:04debug [pimatic-homeduino]: switch5: { id: 633667, unit: 0, all: true, state: true }
18:52:04debug [pimatic-homeduino]: received: [ 302, 913, 9600 ] 01101001011001100110010110011010101001011001010102
18:52:04debug [pimatic-homeduino]: data: "RF receive 302 913 9600 0 0 0 0 0 01101001011001100110010110011010101001011001010102"

That's all from the included remote. Since state actually is changing (not in the right way but still) I guess the protocol is very similar to switch5? Probably it's an easy fix?

sliding back dimmers

I already have post the topic on pimatic forum. But my biggest guess it is related to the homeduino plugin....? After setting the dimlevel the slider slides back to almost zero. Here is some input: Unfortunately I still have the problem of sliding back dimmers. Did not have time to get more info on it. Now I did some debugging:

 21:23:04.162 [pimatic-homeduino] Sending Protocol: dimmer1 id:1337110 unit:0 all:false dimlevel:4 Pin:4 Repeats:1
 21:23:04.856 [pimatic-homeduino] data: "ACK"
 21:23:04.904 [pimatic-homeduino] data: "RF receive 348 2636 215 1262 10416 0 0 0 0102030203020302030203030202030302020302030203030203020203020303020302030202030203020303020203030203020203020302020203020302030203020303020203020304"
 21:23:04.921 [pimatic-homeduino] received: [ 215, 348, 1262, 2636, 10416 ] 1310121012101210121012121010121210101210121012121012101012101212101210121010121012101212101012121012101012101210101012101210121012101212101012101214
 21:23:04.946 [pimatic-homeduino] dimmer1: { id: 1337110, all: false, unit: 0, dimlevel: 4, state: undefined }
 21:23:06.676 [pimatic-homeduino] Sending Protocol: dimmer1 id:1337110 unit:0 all:false dimlevel:7 Pin:4 Repeats:1
 21:23:07.356 [pimatic-homeduino] data: "ACK"
 21:23:07.413 [pimatic-homeduino] data: "RF receive 348 2636 216 1262 10416 0 0 0 0102030203020302030203030202030302020302030203030203020203020303020302030202030203020303020203030203020203020302020203020302030203020303020302030204"
 21:23:07.429 [pimatic-homeduino] received: [ 216, 348, 1262, 2636, 10416 ] 1310121012101210121012121010121210101210121012121012101012101212101210121010121012101212101012121012101012101210101012101210121012101212101210121014
 21:23:07.450 [pimatic-homeduino] dimmer1: { id: 1337110, all: false, unit: 0, dimlevel: 7, state: undefined }
 21:23:26.398 [pimatic-homeduino] Sending Protocol: dimmer1 id:1337110 unit:0 all:false dimlevel:0 Pin:4 Repeats:1
 21:23:27.082 [pimatic-homeduino] data: "ACK"
 21:23:27.119 [pimatic-homeduino] data: "RF receive 348 2648 215 1263 10412 0 0 0 0102030203020302030203030202030302020302030203030203020203020303020302030202030203020303020203030203020203020302020203020302030203020302030203020304"
 21:23:27.135 [pimatic-homeduino] received: [ 215, 348, 1263, 2648, 10412 ] 1310121012101210121012121010121210101210121012121012101012101212101210121010121012101212101012121012101012101210101012101210121012101210121012101214
 21:23:27.156 [pimatic-homeduino] dimmer1: { id: 1337110, all: false, unit: 0, dimlevel: 0, state: undefined }

09.06.2016 21:23:27 Lamp Bank (KAKU_BANK) State off
 09.06.2016 21:23:27 Lamp Bank (KAKU_BANK) Dimlevel 0 %
 09.06.2016 21:23:07 Lamp Bank (KAKU_BANK) Dimlevel 1 %
 09.06.2016 21:23:07 Lamp Bank (KAKU_BANK) Dimlevel 49 %
 09.06.2016 21:23:04 Lamp Bank (KAKU_BANK) Dimlevel 1 %
 09.06.2016 21:23:04 Lamp Bank (KAKU_BANK) Dimlevel 26 %

I have stripped the config file down to only one dimmer and the homeduino plugin. The rest has been removed. But still the same behaviour…:-( Even disabled the receiver by changing the receiver pin of the homeduino config. but no luck.
This is the config of the KAKU Switch

 {
“id”: “KAKU_BANK”,
“name”: “Lamp Bank”,
“class”: “HomeduinoRFDimmer”,
“protocols”: [
 {
“name”: “dimmer1”,
“options”: {
“id”: 1337110,
“unit”: 0
 },
“send”: true,
“receive”: true,
“rfrepeats”: 1
 }
 ]
 },

Hideki Protocol

Please add the support for Weatherstations with Hideki Protcoll, like TFA Nexus.

  • rain [mm]
  • - correction factor for rain [ ]
  • rain rate [mm/h]
  • temperature [°C]
  • humidity [%]
  • wind speed [km/h]
  • wind direction [ 0-359°]
  • wind speed, gust [km/h]
  • wind direction, gust [0-359°]
  • battery status [High / Low]
  • dewpoint [°C]

Regard

AssertionError: false == true at Board._handleAcknowledge

I frequently get this error message when homeduino tries to send data.

error [pimatic]: A uncaught exception occured: AssertionError: false == true
    at Board._handleAcknowledge (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/lib/board.js:315:5)
    at Board._onLine (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/lib/board.js:140:21)
    at SerialPortDriver.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/lib/board.js:83:22)
    at emitOne (events.js:77:13)
    at SerialPortDriver.emit (events.js:169:7)
    at SerialPort.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/lib/driver/serialport.js:64:24)
    at emitOne (events.js:77:13)
    at SerialPort.emit (events.js:169:7)
    at /home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/serialport/parsers.js:25:17
    at Array.forEach (native)
    at Object.parser (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/serialport/parsers.js:24:13)
    at Object.SerialPort.opts.dataCallback (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/serialport/serialport.js:181:12)
    at SerialPortFactory.SerialPort._emitData (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/serialport/serialport.js:396:20)
    at afterRead (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/serialport/serialport.js:372:20)
    at /home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/serialport/serialport.js:388:9
    at FSReqWrap.wrapper [as oncomplete] (fs.js:576:17)
 This is most probably a bug in pimatic or in a module, please report it!

This occured already with 0.8, and continues to occur with 0.9.

Otherwise, homeduino works (via an Arduino Nano connected via USB) most of the time, but I often have issues with sending - sometimes it times out. Pimatic then reports "Oops, timeout" via the browser, without logging anything in the log file (despite debug logging). It's quite unreliable and I don't know why. The above stack trace could probably one part of the problem, possibly the communication doesn't work reliably, but I already lowered the baud rate significantly and have no further idea...

Improved support for customized homeduino sketches

Hi folks,

first of all thanks for this great pimatic framework and the homeduino plugin!

The thing is that although I try to dig into coffeescript and nodejs Î am not able to quickly add own functionality.

The homeduino sketch for arduino is quite easy to extend by adding a serial "identifier" for the new function and creating a function which will be called when the corresponding identifier is received over serial.
The idea for the pimatic-homeduino plugin would be to add a device class where you can configure the serial identifier and it's parameters directly in the pimatic interface. This is already done in a quite comparable way for the mqtt plugin where you simply create the attributes list according to the data which will be received in a message from the device.

Difference is that mqtt will mostly receive JSON formatted messages while homduino splits the parameters with a space.

We would need two device classes:

  • On / Off device (for example to add an IR blaster to the arduino)
    here we would need an on message string and an off message string e.g.: "irblast 16236607"
  • Interval device (for example for i2c sensors)
    here we would need to configure the "requestor" string (e.g.: "bme280") and the attributes list which defines how to interpret the return values from homeduino.
    (e.g.: temperature -> datatype float -> unit °C; humidity -> datatype.....)

Do you think this would be a lot of work?
This is of course no issue but it could push the homeduino-pimatic plugin from "super" to "awesome" :)

Best regards,
Peter

Home Easy protocol not working

Hello the home easy protocol is not working. I can receive the state from my remote but it's a different unit and id as in pilight.

switch4: { unit: 13, id: 10, state: true }

Config from pilight:
systemcode": 22,
"unitcode": 10

Then I wanted to see what pilight receives when I send something through homedunino.
Pilight only receives "arctech_switch_old" as protocol.

So I looked at the implementations of the protocol and I found out, that homeduino works with fixed pulselength and pilight calculates the timings only with one fixed value.

Pwm Dimmer to set Color with 3 pwm pins

Is it possible to implement a 3 Channel pwm to choose a Color for a rgb led Strip? One colorchannel per pwm Pin with rgb values from 0-255 and a suitable chooser in pimatic?

Protcol for Aldi Wetterstation

Hi,
I played around to find a protocol for the Sempre Weatherstation, which Aldi Süd in Germany sold a few weeks ago. I modified the weather1 protocol and built a new one which works.
It's not perfect yet, there are still some bits I cannot assign, but at least id, temperature and huniditiy are working. I still have to find out, where the temperature exactly starts. When there will be negative degrees in the winter, I will find out ;-)
And I will find out, which bit is the battery bit when the battery will be low.

Here's the source code for "weather9.js"

module.exports = function(helper) {
  var protocolInfo, pulsesToBinaryMapping;
  pulsesToBinaryMapping = {
    '01': '0',
    '02': '1',
    '03': ''
  };
  return protocolInfo = {
    name: 'weather9',
    type: 'weather',
    values: {
      temperature: {
        type: "number"
      },
      humidity: {
        type: "number"
      },
      channel: {
        type: "number"
      },
      id: {
        type: "number"
      },
      battery: {
        type: "number"
      }
    },
    brands: ["Sempre (Aldi) GT-WT-02"],
    pulseLengths: [552, 2089, 4137, 9032],
    pulseCount: 80,
    /*
    Bits:       |0 0 0 0 0 0 0 0 |0 0 |1 1 1 1 1 1 1 1 1 1 2 2 2 2 |2 2 2 2 2 2 3 |3 3 3 3 3 3 |  |3 |  |
                |0 1 2 3 4 5 6 7 |8 9 |0 1 2 3 4 5 6 7 8 9 0 1 2 3 |4 5 6 7 8 9 0 |1 2 3 4 5 6 |  |7 |  |
    Pulse like: |0102010201020202|0101|0101010101010102010202010201|02010102020101|020102020101|03|01|03|
                |01010111        |00  |000001011010                |1001100       |101100      |  |0 |  |
                |Id              |Ch ?|Temperature                 |Humidity      |?           |  |? |  |
                |87              |    |90 (9.0)                    |76            |            |  |  |  |
    */
    decodePulses: function(pulses) {
      var battery, binary, result;
      binary = helper.map(pulses, pulsesToBinaryMapping);
      battery = helper.binaryToNumber(binary, 37, 37);
      if (battery === 1) {
        battery = "Good";
      } else {
        battery = "Bad";
      }
      return result = {
        id: helper.binaryToNumber(binary, 0, 7),
        channel: helper.binaryToNumber(binary, 8, 9) + 1,
        temperature: helper.binaryToSignedNumber(binary, 10, 23) / 10,
        humidity: helper.binaryToNumber(binary, 24, 30),
        battery: battery
      };
    }
  };
};

Improve device discovery.

I have a simple weatherstation. Autodiscovey found 3 devices, but only 1 is correct. Is it possible to look also at the variables like the the temperature and humidity? One wrong device showed me -190 degrees. So if a device shows numbers like lower than -50 or higher than +50, don't show them in the discovery.

Maybe this is possible for more devices. I tested domoticz once and it always showed me the right one.

Extension of HomeduinoRFShutter with xOnLabel and xOffLabel doesn't work

device-config-schema.coffee states that a HomeduinoRFShutter can be extended with different labels for the two buttons it comes with. This doesn't work.
When used pimatic fails to create the device because it doesn't have a state attribute and then it crashes here.
Since a state attribute doesn't make sense for shutters, i would say we need an extension for shutters like "xUpLabel" and "xDownLabel". But this would include changes in pimatic and pimatic-mobile-frontend.

Multisensor Device

I have developt a Multisensor Device.
This can show 6 values: "fall of rain", "wind gust", "average airspeed", "wind direction", "temperature" and "humidity".
The clou is, you can control which data is shown on which position. You would only see the temperature and humidity, surprise you must config nothing.
Minimum it shows 1 value and maximum it shows 6 values.
It can receive every value from different protocols.
The config looks like this

    {
      "id": "temperaturmulti",
      "name": "Multi",
      "class": "HomeduinoRFWeatherStation",
      "protocols": [
        {
          "name": "weather5",
          "options": {
            "id": 120
          }
        }
      ]
    },

But you can expand it to this

    {
      "id": "temperaturmulti",
      "name": "Multi",
      "class": "HomeduinoRFWeatherStation",
      "protocols": [
        {
          "name": "weather5",
          "options": {
            "id": 120
          }
        }
      ],
      "values": [
        "rain",
        "humidity",
        "windGust",
        "avgAirspeed"
      ]
    },

The Order of the values defines the order of showen values.
These keywords are availabel
rain, humidity, temperatur, windDirection, avgAirspeed, windGust

for this it was perfect
pimatic/rfcontroljs#13

Device request

Hi,

It would be great if it is possible to use more GPIO pins from the Arduino board. Currently I use the GPIO plugin for some standard devices (a pushbutton and a (wired) contact connected to the raspberry). If Pimatic-homeduino can also implement this it would be great!

My request for Pimatic-homeduino please add a GPIO pushbutton and a GPIO contact (read pin).

I know there is a Pin switch device already.

Little background: I trying to install Pimatic on a Synology. Currently it already runs using chroot (USB/Arduino not yet working.. but I have high hopes). If I can use homeduino for GPIO actions then I don't need the raspberry GPIO's anymore (and a total switch to a Synology device might be possible).

I tried to see if I can create a device/protocol/... myself in Pimatic-Homeduino, but.. well.. I got stuck.

If I read the description of Homeduino correct it is possible to read and write to pins (DR pin).

PS: Thanks for the really great work!

Elro HE843 in Pimatic

Hey guys,

i need some help and maybe someone could help me again.
Ive got a ELRO HE843 and want to use it to turn stuff on and off.
But i dont know how to integrate it to the config.js.

Could anyone help me out ?

Reconnect to Arduino when USB port is reconnected

I try to run pimatic in a Linux VM. For some reason VMWare Workstation sometimes drops the USB connection and restores it. This causes a problem with pimatic-homeduino, it doesn't recognize it and i need to restart. Is it possible to reconnect to the newly discovered Homeduino?

Disabled receiving still working

I want to get rid of pilight. I only have the transmitter through a transistor with a 12V directly on the Pi.
In my config I have:

   {
      "plugin": "homeduino",
      "driver": "gpio",
      "driverOptions": {},
      "enableReceiving": false,
      "transmitterPin": 8
    }

But receiving still work. I have something wrong?

auto reset stopped working

I used auto reset on my doorbel from kaku. But it doesn't work anymore. ACDB-7000B.

{
      "id": "deurbel",
      "name": "Deurbel",
      "class": "HomeduinoRFContactSensor",
      "protocols": [
        {
          "name": "contact1",
          "options": {
            "id": 9329758,
            "unit": 11
          }
        }
      ],
      "autoReset": true,
      "resetTime": 5000
    },

Mobile-Frontend Timeout while sending commands to Homeduino.

On my development pimatic version i got sometimes a strange timeout while activating a activator xD.
I press on an switch to change the state and not happen but press i the button on my remote the button in the mobile-frontend changed his state.
bildschirmfoto vom 2014-11-14 20 35 24

So the received data is right linked to the frontend.
But i think the action-links from the frontend can be broken.

What can i do to discover this?

Homeduino rolling1 value wrong.

After filling in the data #edit-device-page

rolling1
codeOn 100101111011010000010010,100111001110101110010010,100101100000111110100010,100100110011000000100010
codeOff 100110000010101000110010,100110101101010101000010,100100101001001001110010,100111101000000110110010

Value wrong:

    {
      "class": "HomeduinoRFSwitch",
      "protocols": [
        {
          "name": "rolling1",
          "options": {
            "codeOn": "100101111011010000010010,100111001110101110010010,100101100000111110100010,100100110011000000100010",
            "codeOff": "100110000010101000110010,100110101101010101000010,100100101001001001110010,100111101000000110110010"
          }
        }
      ],
      "id": "quigg3-4",
      "name": "quigg3-4"
    }

Must be:

    {
      "class": "HomeduinoRFSwitch",
      "protocols": [
        {
          "name": "rolling1",
          "options": {
            "codeOn": [
              "100101111011010000010010",
              "100111001110101110010010",
              "100101100000111110100010",
              "100100110011000000100010"
            ],
            "codeOff": [
              "100110000010101000110010",
              "100110101101010101000010",
              "100100101001001001110010",
              "100111101000000110110010"
            ]
          }
        }
      ],
      "id": "quigg3-4",
      "name": "Camara noord"
    }

Already thanks for the adjustment.
Wim.

china type bbq thermometer

Following protocol does work for this bbq thermometer:
http://www.ebay.de/itm/262116800749
Maybe someone can merge it in the master.

module.exports = function(helper) {
  var protocolInfo, pulsesToBinaryMapping;
  pulsesToBinaryMapping = {
    '01': '0',
    '02': '1',
    '03': ''
  };
  return protocolInfo = {
    name: 'weather17',
    type: 'weather',
    values: {
      temperature: {
        type: "number"
      },
      id: {
        type: "number"
      },
      channel: {
        type: "number"
      },
    },
    brands: ["BBQ Thermometer"],
    pulseLengths: [548, 1008, 1996, 3936],
    pulseCount: 66,
    decodePulses: function(pulses) {
     /*
      Pulse like:
      |020202010101|0101|01010101010101020101010102010201|0201010102010202|03|
      | 1 1 1 0 0 0| 0 0| 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0| 1 0 0 0 1 0 1 1|  |
      |ID          | CH |            Temperature         |?               |  |
      |56          |  1 |            266(26.6)           |?               |  |
    */
      var binary, result;
      binary = helper.map(pulses, pulsesToBinaryMapping);
      return result = {
        id: helper.binaryToNumber(binary, 0, 5),
        temperature: helper.binaryToSignedNumber(binary, 8, 23) / 10,
        channel: helper.binaryToNumber(binary, 6, 7) + 1,
      };
    }
  };
};

Sending with generic protocol.

Is there a possibilty to send with the generic protocol? Would be nice to use it for selfmade 433mhz devices instead of abusing the KaKu, or any other, protocol for this purpose.

tranceiver and 868

Would it be possible to support a transceiver with this plugin ?
currently I have 1 receiver and 1 transmitter but would like to replace this with one transceiver.

secondly would it be possible to support 868 mhz transceivers as well with this plugin ?

Computer with Arduino connected running homeduino

The readme file states:

A. Computer with connected arduino (with homeduino sketch) and 433mhz transmitter and receiver (recommended)
B. Raspberry Pi (or Banana Pi or Hummingboard) with 433mhz transmitter and receiver

Although I have several Raspberry Pi's I am looking to set this up with an Arduino and a laptop. Can you please confirm this is possible and the basic steps I need to take.

I have tried adding the RFControl sketch to the Arduino and also homeduino but I was struggling with missing libraries. Some of the files in the github for RFControl were updated in the last few hours so maybe I will try again but a basic setup guide would help. I notice lots of references to the Raspberry Pi and the name pimatic-homeduino suggests strong links to the Pi so maybe it is not possible to use this software with a PC and an Arduino.

Enabling pimatic-homeduino gives EACCES exception on startup.

Yesterday everything worked fine, but now when I restart pimatic I get this error:

14:30:08.466 [pimatic] info: New device "Zitkamer RF"...
14:30:09.866 [pimatic] error: A uncaught exception occured: Error: spawn EACCES
14:30:09.866 [pimatic] error:> at errnoException (child_process.js:980:11)
14:30:09.866 [pimatic] error:> at Process.ChildProcess._handle.onexit (child_process.js:771:34)

I tried installing the old version npm install [email protected] but that didn't work sadly.
I know it's homeduino because when I disable the plugin pimatic loads fine.

Send repeats

Hi,

Is it possible to choose the number of send repeats?

I have a KaKu switch outside my house and sometimes it doesn't react on commands sends by this (awesome) plugin. If I later send on/off commands manually it works perfectly.

Therefore I believe it sometimes misses commands and this could probably be solved by sending the same command multiple times.

Thank you!

[pimatic-homeduino]: data: "ERR argument_error"

I flashed homeduino on a nano V3 Clone with the IDE, using default trasmission and receive pins. Pimatic recognizes the board on USB and I can succesfully receive and check received commands from a remote for RF wall plugs.

This is the debug log of one of the keys related:

ON STATE:

debug [pimatic-homeduino]: received: [ 100, 209, 403, 1005, 4776 ] 2121212121212121212131313131312121212104
debug [pimatic-homeduino]: data: "RF receive 403 209 1005 100 4776 0 0 0 0101010101010101010121212121210101010134"
debug [pimatic-homeduino]: received: [ 114, 194, 444, 704, 4768 ] 212121212121212121213202210221022102210221020204
debug [pimatic-homeduino]: data: "RF receive 444 194 704 114 4768 0 0 0 010101010101010101012030013001300130013001303034"
debug [pimatic-homeduino]: switch8: { systemcode: 0, programcode: 'F16', state: false }
debug [pimatic-homeduino]: switch6: { systemcode: 31, programcode: 1, state: true }
debug [pimatic-homeduino]: received: [ 150, 459, 4728 ] 10101010101010101010010101100110011001100110010102
debug [pimatic-homeduino]: data: "RF receive 459 150 4728 0 0 0 0 0 01010101010101010101101010011001100110011001101012"

OFF STATE:

debug [pimatic-homeduino]: switch8: { systemcode: 0, programcode: 'F8', state: false }
debug [pimatic-homeduino]: switch6: { systemcode: 31, programcode: 2, state: true }
debug [pimatic-homeduino]: received: [ 150, 459, 4736 ] 10101010101010101010011001010110011001100110010102
debug [pimatic-homeduino]: data: "RF receive 459 150 4736 0 0 0 0 0 01010101010101010101100110101001100110011001101012"
debug [pimatic-homeduino]: switch8: { systemcode: 0, programcode: 'F16', state: false }
debug [pimatic-homeduino]: switch6: { systemcode: 31, programcode: 1, state: false }
debug [pimatic-homeduino]: received: [ 113, 182, 447, 4768 ] 21212121212121212121020202211221122102210202022103
debug [pimatic-homeduino]: data: "RF receive 447 182 113 4768 0 0 0 0 01010101010101010101202020011001100120012020200123"

I supposed by looking at all the other debug logs of the other keys on the remote that switch6 should be the right one, so I added a device with it, but when I try to activate the switch I get the error:

debug [pimatic-homeduino]: Sending Pin:4 Repeats: 7 Protocol: switch6
debug [pimatic-homeduino]: data: "ERR argument_error"

I added it in json as follow:

{
  "id": "wallplug",
  "name": "Presa RF 3",
  "class": "HomeduinoRFSwitch",
  "protocols": [
    {
      "name": "switch6",
      "options": {
        "systemcode": 31,
        "programcode": 1
      }
    }
  ]
},

I also tried to add the sample code for switch1 for test and I get the same error. I have no other errors in pimatic messages' page or anything else that seems wrong.

Use Plugin without Arduino

Hi There,

I read its recommended to use Arduino, but then you also can use it without?
I have a 433Mhz transmitter and receiver at my RPI.

Did test with ./codesend 123 and on second terminal ./RFsniffer
That is working.

Can someone assist me? :)

relays board with homeduino?

I have a 8 relays board that I would like to hook to the arduino running the homeduino sketch, can it be driven this way or am I looking at edit the arduino sketch itself? Can any one point me in the direction? Maybe I am missing the point and the relay board should be setup differently ?

pir & contact sensor seems to have issues in v0.9

from the forum
https://forum.pimatic.org/topic/1954/signals-are-not-evaluated

under Pimatic 0.9 my Pir’s and my Contact Sensors are not longer evaluatet. In the debug mode I can see, when a Pir or a contact sensor is closeing, but nothing is displayed. So my Rules don’t work Under 0.8 I had no Problems with it.

Here two of my Sensors:

{
“protocols”: [
{
“name”: “alarm1”,
“options”: {
“id”: 3993419
}
}
],
“id”: “feueralarm1”,
“name”: “Feueralarm”,
“class”: “HomeduinoRFContactSensor”,
“xClosedLabel”: “Feueralarm!!!”,
“xOpenedLabel”: “kein Alarm”
}
{
“protocols”: [
{
“name”: “pir5”,
“options”: {
“id”: “14289546”,
“unit”: 9
}
}
],
“autoReset”: true,
“resetTime”: 6000,
“id”: “bewegungsmelder-flur”,
“name”: “Bewegungsmelder Flur”,
“class”: “HomeduinoRFPir”,
“xPresentLabel”: “keine Bewegung”,
“xAbsentLabel”: “Jemand ist im Flur”
}

check also these forum threads where similar problems occur
https://forum.pimatic.org/topic/1938/amst-606-problem-with-0-9
https://forum.pimatic.org/topic/1946/unable-to-switch-on-homeeasy-he800s

homeduino plugin don't receive

if i connect via screen to arduino (screen /dev/ttyUSB0 115200) i see all

ready
PING hello
ACK
RF receive 676 4319 2028 10136 0 0 0 0 010201020102020101020102010202010102010202010201010201020102010202010102020101020102010201020102010201020102010201020102010201020102010201020102010201020102010202010102020101020201010202010201020103
RF receive 675 4320 2029 10132 0 0 0 0 010201020102020101020102010202010102010202010201010201020102010202010102020101020102010201020102010201020102010201020102010201020102010201020102010201020102010202010102020101020201010202010201020103
RF receive 294 966 378 9900 0 0 0 0 01010101011201120110011001120101011001100110010103
RF receive 319 952 9888 0 0 0 0 0 01010101011001100110011001100110011001101010101002
RF receive 298 970 384 9892 0 0 0 0 01010101011001100110011001100101011001120110010103
RF receive 254 974 388 9920 0 0 0 0 01010101011201120112011201120112010101120112010103
RF receive 305 967 9896 0 0 0 0 0 01010101011001100110011001100110010101100110010102
RF receive 675 4316 2026 10128 0 0 0 0 010201020102020101020201020102010102020102010201010201020102010201020201020101020102010201020102010201020102010201020102010201020102010201020102010201020102010201020201010202010201010202010102010203
RF receive 677 4314 2025 10124 0 0 0 0 010201020102020101020201020102010102020102010201010201020102010202010102020101020102010201020102010201020102010201020102010201020102010201020102010201020102010202010201020101020102020102010102010203
RF receive 698 4288 1999 10088 0 0 0 0 010201020102010202010201020102010201010202010102010201020102010201020201020101020102010201020102010201020102010201020102010201020102010201020102010201020102010201020201020102010102010201020102020103

My pimatic log say me this:

17:48:46.896 [pimatic-homeduino] info: Connected to homeduino device.
debug [pimatic-homeduino]: data: "ready"

i did'nt see any receive code.

It works for me until i'm updating homeduino plugin to last version

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.