Raspberry Pi - Simple Garage Door Opener questions

Hi All. I am almost finished with my Automatic Gate Controller using Homebridge and the “homebridge-simple-garage-door-opener” code found here : https://www.npmjs.com/…/homebridge-simple-garage-door-opener. However, I can’t seem to figure out how to modify the code so that it automatically closes after say 5 minutes. It says it is closing but never seems to send any power to the relay during this “closing” event. Also, I have attached a picture of the setup as I found many sites don’t seem to show images of how to hook things up. (I take no responsibility in how you set it up, this is just how I did it).

Sounds interesting.

There was no picture attached.

Link seems broken, you probably mean this one;

which is an NPM package of the source code at

and there is just one JavaScript source code file.

The plugin has several assumptions that you may be aware of;

  • the door does not tell the plugin what state it is in, so the plugin simulates the door instead of reporting real data,
  • the door is presumed to take 15 seconds to open,
  • the door is presumed to close itself after 30 seconds,
  • the door is presumed to take 15 seconds to close,

The program has no way to know what state the door is in. It simulates rather than observes. So yes, it won’t send any power to a relay at the time it says “closing”.

If your door is different, and doesn’t close itself, you’ll need to;

  • change simulateTimeOpen to an impossibly big number,
  • write some change to the program that will trigger the close.

I’m not sure how to do that second step. It will depend on how homebridge preserves plugin state, and I’m not familiar with homebridge. It might be enough to check the last open time against current time in the get function, and take action there. But that would only work if your device (phone) keeps the page open until the time expires. Might not be practical.

Hope that helps.

Yea, I’m okay with not knowing the “real state” and having it such that it says that is “open” until told to close. But would be greatly appreciative if someone with a knowledge of this code could post some code I can modify or copy and paste which will work with

“Close my Gate” which basically does the same thing as opening.

Check out the forks of the GItHub repository. Several people there are very familiar with the code and have changed it from the original design.