Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO-NC relay #9

Open
aptyp222 opened this issue Dec 7, 2016 · 7 comments
Open

NO-NC relay #9

aptyp222 opened this issue Dec 7, 2016 · 7 comments

Comments

@aptyp222
Copy link

aptyp222 commented Dec 7, 2016

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!

@thewhitestig
Copy link

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.

@rinoronie
Copy link

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

@voggers
Copy link

voggers commented Sep 1, 2018

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

@PJMikols
Copy link

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!

@junicello
Copy link

junicello commented Jun 25, 2019

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
Copy link

junicello commented Jun 25, 2019

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

@base64bits
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants