homebridge-gpio-garagedoor
homebridge-gpio-garagedoor copied to clipboard
NO-NC relay
Hello, I really like your progrrmma to control the gate. but I ran into a problem when connecting the gate will automatically open (there is a connection management contacts at 1 second) What you need to sign in to add to config.json gpio23 was NO by default? He is now NC "Example doorSwitchValue": 1, ""? Thank you!
I have a hack for this, it's done by reversing the switchPort logic. This includes initializing switchPort as 'high' when creating the object, as well as reversing the signal mapping in GPIOPort. In switchPort.ts constructor(pin, service, log, doorSensor: DoorSensorPort, doorOpensInSeconds) { super(pin, 'high'); this.service = service; In GPIOPort.ts export enum GPIOState { On = 0, Off = 1, }
Again, this is just a hack... a more proper way is to create the GPIO object as activeLow true, which requires passing the parameter properly.
In versione 0.2.2 I don't find this section: constructor(pin, service, log, doorSensor: DoorSensorPort, doorOpensInSeconds) { super(pin, 'high'); this.service = service;
and
export enum GPIOState { On = 0, Off = 1, }
If anyone else is struggling with this: Changes done in "/usr/lib/node_modules/homebridge-gpio-garagedoor/lib"
SwitchPort.js:
Changed "_super.call(this, pin, 'out');" to "_super.call(this, pin, 'high');"
GPIOPort.js:
Changed "GPIOState[GPIOState["On"] = 0] = "On"; GPIOState[GPIOState["Off"] = 1] = "Off";"
to
"GPIOState[GPIOState["On"] = 1] = "On"; GPIOState[GPIOState["Off"] = 0] = "Off";"
Changes done in "/usr/lib/node_modules/homebridge-gpio-garagedoor/lib"
also possible it's in "/usr/local/lib/node_modules/homebridge-gpio-garagedoor/lib/"
WORKED FOR ME! Thanks guys!
Would be great to get this resolved and pushed out. Who can make this happen? I am willing to jump in but don't have much experience with GIT pipeline.
@KraigM Are you still managing this project?
Worked for me as well using a dual relay setup with the following configuration:
{
"accessory": "GPIOGarageDoor",
"name": "Door",
"doorSwitchPin": 23,
"doorSensorPin": 18,
"isNCSensor": false,
"doorOpensInSeconds": 14
},
{
"accessory": "GPIOGarageDoor",
"name": "Grill",
"doorSwitchPin": 24,
"doorSensorPin": 17,
"isNCSensor": true,
"doorOpensInSeconds": 120
}
diff SwitchPort.js SwitchPort.js.backup 16c16 < _super.call(this, pin, 'high'); --- > _super.call(this, pin, 'out'); diff GPIOPort.js GPIOPort.js.backup 16,17c16,17 < GPIOState[GPIOState["On"] = 0] = "On"; < GPIOState[GPIOState["Off"] = 1] = "Off"; --- > GPIOState[GPIOState["On"] = 1] = "On"; > GPIOState[GPIOState["Off"] = 0] = "Off";
For those unable to find the files to modify in my case I found them under /usr/local/lib/node_modules/@bluephlame/homebridge-gpio-garagedoor/lib