# One-button garage - help

**URL:** <https://discourse.nodered.org/t/one-button-garage-help/66354>\
**Category:** General\
**Created:** [12 August 2022 10:36 UTC](https://discourse.nodered.org/t/one-button-garage-help/66354 "2022-08-12T10:36:23Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [12 August 2022 14:31 UTC](https://discourse.nodered.org/t/one-button-garage-help/66354/4 "2022-08-12T14:31:37Z")

</div>

I think I have a similar garage door control as you - a key-fob that opens or closes the door with the same button. I dropped the key-fob a few months ago and damaged the plastic case. However the electronics still worked. I found the pads on the PCB where the button connects and soldered a couple of wires on them. The wires go to a relay which is operated by an ESP-01 from Node-RED via MQTT. I used Alexa so I could say... "Alexa, open/close garage door" The only thing I had to do was fix a couple of microswitches to the top and bottom positions of the door's travel - so I could detect when it was at the top or bottom. Here's a link to the thread I published about it.

> [@Trouble getting started with Alexa-remote](https://discourse.nodered.org/t/trouble-getting-started-with-alexa-remote/54254/25):
>
> No, exactly not like this! This node requires to hook up to yet another cloud service which provides the interface to Alexa. Not what I want.

![garage_door](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/8/6840d4a058ab6d04f0493e8176d048714b4aa5a6.png)  
I designed a Finite State Machine (FSM) to sort out the 'funny' situations, like... asking the door to open when it is already fully open; or asking it to close when it is fully closed. FSM is also used to try to track what the door is doing. e.g. opening, closing, fully-open, fully-closed.

 ![FSM_garage_door](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/9/7986dedb2be0f8cc0f21f61b718bca89628f42a6.png)  
tms = top microswitch (when closed forces the FSM to go to state S2)  
bms = bottom microswitch (when closed forces the FSM to go to state S0)  
ogd = Alexa command... "operate garage door"  
sgd = Alexa command... "stop garage door"

Here's part of the Dashboard (I used for testing) with an animation of the roller door.  
 ![garage_dashboard](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/9/99f66b3f99e800a68fd869f7f632d05233d0a3e3.png)  
My door takes 25-secs to open or close, so I adjusted the timing in the animation accordingly.

This link has a couple of photos of the installation with my PCBs.  
[https://discourse.nodered.org/t/another-set-of-pcb-designs-for-wemos-d1-mini-and-esp01-s/52770/6](https://discourse.nodered.org/t/another-set-of-pcb-designs-for-wemos-d1-mini-and-esp01-s/52770/6)

---

_[View the full topic](https://discourse.nodered.org/t/one-button-garage-help/66354)._
