pimatic / pimatic-homeduino

Pimatic plugin for using 433mhz devices and sensors with a connected Arduino with homeduino sketch
https://pimatic.org/
GNU General Public License v2.0
37 stars 29 forks source link

transition from pilight to homeduino with Elro HE #13

Closed wutu closed 9 years ago

wutu commented 9 years ago

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?

sweetpi commented 9 years ago

Id's in pimatic and pilight are not always the same. See https://github.com/pimatic/pimatic/issues/380 . Don't know if it applies to the switch2 protocol as well.

wutu commented 9 years ago

I read this beffore, but the second attempt closer. The answer is rather hidden here: https://github.com/pimatic/pimatic/issues/383#issuecomment-63406579

correct settings is:

"unitCode": "10000",
 "houseCode": "31"

Working with switch2 even with switch3.

Thanx @Rantir

sweetpi commented 9 years ago

correct settings is:

The part looks wrong to me. Does giving the unitCode as binary-string work?

I think we should change the unitCode to match the pilight ones, because that would lead to less confusion and unit code 1 probably make more sense.

wutu commented 9 years ago

For 10DIP device, I quite like binary code. Simple adjustments according DIP switches. Then I would have:

"houseCode": "11111",
"unitCode": "10000"