[SOLVED] Looking for Ideas on Garage door Solution

Currently have a Chamberlain garage door opener and was using the MYQ add on to control it through openhab but they keep changing the API which renders the add on useless.

Looking for ideas what and how to use to add:

a switch to open/ close the door

2 switches for feedback for open and closed messages.

Currently have a couple of node MCUs lying around thinking i could utilise these?


I managed to leverage this little guy -
Qubino Z-Wave Plus Universal Relay with Dry Contact Switch https://www.amazon.com/gp/product/B01MSEG2J1/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1

I hooked up the power to the opener itself and rely on a tilt sensor on the door to know the position. Did find out when you hijack into the wires that the wall push button uses it prevents the wall button from working a two second expire on the items resolved it.

This is exactly what I do, only I use an RPi with a relay. And it works perfectly. What problem did you have and how did Expire fix it?

You absolutely could use a NodeMCU to do this. Install Tasmota or ESPEasy on it, wire up the relays to the NodeMCU and wire up the relays to the door. I use wired reed sensors to detect when the door is open and closed. Some day I plan on making it a bit smarter (add a second set of sensors, add opening and closing states, etc.).

1 Like

With my device when a ON is issued it seems to close the circuit (light on the push button actually turns off as if I pushed it and held it down). Using expire on the item after 2 secs will change back to OFF and open the circuit (I may also have my opens and closed terminology backwards).

Remotes or car built in programmed buttons still function if the zwave device is ON, which can sometimes backfire if a spouse doesn’t want to wait for their phone to be detected and hits the button in the vehicle just as the phone is detected causing the door to stop halfway or close.

What has also been nice in my case is a nightly reminder that the garage door still being open via telegram and having options to close the door/remind in 5 (just to verify nothing is going to be crushed by the door). Currently thinking of a way to have my telegram bot have a command that I can query to open the door if someone needs to pick something up or drop something off; saving me a early trip home or giving out the code to the external opener.

I was in the same position as you are, and had the exact same problem about a year ago when MyQ did the same thing. To prevent this from happening again I just bought the Aeon Labs Garage Door Controller Gen5 and soldered it to the push button switch in the wall controller. You can’t connect it directly to the wires going to the opener itself. This device gives you an audible and visual alarm when it is operated remotely which is required by building codes in most places.

1 Like

