# Garage Door - revisited

**URL:** <https://discourse.nodered.org/t/garage-door-revisited/93404>\
**Category:** Share Your Projects\
**Created:** [24 November 2024 14:16 UTC](https://discourse.nodered.org/t/garage-door-revisited/93404 "2024-11-24T14:16:18Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [24 November 2024 14:16 UTC](https://discourse.nodered.org/t/garage-door-revisited/93404/1 "2024-11-24T14:16:18Z")

</div>

I posted this project way back in November 2021, so 4-years old now.

> [@Trouble getting started with Alexa-remote](https://discourse.nodered.org/t/trouble-getting-started-with-alexa-remote/54254/26):
>
> Could you explain what you are hoping to do with Alexa as that would help with my response. I've used the Q&A feature of Blueprints to get a response from Alexa that I can trap and use. Although the Q&A feature was intended for someone to ask a question and get a known answer, you can adapt it so you can make a 'statement' and get a known response. For example, "Alexa, open garage door" or "Alexa, tell me about the garage". You can get Blueprints to return a pre-defined answer that you can use…

This is a photo of the original project installed on my garage wall...

 ![sunday_roller_door_B](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/e/5eab3bf35d3a07519b9990fbf001b7534ba79440.jpeg)

This week I took another look at the project with a view to bringing it up-to-date.  
These are the changes I've implemented...

- Re-written the code using Micro-Python
- Removed the ESP-01S and re-routed D4 to drive the transistor that drives the relay
- Swapped the Wemos D1 Mini for an ESP32-S2-Mini (faster processor and more PSRAM)
- Enhanced the functionality to include sending responses to Alexa and Telegram
- Enhanced the functionality to include (software) locks to Lock/Unlock the door
- Created a dashboard so I could see what the door is doing and also control it remotely  
Here's a screenshot of the revised D1-dashboard.  
 ![sat_new_dashboard](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/c/ecd2e79fb9968de1bead54c97921555b3093b148.png)

I completely revamped the original FSM (Finite State Machine) so the new machine would handle sending feedback messages to Alexa and Telegram. Here's a small part of the FSM...

 ![sat_door_B](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/d/8d536c18e917e2991e186d5f5e399053e5849497.png)  
Here's a copy of the state transition diagram...  
 ![FSM_garage_door](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/a/2ae7678beb5ad5ccecde25d40cd7a7b16a645128.png)  
The top and bottom microswitches (used to detect whether the door is fully open or fully close) force the FSM into state S2 or S0. The following voice commands, sent via Alexa, and decoded using the VSH (Virtual Smart Home) node move the machine from one state to another.

"Alexa, open roller door"  
"Alexa, stop roller door"  
"Alexa, operate roller door"  
"Alexa, close roller door"

"Alexa, lock roller door"  
"Alexa, unlock roller door"

This is how some sample commands appear on Telegram...

 ![sunday_roller_door_E](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/a/ca06db9a8c8d6980e7e4e087eb0e530a86a3035c.jpeg)

Some parts of my Node-RED flow are...

 ![sunday_roller_door_C](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/2/e2eb5b1eded5a9e23521857b1c51471315acd154.jpeg)  
 ![sunday_roller_door_D](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/2/c2208ea4bbfaff9ef6d324078c7da6f330d36e77.jpeg)  
This is what the new board looked like during the "testing" phase prior to installing it in the plastic box on the wall. My next step is to bring the documentation up-to-date and then write a tutorial.  
 ![sunday_roller_door_A](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/4/247d30c00382af7500527b10fd5e27c3028e5042.jpeg)

---

<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:** [24 November 2024 17:16 UTC](https://discourse.nodered.org/t/garage-door-revisited/93404/2 "2024-11-24T17:16:47Z")

</div>

I had a PM from someone asking for a schematic of the PCB.  
If anyone is interested, here it is...  
[Schematic\_General-purpose-board\_2024-11-24.pdf](https://discourse.nodered.org/uploads/short-url/jRL7d97PBPfdj3lXNzAmKvqK0mq.pdf) (86.4 KB)

Note: I've connected a wire link from D4 on the microcontroller to pin-1 on the ESP-01S socket.
