homebridge-gpio-garagedoor icon indicating copy to clipboard operation
homebridge-gpio-garagedoor copied to clipboard

NO-NC relay

Open aptyp222 opened this issue 8 years ago • 7 comments

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!

aptyp222 avatar Dec 07 '16 05:12 aptyp222

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.

thewhitestig avatar Oct 20 '17 01:10 thewhitestig

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, }

rinoronie avatar Apr 19 '18 19:04 rinoronie

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";"

voggers avatar Sep 01 '18 09:09 voggers

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!

PJMikols avatar Nov 16 '18 22:11 PJMikols

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?

junicello avatar Jun 25 '19 19:06 junicello

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";

junicello avatar Jun 25 '19 21:06 junicello

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

base64bits avatar Sep 13 '20 04:09 base64bits