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

on/off inverted #40

Closed quantenschaum closed 9 years ago

quantenschaum commented 9 years ago

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.

mwittig commented 9 years ago

Use switch2 - which is the inversion of switch3

quantenschaum commented 9 years ago

Thanks, it works.

For anyone migrating from pilight, the 5 bit house and unit codes in pilight are bitwise inverted. This means pilight

        "sw1": {
            "name": "Switch A",
            "protocol": [ "elro_hc" ],
            "id": [{
                "systemcode": 10,
                "unitcode": 15
            }],
            "state": "off"
        },

becomes pimatic-homeduino

    {
      "id": "pilight-living-sw1",
      "name": "Switch A",
      "class": "HomeduinoRFSwitch",
      "protocols": [
        {
          "name": "switch2",
          "options": {
            "houseCode": 21,
            "unitCode": 16
          }
        }
      ]
    }

The 10 = 0b01010 becomes 0b10101 = 21 and 15 = 0b01111 becomes 0b10000 = 16.

mwittig commented 9 years ago

Oh, interesting. I think we should put a side note into the README. I'll take an action on this.