Ah, OK. What you should do, if you want to improve it at some point, is implement the on/off sequence on the device itself instead of in OH. That’s what I do (see https://github.com/rkoshak/sensorReporter, toggle configuration for the gpio actuator). It closes the relay for half a second then opens it itself. Indeed, if you don’t open the relay it’s like you are standing there with your finger on the button forever which will override the opener from responding to the remotes or actual button presses.

But since this is a Zwave device, you may not have the ability to do this on the device, but I would at least check to see if there is a configuration parameter. 2 seconds is probably way longer than necessary. I can’t remember if it supports < 1 second though.

You can’t just use the phone app?

Looks like I have some options that I never looked into (took me 3 days to figure out the hookup).

Looks like I can times directly on the flush device…need people not to be home to try these out.

Don’t have the app installed, also gives me a way to share a group with the spouse and only present conditioned answers/keyboards. I also have a self project at work to leverage some telegram Node Red chat bot things, so more learning on how to accomplish things.

I have a Marantech 250.2 garagedoor opener. It´s far from fancy, as it use a remote with a single pushbutton to operate. First push, it starts moving, second push it stops if it´s on the move (or if it´s fully open/closed, it starts move again). Third push (if it´s not at the end) it moves in the opposite direction. Pretty ackward way to control a garagedoor in a smart way.

I have a wireless sensors at the top and at the bottom of the garagedoor. From this I know when it´s fully open or fully closed. Thats basicly it.
I have added a relay to be able to control it from our normal push buttons around the house as well as from openhab.

I have thought about how to make this a bit smarter using openhab, but I havn´t figured this one out yet. Since I cant controle the direction, its almost impossible to make anything smarter, unless I risc the chance that it may become out of sync. (ie using proxy switches for the direction will most probably fail sooner or later, when I cant controle the direction).
Best option would be to have a garagedoor opener, which has two inputs, one for for each direction.

This is pretty standard for garage door controllers, even the smart ones.

With two sensors you can keep track of the last state and based on the last state forgot it what state the door entered as a result of the button press.

Previous state Current state new state
Any Closed opening
Any Opening stopped
Opening stopped closing
Any closing stopped
Closing stopped opening
Any opened closing

Writing a rule to that truth table should not be that hard. The only gotcha is the door opener would need to report when the physical button is pressed or else you won’t be able to detect the charger from stopped to opening or closing.

For scripted automation users, @glhopital created a state machine module which is predict to implement something like this. Finished State Machine in Jython

1 Like

For opening and closing, I simply used a Sonoff SV running Tasmota. This is wired into the wired button switch. No issues with this setup.

For state, I added a heavy duty magnetic contact. In my setup this runs through my alarm system to OH, but no reason you shouldn’t be able to use one of these with a NodeMCU (and MQTT) for example as standalone sensor. Eg of the contact: https://www.amazon.com/Heavy-Duty-Magnetic-Switch-N-Contact-Circuits/dp/B00CAIVNM4

Thanks Rich… As usual you make rather complicated stuff sounds so easy :slight_smile:
It still gets beyound my knowledge unfortunaly, as there are too many things going on… I get the idea, but turning that idea into a working rule simply isn´t that simple for me.
I´ll take a look at the link you provided.

For the wired buttons (relay) I have added, this is not a issue. But for the RF remote (original Marantech remote), this will for sure become an issue.

Here’s a write up I did on how I added my garbage doors and gate to OH. Maybe it will provide some ideas.

1 Like

I tilt sensor or sonic distance sensor could be used to detect when the door is moving if it is a big problem.

It’s just a bunch of book keeping and some if statements. That’s the case for all state machines (this is what we have here).

from core.rules import rule
from core.triggers import when

prevState = None

@rule("Garage door status")
@when("Item DoorOpenedSensor changed") // sensor that is OPENED when door is fully open
@when("Item DoorClosedSensor changed") // sensor that is CLOSED when door is fully closed
@when("Item DoorController received command")
def door_ctrl(event):
    newState = "UNDEF"
    currState = items["DoorState"]
    # Door is fully closed
    if items["DoorClosedSensor"] == CLOSED:
        newState = "CLOSED"

    # Door is fully opened
    elif items["DoorOpenedSensor"] == CLOSED:
        newState = "OPENED"

    # Door is in motion
    elif currState != "STOPPED":
        newState = "STOPPED"

    # Door is partially open but not moving
        newState = "OPENING" if prevState == "CLOSING" else "CLOSING"

    # Could use persistence for this, keep track of the previous state so we can handle the STOPPED case
    global prevState
    prevState = currState

    events.postUpdate("DoorState", newState)
1 Like

Hmm I do have a third sensor which is indeed is a tilt sensor ( Vision zwave garage door tilt sensor which I totally forgot all about). But it wont do for a button, as the garage door will have moved quite a bit, before the sensor triggers.

You once helped me with this rule, which I´m still using. I assume much of it can be used, (btw the var moving seems to give an error, but openhab use the rule anyway. I think this happened when I updated from openhab 2.4 to 2.5. I havn´t done anything to try change it, yet):

// Rule for status notification (light) of the GaragePort

rule "Garageport moving"
    Member of GaragePortSensors changed

    // default to the door is NOT moving
    var moving = false
    var lightState = OFF

    // If either sensor is OPEN then the door IS moving
    if(GaragePortBottomSensor.state == OPEN && GaragePortTopSensor.state == OPEN) {
        moving = true
        lightState = ON

    // Figure out if the door is fully open or fully closed or on the move
    var message = "on the move"
    if(GaragePortBottomSensor.state == CLOSED)	{ 
	message = "fully closed"
            sendPushoverMessage(pushoverBuilder("Garage door is fully closedt!").withSound("none"))



    if(GaragePortTopSensor.state == CLOSED)	{ 
	message = "fully open"
            sendPushoverMessage(pushoverBuilder("Garage door is fully open!").withSound("none"))

    // change the status light and send the log.
       logInfo("garageport.status", "garage door is " + message)

// Items
// Group GaragePortSensors	- Group Top and Bottom sensors.
// GaragePortBottomSensor 	- Bottom sensor
// GaragePortTopSensor	 	- Top sensor
// GaragePortMovingLight 	- Virtuel item, control light for door open or on the move.
// GaragePortBottomLight	- Virtuel item, control light for door has reached the bottom (fully closed)
// GaragePortTopLight 		- Virtuel item, controle light for door has reached the top (fully open).
// Logic:
// When Garageport is fully closed and not moving, GaragePortBottomSensor will be CLOSED and GaragePortTopSensor will be OPEN. 
// When Garageport is fully open, GaragePortTopSensor will be CLOSED and GaragePortBottomSensor will be OPEN. 
// When Garageport is on the move, both sensors wil be OPEN, untill garageport reach the end, then either GaragePortTopSensor or GaragePortBottomSensor will be CLOSED, depending on direction.

Your Rule does pretty much the same as mine except I have it indicate which direction the door is moving.

Thanks for all the input.

I now have a working model with a Node MCU running Tasmota, 2 reed switches (one for Open and one for closed) and a relay.

Now for my next issue…

My garage door needs a Push switch action to trigger the open/close but my relay stays in the open position until i reselect it to closed.

How can i make the relay complete a momentary output to trigger the door open/close?


Im having loads of errors when i use this rule in my rules, its not liking the ‘when’ and also the ‘froms’ at the top.

Did you install and configure Jyrhon and the Helper Libraries?

oh… No, how would i do this?